Skip to content

Commit

Permalink
tracing: add cpu_file intialization for ftrace_dump
Browse files Browse the repository at this point in the history
Impact: fix to ftrace_dump output corruption

The commit: b04cc6b
  tracing/core: introduce per cpu tracing files

added a new field to the iterator called cpu_file. This was a handle
to differentiate between the per cpu trace output files and the
all cpu "trace" file. The all cpu "trace" file required setting this
to TRACE_PIPE_ALL_CPU.

The problem is that the ftrace_dump sets up its own iterator but was
not updated to handle this change. The result was only CPU 0 printing
out on crash and a lot of "<0>"'s also being printed.

Reported-by: Thomas Gleixner <tglx@linuxtronix.de>
Tested-by: Darren Hart <dvhtc@us.ibm.com>
Signed-off-by: Steven Rostedt <srostedt@redhat.com>
  • Loading branch information
Steven Rostedt committed Mar 4, 2009
1 parent efed792 commit e543ad7
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions kernel/trace/trace.c
Original file line number Diff line number Diff line change
Expand Up @@ -3918,8 +3918,10 @@ void ftrace_dump(void)

printk(KERN_TRACE "Dumping ftrace buffer:\n");

/* Simulate the iterator */
iter.tr = &global_trace;
iter.trace = current_trace;
iter.cpu_file = TRACE_PIPE_ALL_CPU;

/*
* We need to stop all tracing on all CPUS to read the
Expand Down

0 comments on commit e543ad7

Please sign in to comment.