public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [Patch -tip 1/3] Tracing/ftrace: Relay unhandled entry output
@ 2008-09-25 12:19 Frédéric Weisbecker
  2008-09-25 12:38 ` Ingo Molnar
  0 siblings, 1 reply; 12+ messages in thread
From: Frédéric Weisbecker @ 2008-09-25 12:19 UTC (permalink / raw)
  To: Ingo Molnar; +Cc: linux-kernel, Steven Rostedt, Pekka Paalanen

[-- Attachment #1: Type: text/plain, Size: 798 bytes --]

Hi!

I tried to figure out the origin of the bug reported by Pekka Paalanen
about the broken pipe:
http://kerneltrap.org/mailarchive/linux-kernel/2008/9/15/3305224

When I add a trace_mark with the boot tracer, I had this same problem
but this time it was easy to reproduce.

When it calls a tracer's print_line callback, the print_trace_line function 
in trace.c returns whithout verifying if it could handle the entry properly.
And actually the seq could be empty.

For example the boot_tracer don't handle TRACE_PRINT. Nevertheless it
wants them to be printed as a default way.

So print_trace_line function should relay on the other functions which could handle
an output if one of them fail.

Reported-by: Pekka Paalanen <pq@iki.fi>
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
---

[-- Attachment #2: 1.diff --]
[-- Type: text/plain, Size: 1016 bytes --]

diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index 6ada059..50ac334 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -1904,20 +1904,27 @@ static int trace_empty(struct trace_iterator *iter)
 
 static int print_trace_line(struct trace_iterator *iter)
 {
+	int ret;
+
 	if (iter->trace && iter->trace->print_line)
-		return iter->trace->print_line(iter);
+		if ((ret = iter->trace->print_line(iter)))
+			return ret;
 
 	if (trace_flags & TRACE_ITER_BIN)
-		return print_bin_fmt(iter);
+		if ((ret = print_bin_fmt(iter)))
+			return ret;
 
 	if (trace_flags & TRACE_ITER_HEX)
-		return print_hex_fmt(iter);
+		if ((ret = print_hex_fmt(iter)))
+			return ret;
 
 	if (trace_flags & TRACE_ITER_RAW)
-		return print_raw_fmt(iter);
+		if ((ret = print_raw_fmt(iter)))
+			return ret;
 
 	if (iter->iter_flags & TRACE_FILE_LAT_FMT)
-		return print_lat_fmt(iter, iter->idx, iter->cpu);
+		if ((ret = print_lat_fmt(iter, iter->idx, iter->cpu)))
+			return ret;
 
 	return print_trace_fmt(iter);
 }

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

end of thread, other threads:[~2008-09-29  9:29 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-09-25 12:19 [Patch -tip 1/3] Tracing/ftrace: Relay unhandled entry output Frédéric Weisbecker
2008-09-25 12:38 ` Ingo Molnar
2008-09-25 14:56   ` Frédéric Weisbecker
2008-09-25 15:09     ` Pekka Paalanen
2008-09-25 15:33       ` Frédéric Weisbecker
2008-09-25 15:49         ` Pekka Paalanen
2008-09-25 15:56           ` Frédéric Weisbecker
2008-09-25 16:01             ` Pekka Paalanen
2008-09-25 16:40               ` Frédéric Weisbecker
2008-09-27 17:50                 ` Ingo Molnar
2008-09-29  9:29                   ` Frédéric Weisbecker
2008-09-27 17:53                 ` Ingo Molnar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox