tracing: Fix missing function_graph events when we splice_read from trace_pipe
commit5f18da549f0277e1c867169a74b1365d24cc3a9e
authorLai Jiangshan <laijs@cn.fujitsu.com>
Tue, 28 Jul 2009 12:17:22 +0000 (28 20:17 +0800)
committerGreg Kroah-Hartman <gregkh@suse.de>
Sun, 16 Aug 2009 21:18:36 +0000 (16 14:18 -0700)
tree39a62c654891e99a2b9671f4192710d454123d36
parent75db2222e404b259f1fd2caaeb825e8489e02a31
tracing: Fix missing function_graph events when we splice_read from trace_pipe

commit 74e7ff8c50b6b022e6ffaa736b16a4dc161d3eaf upstream.

About a half events are missing when we splice_read
from trace_pipe. They are unexpectedly consumed because we ignore
the TRACE_TYPE_NO_CONSUME return value used by the function graph
tracer when it needs to consume the events by itself to walk on
the ring buffer.

The same problem appears with ftrace_dump()

Example of an output before this patch:

1)               |      ktime_get_real() {
1)   2.846 us    |          read_hpet();
1)   4.558 us    |        }
1)   6.195 us    |      }

After this patch:

0)               |      ktime_get_real() {
0)               |        getnstimeofday() {
0)   1.960 us    |          read_hpet();
0)   3.597 us    |        }
0)   5.196 us    |      }

The fix also applies on 2.6.30

Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
LKML-Reference: <4A6EEC52.90704@cn.fujitsu.com>
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
kernel/trace/trace.c