aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/trace/trace.c
diff options
context:
space:
mode:
authorSteven Rostedt <srostedt@redhat.com>2012-03-27 10:43:28 -0400
committerSteven Rostedt <rostedt@goodmis.org>2012-03-27 12:05:44 -0400
commit12b5da349a8b94c9dbc3430a6bc42eabd9eaf50b (patch)
treea785d2b0757cacc15cd02e9eb6da3210c79a8aea /kernel/trace/trace.c
parent2c86bf172e550b4bf089ac7f0de3f6370e243842 (diff)
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: Thomas Gleixner <tglx@linutronix.de> Tested-by: Thomas Gleixner <tglx@linutronix.de> Cc: stable@vger.kernel.org Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'kernel/trace/trace.c')
-rw-r--r--kernel/trace/trace.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index 3a19c354edd6..ed7b5d1e12f4 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -1698,6 +1698,7 @@ __find_next_entry(struct trace_iterator *iter, int *ent_cpu,
1698 int cpu_file = iter->cpu_file; 1698 int cpu_file = iter->cpu_file;
1699 u64 next_ts = 0, ts; 1699 u64 next_ts = 0, ts;
1700 int next_cpu = -1; 1700 int next_cpu = -1;
1701 int next_size = 0;
1701 int cpu; 1702 int cpu;
1702 1703
1703 /* 1704 /*
@@ -1729,9 +1730,12 @@ __find_next_entry(struct trace_iterator *iter, int *ent_cpu,
1729 next_cpu = cpu; 1730 next_cpu = cpu;
1730 next_ts = ts; 1731 next_ts = ts;
1731 next_lost = lost_events; 1732 next_lost = lost_events;
1733 next_size = iter->ent_size;
1732 } 1734 }
1733 } 1735 }
1734 1736
1737 iter->ent_size = next_size;
1738
1735 if (ent_cpu) 1739 if (ent_cpu)
1736 *ent_cpu = next_cpu; 1740 *ent_cpu = next_cpu;
1737 1741