Skip to content

Commit 56144ec

Browse files
committed
powerpc/xmon: Add 'dt' command to dump trace buffers
There is a nice interface for asking ftrace to dump all its tracing buffers. The only down side for use in xmon is that it uses printk. Depending on circumstances printk may not work when in xmon, but it also may, so add a 'dt' command which dumps the ftrace buffers, and add a note to the help to mentiont that it uses printk. Calling this routine also disables tracing, which is problematic if you return from xmon and expect the system to keep operating normally. So after we do the dump turn tracing back on. Both functions already have nop versions defined for when ftrace is not enabled, so we don't need any extra #ifdefs. Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
1 parent ebb242d commit 56144ec

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

arch/powerpc/xmon/xmon.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
* as published by the Free Software Foundation; either version
1111
* 2 of the License, or (at your option) any later version.
1212
*/
13+
14+
#include <linux/kernel.h>
1315
#include <linux/errno.h>
1416
#include <linux/sched.h>
1517
#include <linux/smp.h>
@@ -225,6 +227,7 @@ Commands:\n\
225227
#endif
226228
"\
227229
dr dump stream of raw bytes\n\
230+
dt dump the tracing buffers (uses printk)\n\
228231
e print exception information\n\
229232
f flush cache\n\
230233
la lookup symbol+offset of specified address\n\
@@ -2364,6 +2367,9 @@ dump(void)
23642367
dump_log_buf();
23652368
} else if (c == 'o') {
23662369
dump_opal_msglog();
2370+
} else if (c == 't') {
2371+
ftrace_dump(DUMP_ALL);
2372+
tracing_on();
23672373
} else if (c == 'r') {
23682374
scanhex(&ndump);
23692375
if (ndump == 0)

0 commit comments

Comments
 (0)