Skip to content

Commit 5d2685d

Browse files
committed
sh: Conditionalize the code dumper on CONFIG_DUMP_CODE.
We don't really want this enabled by default, but it is still quite useful for debugging. So, make it conditional and leave it off by default. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
1 parent fe58cac commit 5d2685d

File tree

3 files changed

+22
-1
lines changed

3 files changed

+22
-1
lines changed

arch/sh/Kconfig.debug

+12
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,18 @@ config IRQSTACKS
9898
for handling hard and soft interrupts. This can help avoid
9999
overflowing the process kernel stacks.
100100

101+
config DUMP_CODE
102+
bool "Show disassembly of nearby code in register dumps"
103+
depends on DEBUG_KERNEL && SUPERH32
104+
default y if DEBUG_BUGVERBOSE
105+
default n
106+
help
107+
This prints out a code trace of the instructions leading up to
108+
the faulting instruction as a debugging aid. As this does grow
109+
the kernel in size a bit, most users will want to say N here.
110+
111+
Those looking for more verbose debugging output should say Y.
112+
101113
config SH_NO_BSS_INIT
102114
bool "Avoid zeroing BSS (to speed-up startup on suitable platforms)"
103115
depends on DEBUG_KERNEL

arch/sh/include/asm/processor_32.h

+8
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,15 @@ static __inline__ void enable_fpu(void)
175175

176176
void show_trace(struct task_struct *tsk, unsigned long *sp,
177177
struct pt_regs *regs);
178+
179+
#ifdef CONFIG_DUMP_CODE
178180
void show_code(struct pt_regs *regs);
181+
#else
182+
static inline void show_code(struct pt_regs *regs)
183+
{
184+
}
185+
#endif
186+
179187
extern unsigned long get_wchan(struct task_struct *p);
180188

181189
#define KSTK_EIP(tsk) (task_pt_regs(tsk)->pc)

arch/sh/kernel/Makefile_32

+2-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ ifdef CONFIG_FUNCTION_TRACER
99
CFLAGS_REMOVE_ftrace.o = -pg
1010
endif
1111

12-
obj-y := debugtraps.o disassemble.o idle.o io.o io_generic.o irq.o \
12+
obj-y := debugtraps.o idle.o io.o io_generic.o irq.o \
1313
machvec.o process_32.o ptrace_32.o setup.o signal_32.o \
1414
sys_sh.o sys_sh32.o syscalls_32.o time_32.o topology.o \
1515
traps.o traps_32.o
@@ -29,5 +29,6 @@ obj-$(CONFIG_IO_TRAPPED) += io_trapped.o
2929
obj-$(CONFIG_KPROBES) += kprobes.o
3030
obj-$(CONFIG_GENERIC_GPIO) += gpio.o
3131
obj-$(CONFIG_DYNAMIC_FTRACE) += ftrace.o
32+
obj-$(CONFIG_DUMP_CODE) += disassemble.o
3233

3334
EXTRA_CFLAGS += -Werror

0 commit comments

Comments
 (0)