All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] trace: don't print an extra separator of flags
@ 2012-02-19 11:16 Andrew Vagin
  2012-02-20 18:09 ` Steven Rostedt
  2012-02-27  9:31 ` [tip:perf/core] tracing: Don't " tip-bot for Andrey Vagin
  0 siblings, 2 replies; 7+ messages in thread
From: Andrew Vagin @ 2012-02-19 11:16 UTC (permalink / raw)
  To: linux-kernel; +Cc: avagin, Ingo Molnar, Frederic Weisbecker, Steven Rostedt

From: Andrey Vagin <avagin@openvz.org>

It occurs if __print_flags is used more than once

Signed-off-by: Andrew Vagin <avagin@openvz.org>
---
 kernel/trace/trace_output.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/kernel/trace/trace_output.c b/kernel/trace/trace_output.c
index 0d6ff35..3efd718 100644
--- a/kernel/trace/trace_output.c
+++ b/kernel/trace/trace_output.c
@@ -300,7 +300,7 @@ ftrace_print_flags_seq(struct trace_seq *p, const char *delim,
 	unsigned long mask;
 	const char *str;
 	const char *ret = p->buffer + p->len;
-	int i;
+	int i, first = 1;
 
 	for (i = 0;  flag_array[i].name && flags; i++) {
 
@@ -310,8 +310,10 @@ ftrace_print_flags_seq(struct trace_seq *p, const char *delim,
 
 		str = flag_array[i].name;
 		flags &= ~mask;
-		if (p->len && delim)
+		if (!first && delim)
 			trace_seq_puts(p, delim);
+		else
+			first = 0;
 		trace_seq_puts(p, str);
 	}
 
-- 
1.7.1


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

end of thread, other threads:[~2012-02-27  9:32 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-02-19 11:16 [PATCH] trace: don't print an extra separator of flags Andrew Vagin
2012-02-20 18:09 ` Steven Rostedt
2012-02-20 19:39   ` avagin
2012-02-20 19:47     ` Steven Rostedt
2012-02-20 20:43       ` [PATCH] " Andrew Vagin
2012-02-21  1:18         ` Steven Rostedt
2012-02-27  9:31 ` [tip:perf/core] tracing: Don't " tip-bot for Andrey Vagin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.