diff options
author | Lai Jiangshan <laijs@cn.fujitsu.com> | 2009-07-28 08:17:22 -0400 |
---|---|---|
committer | Frederic Weisbecker <fweisbec@gmail.com> | 2009-07-28 17:17:23 -0400 |
commit | 74e7ff8c50b6b022e6ffaa736b16a4dc161d3eaf (patch) | |
tree | 5bbe7b9f239f1e7b0a688b521f5dca8b9ea99ef4 /kernel/trace | |
parent | 38ceb592fcac9110c6b3c87ea0a27bff68c43486 (diff) |
tracing: Fix missing function_graph events when we splice_read from trace_pipe
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>
Cc: stable@kernel.org
LKML-Reference: <4A6EEC52.90704@cn.fujitsu.com>
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Diffstat (limited to 'kernel/trace')
-rw-r--r-- | kernel/trace/trace.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c index 8bc8d8afea6a..da984ad065ab 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c | |||
@@ -3085,7 +3085,8 @@ tracing_fill_pipe_page(size_t rem, struct trace_iterator *iter) | |||
3085 | break; | 3085 | break; |
3086 | } | 3086 | } |
3087 | 3087 | ||
3088 | trace_consume(iter); | 3088 | if (ret != TRACE_TYPE_NO_CONSUME) |
3089 | trace_consume(iter); | ||
3089 | rem -= count; | 3090 | rem -= count; |
3090 | if (!find_next_entry_inc(iter)) { | 3091 | if (!find_next_entry_inc(iter)) { |
3091 | rem = 0; | 3092 | rem = 0; |
@@ -4233,8 +4234,11 @@ static void __ftrace_dump(bool disable_tracing) | |||
4233 | iter.pos = -1; | 4234 | iter.pos = -1; |
4234 | 4235 | ||
4235 | if (find_next_entry_inc(&iter) != NULL) { | 4236 | if (find_next_entry_inc(&iter) != NULL) { |
4236 | print_trace_line(&iter); | 4237 | int ret; |
4237 | trace_consume(&iter); | 4238 | |
4239 | ret = print_trace_line(&iter); | ||
4240 | if (ret != TRACE_TYPE_NO_CONSUME) | ||
4241 | trace_consume(&iter); | ||
4238 | } | 4242 | } |
4239 | 4243 | ||
4240 | trace_printk_seq(&iter.seq); | 4244 | trace_printk_seq(&iter.seq); |