All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] powerpc/xmon: Exclude all of xmon/ from ftrace
@ 2017-08-02 18:25 Naveen N. Rao
  2017-08-08 10:46 ` Michael Ellerman
  2017-08-16 12:29 ` Michael Ellerman
  0 siblings, 2 replies; 6+ messages in thread
From: Naveen N. Rao @ 2017-08-02 18:25 UTC (permalink / raw)
  To: Michael Ellerman; +Cc: linuxppc-dev, Breno Leitao

Exclude core xmon files from ftrace (along with an xmon xive helper
outside of xmon/) to minimize impact of ftrace while within xmon.

Before patch:
  root@ubuntu:/sys/kernel/debug/tracing# cat available_filter_functions | grep -i xmon
  xmon_xive_do_dump
  xmon_dbgfs_get
  xmon_print_symbol
  xmon_show_stack
  xmon_dbgfs_ops_open
  xmon_init.part.2
  xmon_dbgfs_set
  sysrq_handle_xmon
  xmon_fault_handler
  cpus_are_in_xmon
  xmon_core
  xmon
  xmon_irq
  xmon_break_match
  xmon_iabr_match
  xmon_sstep
  xmon_bpt
  xmon_ipi
  xmon_write
  xmon_start_pagination
  xmon_end_pagination
  xmon_set_pagination_lpp
  xmon_putchar
  xmon_gets
  xmon_printf
  xmon_puts
  root@ubuntu:/sys/kernel/debug/tracing#

After patch:
  root@ubuntu:/sys/kernel/debug/tracing# cat available_filter_functions | grep -i xmon
  root@ubuntu:/sys/kernel/debug/tracing#

Signed-off-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
---
This is in addition to Breno's series to disable tracing while in xmon.
While this patch prevents xmon core functions from being traced,
Breno's series prevents other helpers used by xmon from logging entries
into the trace buffer.

- Naveen

 arch/powerpc/sysdev/xive/common.c |  6 +++---
 arch/powerpc/xmon/Makefile        | 13 +++++++++++++
 2 files changed, 16 insertions(+), 3 deletions(-)

diff --git a/arch/powerpc/sysdev/xive/common.c b/arch/powerpc/sysdev/xive/common.c
index 6595462b1fc8..97e82a33b7be 100644
--- a/arch/powerpc/sysdev/xive/common.c
+++ b/arch/powerpc/sysdev/xive/common.c
@@ -190,7 +190,7 @@ static u32 xive_scan_interrupts(struct xive_cpu *xc, bool just_peek)
  * This is used to perform the magic loads from an ESB
  * described in xive.h
  */
-static u8 xive_poke_esb(struct xive_irq_data *xd, u32 offset)
+static notrace u8 xive_poke_esb(struct xive_irq_data *xd, u32 offset)
 {
 	u64 val;
 
@@ -204,7 +204,7 @@ static u8 xive_poke_esb(struct xive_irq_data *xd, u32 offset)
 }
 
 #ifdef CONFIG_XMON
-static void xive_dump_eq(const char *name, struct xive_q *q)
+static notrace void xive_dump_eq(const char *name, struct xive_q *q)
 {
 	u32 i0, i1, idx;
 
@@ -218,7 +218,7 @@ static void xive_dump_eq(const char *name, struct xive_q *q)
 		    q->toggle, i0, i1);
 }
 
-void xmon_xive_do_dump(int cpu)
+notrace void xmon_xive_do_dump(int cpu)
 {
 	struct xive_cpu *xc = per_cpu(xive_cpu, cpu);
 
diff --git a/arch/powerpc/xmon/Makefile b/arch/powerpc/xmon/Makefile
index 0b2f771593eb..5f95af64cb8f 100644
--- a/arch/powerpc/xmon/Makefile
+++ b/arch/powerpc/xmon/Makefile
@@ -7,6 +7,19 @@ UBSAN_SANITIZE := n
 
 ccflags-$(CONFIG_PPC64) := $(NO_MINIMAL_TOC)
 
+ifdef CONFIG_FUNCTION_TRACER
+CFLAGS_REMOVE_xmon.o	= -mno-sched-epilog $(CC_FLAGS_FTRACE)
+CFLAGS_REMOVE_nonstdio.o = -mno-sched-epilog $(CC_FLAGS_FTRACE)
+ifdef CONFIG_XMON_DISASSEMBLY
+CFLAGS_REMOVE_ppc-dis.o	= -mno-sched-epilog $(CC_FLAGS_FTRACE)
+CFLAGS_REMOVE_ppc-opc.o	= -mno-sched-epilog $(CC_FLAGS_FTRACE)
+ifdef CONFIG_SPU_BASE
+CFLAGS_REMOVE_spu-dis.o	= -mno-sched-epilog $(CC_FLAGS_FTRACE)
+CFLAGS_REMOVE_spu-opc.o	= -mno-sched-epilog $(CC_FLAGS_FTRACE)
+endif
+endif
+endif
+
 obj-y			+= xmon.o nonstdio.o spr_access.o
 
 ifdef CONFIG_XMON_DISASSEMBLY
-- 
2.13.3

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

end of thread, other threads:[~2017-08-17 12:54 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-02 18:25 [PATCH] powerpc/xmon: Exclude all of xmon/ from ftrace Naveen N. Rao
2017-08-08 10:46 ` Michael Ellerman
2017-08-15 10:04   ` Michael Ellerman
2017-08-16 14:13     ` Naveen N. Rao
2017-08-17 12:54       ` Michael Ellerman
2017-08-16 12:29 ` Michael Ellerman

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.