DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] mbuf: fix build failure if MBUF_HISTORY_DEBUG enabled
@ 2025-10-24 22:29 Stephen Hemminger
  2025-10-25  6:59 ` Thomas Monjalon
  0 siblings, 1 reply; 2+ messages in thread
From: Stephen Hemminger @ 2025-10-24 22:29 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, shperetz, Morten Brørup, Thomas Monjalon

Message had extra newline which causes build failure.

../lib/mbuf/mbuf_history.c: In function ‘rte_mbuf_history_init’:
../lib/log/rte_log.h:364:9: error: static assertion failed: "This log format string contains a \\n"
  364 |         static_assert(!__builtin_strchr(fmt, '\n'), \
      |         ^~~~~~~~~~~~~
../lib/log/rte_log.h:387:9: note: in expansion of macro ‘RTE_LOG_CHECK_NO_NEWLINE’
  387 |         RTE_LOG_CHECK_NO_NEWLINE(RTE_FMT_HEAD(__VA_ARGS__ ,)); \
      |         ^~~~~~~~~~~~~~~~~~~~~~~~
../lib/mbuf/mbuf_log.h:8:9: note: in expansion of macro ‘RTE_LOG_LINE’
    8 |         RTE_LOG_LINE(level, MBUF, "" __VA_ARGS__)
      |         ^~~~~~~~~~~~
../lib/mbuf/mbuf_history.c:219:17: note: in expansion of macro ‘MBUF_LOG’
  219 |                 MBUF_LOG(ERR, "Failed to register mbuf history dynamic field: %s\n",
      |

Fixes: d265a24a32a4 ("mbuf: record mbuf operations history")
Cc: shperetz@nvidia.com
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 lib/mbuf/mbuf_history.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/mbuf/mbuf_history.c b/lib/mbuf/mbuf_history.c
index 3bc4b916b6..b025d12fc8 100644
--- a/lib/mbuf/mbuf_history.c
+++ b/lib/mbuf/mbuf_history.c
@@ -216,7 +216,7 @@ void rte_mbuf_history_init(void)
 
 	rte_mbuf_history_field_offset = rte_mbuf_dynfield_register(&mbuf_dynfield_history);
 	if (rte_mbuf_history_field_offset < 0) {
-		MBUF_LOG(ERR, "Failed to register mbuf history dynamic field: %s\n",
+		MBUF_LOG(ERR, "Failed to register mbuf history dynamic field: %s",
 			rte_strerror(rte_errno));
 	}
 #endif
-- 
2.51.0


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] mbuf: fix build failure if MBUF_HISTORY_DEBUG enabled
  2025-10-24 22:29 [PATCH] mbuf: fix build failure if MBUF_HISTORY_DEBUG enabled Stephen Hemminger
@ 2025-10-25  6:59 ` Thomas Monjalon
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Monjalon @ 2025-10-25  6:59 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: dev, shperetz, Morten Brørup

25/10/2025 00:29, Stephen Hemminger:
> Message had extra newline which causes build failure.
> 
> ../lib/mbuf/mbuf_history.c: In function ‘rte_mbuf_history_init’:
> ../lib/log/rte_log.h:364:9: error: static assertion failed: "This log format string contains a \\n"
>   364 |         static_assert(!__builtin_strchr(fmt, '\n'), \
>       |         ^~~~~~~~~~~~~
> ../lib/log/rte_log.h:387:9: note: in expansion of macro ‘RTE_LOG_CHECK_NO_NEWLINE’
>   387 |         RTE_LOG_CHECK_NO_NEWLINE(RTE_FMT_HEAD(__VA_ARGS__ ,)); \
>       |         ^~~~~~~~~~~~~~~~~~~~~~~~
> ../lib/mbuf/mbuf_log.h:8:9: note: in expansion of macro ‘RTE_LOG_LINE’
>     8 |         RTE_LOG_LINE(level, MBUF, "" __VA_ARGS__)
>       |         ^~~~~~~~~~~~
> ../lib/mbuf/mbuf_history.c:219:17: note: in expansion of macro ‘MBUF_LOG’
>   219 |                 MBUF_LOG(ERR, "Failed to register mbuf history dynamic field: %s\n",
>       |

This check is enabled only with GCC.
Unfortunately I was testing this feature with clang, so I missed it.

Updated commit title:
	mbuf: fix build with GCC and history debug enabled

> Fixes: d265a24a32a4 ("mbuf: record mbuf operations history")
> Cc: shperetz@nvidia.com
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>

Applied, thanks.



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-10-25  6:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-10-24 22:29 [PATCH] mbuf: fix build failure if MBUF_HISTORY_DEBUG enabled Stephen Hemminger
2025-10-25  6:59 ` Thomas Monjalon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).