diff options
author | Pekka Paalanen <pq@iki.fi> | 2008-11-23 14:24:30 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-11-23 14:33:23 -0500 |
commit | 7ee1768ddb3075ae3a0801cc2d0ea4195530a7db (patch) | |
tree | 403dea91103838cbe56bca586a8f41a470e7a1e4 /kernel/trace | |
parent | 522a110b42b306d696cf84e34c677ed0e7080194 (diff) |
x86, mmiotrace: fix buffer overrun detection
Impact: fix mmiotrace overrun tracing
When ftrace framework moved to use the ring buffer facility, the buffer
overrun detection was broken after 2.6.27 by commit
| commit 3928a8a2d98081d1bc3c0a84a2d70e29b90ecf1c
| Author: Steven Rostedt <rostedt@goodmis.org>
| Date: Mon Sep 29 23:02:41 2008 -0400
|
| ftrace: make work with new ring buffer
|
| This patch ports ftrace over to the new ring buffer.
The detection is now fixed by using the ring buffer API.
When mmiotrace detects a buffer overrun, it will report the number of
lost events. People reading an mmiotrace log must know if something was
missed, otherwise the data may not make sense.
Signed-off-by: Pekka Paalanen <pq@iki.fi>
Acked-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel/trace')
-rw-r--r-- | kernel/trace/trace_mmiotrace.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/kernel/trace/trace_mmiotrace.c b/kernel/trace/trace_mmiotrace.c index f28484618ff0..e62cbf78eab6 100644 --- a/kernel/trace/trace_mmiotrace.c +++ b/kernel/trace/trace_mmiotrace.c | |||
@@ -18,12 +18,14 @@ struct header_iter { | |||
18 | 18 | ||
19 | static struct trace_array *mmio_trace_array; | 19 | static struct trace_array *mmio_trace_array; |
20 | static bool overrun_detected; | 20 | static bool overrun_detected; |
21 | static unsigned long prev_overruns; | ||
21 | 22 | ||
22 | static void mmio_reset_data(struct trace_array *tr) | 23 | static void mmio_reset_data(struct trace_array *tr) |
23 | { | 24 | { |
24 | int cpu; | 25 | int cpu; |
25 | 26 | ||
26 | overrun_detected = false; | 27 | overrun_detected = false; |
28 | prev_overruns = 0; | ||
27 | tr->time_start = ftrace_now(tr->cpu); | 29 | tr->time_start = ftrace_now(tr->cpu); |
28 | 30 | ||
29 | for_each_online_cpu(cpu) | 31 | for_each_online_cpu(cpu) |
@@ -128,16 +130,12 @@ static void mmio_close(struct trace_iterator *iter) | |||
128 | 130 | ||
129 | static unsigned long count_overruns(struct trace_iterator *iter) | 131 | static unsigned long count_overruns(struct trace_iterator *iter) |
130 | { | 132 | { |
131 | int cpu; | ||
132 | unsigned long cnt = 0; | 133 | unsigned long cnt = 0; |
133 | /* FIXME: */ | 134 | unsigned long over = ring_buffer_overruns(iter->tr->buffer); |
134 | #if 0 | 135 | |
135 | for_each_online_cpu(cpu) { | 136 | if (over > prev_overruns) |
136 | cnt += iter->overrun[cpu]; | 137 | cnt = over - prev_overruns; |
137 | iter->overrun[cpu] = 0; | 138 | prev_overruns = over; |
138 | } | ||
139 | #endif | ||
140 | (void)cpu; | ||
141 | return cnt; | 139 | return cnt; |
142 | } | 140 | } |
143 | 141 | ||