Skip to contentSkip to conversation

kgdb: Do not allow function tracing of kgdb code

PATCH In review Steven Rostedt 2 participants 2 messages Apr 25, 2012

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 kgdb: Do not allow function tracing of kgdb code

As function tracing the kgdb code can cause issues, as kgdb is a debugger itself, do not trace the kgdb functions.

---
v2 - added all files in kernel/debug

arch/x86/kernel/Makefile +1 -0
index 532d2e0..b7828ce 100644
@@ -15,6 +15,7 @@ CFLAGS_REMOVE_pvclock.o = -pg
 CFLAGS_REMOVE_kvmclock.o = -pg
 CFLAGS_REMOVE_ftrace.o = -pg
 CFLAGS_REMOVE_early_printk.o = -pg
+CFLAGS_REMOVE_kgdb.o = -pg
 endif
 
 obj-y			:= process_$(BITS).o signal.o entry_$(BITS).o
kernel/debug/Makefile +6 -0
index a85edc3..5fa453c 100644
@@ -2,5 +2,11 @@
 # Makefile for the linux kernel debugger
 #
 
+# Do not function trace debug files
+ifdef CONFIG_FUNCTION_TRACER
+ORIG_CFLAGS := $(KBUILD_CFLAGS)
+KBUILD_CFLAGS = $(subst -pg,,$(ORIG_CFLAGS))
+endif
+
 obj-$(CONFIG_KGDB) += debug_core.o gdbstub.o
 obj-$(CONFIG_KGDB_KDB) += kdb/
maintainer Acked-by on v2 1/1
#1 lore raw
Quoted 4 lines · Steven Rostedt

As function tracing the kgdb code can cause issues, as kgdb is a debugger itself, do not trace the kgdb functions.

You beat me to creating the patch, because I was in the process of testing the same modification before posting. :-)

Thanks,
Jason.