提交 12b5da34 编写于 作者: S Steven Rostedt 提交者: Steven Rostedt

tracing: Fix ent_size in trace output

When reading the trace file, the records of each of the per_cpu buffers
are examined to find the next event to print out. At the point of looking
at the event, the size of the event is recorded. But if the first event is
chosen, the other events in the other CPU buffers will reset the event size
that is stored in the iterator descriptor, causing the event size passed to
the output functions to be incorrect.

In most cases this is not a problem, but for the case of stack traces, it
is. With the change to the stack tracing to record a dynamic number of
back traces, the output depends on the size of the entry instead of the
fixed 8 back traces. When the entry size is not correct, the back traces
would not be fully printed.

Note, reading from the per-cpu trace files were not affected.
Reported-by: NThomas Gleixner <tglx@linutronix.de>
Tested-by: NThomas Gleixner <tglx@linutronix.de>
Cc: stable@vger.kernel.org
Signed-off-by: NSteven Rostedt <rostedt@goodmis.org>
上级 2c86bf17
...@@ -1698,6 +1698,7 @@ __find_next_entry(struct trace_iterator *iter, int *ent_cpu, ...@@ -1698,6 +1698,7 @@ __find_next_entry(struct trace_iterator *iter, int *ent_cpu,
int cpu_file = iter->cpu_file; int cpu_file = iter->cpu_file;
u64 next_ts = 0, ts; u64 next_ts = 0, ts;
int next_cpu = -1; int next_cpu = -1;
int next_size = 0;
int cpu; int cpu;
/* /*
...@@ -1729,9 +1730,12 @@ __find_next_entry(struct trace_iterator *iter, int *ent_cpu, ...@@ -1729,9 +1730,12 @@ __find_next_entry(struct trace_iterator *iter, int *ent_cpu,
next_cpu = cpu; next_cpu = cpu;
next_ts = ts; next_ts = ts;
next_lost = lost_events; next_lost = lost_events;
next_size = iter->ent_size;
} }
} }
iter->ent_size = next_size;
if (ent_cpu) if (ent_cpu)
*ent_cpu = next_cpu; *ent_cpu = next_cpu;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册