diff options
author | Steven Rostedt <srostedt@redhat.com> | 2009-09-02 14:17:06 -0400 |
---|---|---|
committer | Steven Rostedt <rostedt@goodmis.org> | 2009-09-04 18:59:39 -0400 |
commit | e77405ad80f53966524b5c31244e13fbbbecbd84 (patch) | |
tree | 65c05f9e1573e9958e52bb72655e00c8592aacd2 /kernel/trace/trace_events.c | |
parent | f633903af2ceb0cec07d45e499a072b6593d0ed1 (diff) |
tracing: pass around ring buffer instead of tracer
The latency tracers (irqsoff and wakeup) can swap trace buffers
on the fly. If an event is happening and has reserved data on one of
the buffers, and the latency tracer swaps the global buffer with the
max buffer, the result is that the event may commit the data to the
wrong buffer.
This patch changes the API to the trace recording to be recieve the
buffer that was used to reserve a commit. Then this buffer can be passed
in to the commit.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'kernel/trace/trace_events.c')
-rw-r--r-- | kernel/trace/trace_events.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c index d33bcdeffe69..78b1ed230177 100644 --- a/kernel/trace/trace_events.c +++ b/kernel/trace/trace_events.c | |||
@@ -1438,6 +1438,7 @@ static void | |||
1438 | function_test_events_call(unsigned long ip, unsigned long parent_ip) | 1438 | function_test_events_call(unsigned long ip, unsigned long parent_ip) |
1439 | { | 1439 | { |
1440 | struct ring_buffer_event *event; | 1440 | struct ring_buffer_event *event; |
1441 | struct ring_buffer *buffer; | ||
1441 | struct ftrace_entry *entry; | 1442 | struct ftrace_entry *entry; |
1442 | unsigned long flags; | 1443 | unsigned long flags; |
1443 | long disabled; | 1444 | long disabled; |
@@ -1455,7 +1456,8 @@ function_test_events_call(unsigned long ip, unsigned long parent_ip) | |||
1455 | 1456 | ||
1456 | local_save_flags(flags); | 1457 | local_save_flags(flags); |
1457 | 1458 | ||
1458 | event = trace_current_buffer_lock_reserve(TRACE_FN, sizeof(*entry), | 1459 | event = trace_current_buffer_lock_reserve(&buffer, |
1460 | TRACE_FN, sizeof(*entry), | ||
1459 | flags, pc); | 1461 | flags, pc); |
1460 | if (!event) | 1462 | if (!event) |
1461 | goto out; | 1463 | goto out; |
@@ -1463,7 +1465,7 @@ function_test_events_call(unsigned long ip, unsigned long parent_ip) | |||
1463 | entry->ip = ip; | 1465 | entry->ip = ip; |
1464 | entry->parent_ip = parent_ip; | 1466 | entry->parent_ip = parent_ip; |
1465 | 1467 | ||
1466 | trace_nowake_buffer_unlock_commit(event, flags, pc); | 1468 | trace_nowake_buffer_unlock_commit(buffer, event, flags, pc); |
1467 | 1469 | ||
1468 | out: | 1470 | out: |
1469 | atomic_dec(&per_cpu(test_event_disable, cpu)); | 1471 | atomic_dec(&per_cpu(test_event_disable, cpu)); |