linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] powerpc/xmon: Dump ftrace buffers for the current CPU
@ 2017-07-31 17:22 Breno Leitao
  2017-07-31 17:22 ` [PATCH 2/3] powerpc/xmon: Disable and enable tracing command Breno Leitao
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Breno Leitao @ 2017-07-31 17:22 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Breno Leitao

Current xmon 'dt' command dumps the tracing buffer for all the CPUs,
which makes it possibly hard to read the logs due to the fact that most
of powerpc machines currently have many CPUs. Other than that, the CPU
lines are interleaved in the ftrace log.

This new option just dumps the ftrace buffer for the current CPU.

Signed-off-by: Breno Leitao <leitao@debian.org>
---
 arch/powerpc/xmon/xmon.c | 22 +++++++++++++++++++---
 1 file changed, 19 insertions(+), 3 deletions(-)

diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c
index 08e367e3e8c3..0cbd910193fa 100644
--- a/arch/powerpc/xmon/xmon.c
+++ b/arch/powerpc/xmon/xmon.c
@@ -234,6 +234,7 @@ Commands:\n\
   "\
   dr	dump stream of raw bytes\n\
   dt	dump the tracing buffers (uses printk)\n\
+  dtc	dump the tracing buffers for current CPU (uses printk)\n\
 "
 #ifdef CONFIG_PPC_POWERNV
 "  dx#   dump xive on CPU #\n\
@@ -2342,6 +2343,19 @@ static void dump_one_paca(int cpu)
 	sync();
 }
 
+static void dump_tracing(void)
+{
+	int c;
+
+	c = inchar();
+	if (c == 'c')
+		ftrace_dump(DUMP_ORIG);
+	else
+		ftrace_dump(DUMP_ALL);
+
+	tracing_on();
+}
+
 static void dump_all_pacas(void)
 {
 	int cpu;
@@ -2507,6 +2521,11 @@ dump(void)
 	}
 #endif
 
+	if (c == 't') {
+		dump_tracing();
+		return;
+	}
+
 	if (c == '\n')
 		termch = c;
 
@@ -2525,9 +2544,6 @@ dump(void)
 		dump_log_buf();
 	} else if (c == 'o') {
 		dump_opal_msglog();
-	} else if (c == 't') {
-		ftrace_dump(DUMP_ALL);
-		tracing_on();
 	} else if (c == 'r') {
 		scanhex(&ndump);
 		if (ndump == 0)
-- 
2.13.2

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2017-08-02 15:44 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-31 17:22 [PATCH 1/3] powerpc/xmon: Dump ftrace buffers for the current CPU Breno Leitao
2017-07-31 17:22 ` [PATCH 2/3] powerpc/xmon: Disable and enable tracing command Breno Leitao
2017-08-01  6:40   ` Naveen N. Rao
2017-08-01 14:21     ` Breno Leitao
2017-08-02 13:21       ` Naveen N. Rao
2017-08-02 14:45         ` Breno Leitao
2017-07-31 17:22 ` [PATCH 3/3] powerpc/xmon: Disable tracing on xmon by default Breno Leitao
2017-08-02 15:43 ` [PATCH 1/3] powerpc/xmon: Dump ftrace buffers for the current CPU kbuild test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).