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>
This commit is contained in:

committed by
Steven Rostedt

parent
f633903af2
commit
e77405ad80
@@ -307,11 +307,12 @@ static void __trace_mmiotrace_rw(struct trace_array *tr,
|
||||
struct trace_array_cpu *data,
|
||||
struct mmiotrace_rw *rw)
|
||||
{
|
||||
struct ring_buffer *buffer = tr->buffer;
|
||||
struct ring_buffer_event *event;
|
||||
struct trace_mmiotrace_rw *entry;
|
||||
int pc = preempt_count();
|
||||
|
||||
event = trace_buffer_lock_reserve(tr, TRACE_MMIO_RW,
|
||||
event = trace_buffer_lock_reserve(buffer, TRACE_MMIO_RW,
|
||||
sizeof(*entry), 0, pc);
|
||||
if (!event) {
|
||||
atomic_inc(&dropped_count);
|
||||
@@ -319,7 +320,7 @@ static void __trace_mmiotrace_rw(struct trace_array *tr,
|
||||
}
|
||||
entry = ring_buffer_event_data(event);
|
||||
entry->rw = *rw;
|
||||
trace_buffer_unlock_commit(tr, event, 0, pc);
|
||||
trace_buffer_unlock_commit(buffer, event, 0, pc);
|
||||
}
|
||||
|
||||
void mmio_trace_rw(struct mmiotrace_rw *rw)
|
||||
@@ -333,11 +334,12 @@ static void __trace_mmiotrace_map(struct trace_array *tr,
|
||||
struct trace_array_cpu *data,
|
||||
struct mmiotrace_map *map)
|
||||
{
|
||||
struct ring_buffer *buffer = tr->buffer;
|
||||
struct ring_buffer_event *event;
|
||||
struct trace_mmiotrace_map *entry;
|
||||
int pc = preempt_count();
|
||||
|
||||
event = trace_buffer_lock_reserve(tr, TRACE_MMIO_MAP,
|
||||
event = trace_buffer_lock_reserve(buffer, TRACE_MMIO_MAP,
|
||||
sizeof(*entry), 0, pc);
|
||||
if (!event) {
|
||||
atomic_inc(&dropped_count);
|
||||
@@ -345,7 +347,7 @@ static void __trace_mmiotrace_map(struct trace_array *tr,
|
||||
}
|
||||
entry = ring_buffer_event_data(event);
|
||||
entry->map = *map;
|
||||
trace_buffer_unlock_commit(tr, event, 0, pc);
|
||||
trace_buffer_unlock_commit(buffer, event, 0, pc);
|
||||
}
|
||||
|
||||
void mmio_trace_mapping(struct mmiotrace_map *map)
|
||||
|
Reference in New Issue
Block a user