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.h | |
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.h')
-rw-r--r-- | kernel/trace/trace.h | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h index ca070de36227..4d30414fe19a 100644 --- a/kernel/trace/trace.h +++ b/kernel/trace/trace.h | |||
@@ -415,12 +415,13 @@ void init_tracer_sysprof_debugfs(struct dentry *d_tracer); | |||
415 | 415 | ||
416 | struct ring_buffer_event; | 416 | struct ring_buffer_event; |
417 | 417 | ||
418 | struct ring_buffer_event *trace_buffer_lock_reserve(struct trace_array *tr, | 418 | struct ring_buffer_event * |
419 | int type, | 419 | trace_buffer_lock_reserve(struct ring_buffer *buffer, |
420 | unsigned long len, | 420 | int type, |
421 | unsigned long flags, | 421 | unsigned long len, |
422 | int pc); | 422 | unsigned long flags, |
423 | void trace_buffer_unlock_commit(struct trace_array *tr, | 423 | int pc); |
424 | void trace_buffer_unlock_commit(struct ring_buffer *buffer, | ||
424 | struct ring_buffer_event *event, | 425 | struct ring_buffer_event *event, |
425 | unsigned long flags, int pc); | 426 | unsigned long flags, int pc); |
426 | 427 | ||
@@ -481,10 +482,10 @@ void update_max_tr_single(struct trace_array *tr, | |||
481 | #endif /* CONFIG_TRACER_MAX_TRACE */ | 482 | #endif /* CONFIG_TRACER_MAX_TRACE */ |
482 | 483 | ||
483 | #ifdef CONFIG_STACKTRACE | 484 | #ifdef CONFIG_STACKTRACE |
484 | void ftrace_trace_stack(struct trace_array *tr, unsigned long flags, | 485 | void ftrace_trace_stack(struct ring_buffer *buffer, unsigned long flags, |
485 | int skip, int pc); | 486 | int skip, int pc); |
486 | 487 | ||
487 | void ftrace_trace_userstack(struct trace_array *tr, unsigned long flags, | 488 | void ftrace_trace_userstack(struct ring_buffer *buffer, unsigned long flags, |
488 | int pc); | 489 | int pc); |
489 | 490 | ||
490 | void __trace_stack(struct trace_array *tr, unsigned long flags, int skip, | 491 | void __trace_stack(struct trace_array *tr, unsigned long flags, int skip, |