Skip to contentSkip to conversation

libtraceevent: Add new line to trace-seq warnings

PATCH New Steven Rostedt 1 participant 1 message May 14, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libtraceevent: Add new line to trace-seq warnings

From: "Steven Rostedt (VMware)" <[email protected]>

The WARN_ONCE() logic in trace_seq is based off of the WARN_ONCE() logic in the Linux kernel, where the message does not require to end with a new line. But the implementation is different than the kernel, and it lacks adding a new line when it writes the output.

Add the new line to make it match what happens in the Linux kernel.

Fixes 3b760f95 ("tools include: Move perf's bug.h to a generic place")
---
 include/asm/bug.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/asm/bug.h +1 -1
index 550223f..de8f8fe 100644
@@ -5,7 +5,7 @@
 #include <linux/compiler.h>
 #include <stdio.h>
 
-#define __WARN_printf(arg...)	do { fprintf(stderr, arg); } while (0)
+#define __WARN_printf(arg...)	do { fprintf(stderr, arg); fprintf(stderr, "\n");} while (0)
 
 #define WARN(condition, format...) ({		\
 	int __ret_warn_on = !!(condition);	\
Signature · 1 line
2.29.2