Skip to content

Commit 48c2461

Browse files
agnersgregkh
authored andcommitted
ARM: 8800/1: use choice for kernel unwinders
commit f9b58e8c7d031b0daa5c9a9ee27f5a4028ba53ac upstream. While in theory multiple unwinders could be compiled in, it does not make sense in practise. Use a choice to make the unwinder selection mutually exclusive and mandatory. Already before this commit it has not been possible to deselect FRAME_POINTER. Remove the obsolete comment. Furthermore, to produce a meaningful backtrace with FRAME_POINTER enabled the kernel needs a specific function prologue: mov ip, sp stmfd sp!, {fp, ip, lr, pc} sub fp, ip, OnePlusOSS#4 To get to the required prologue gcc uses apcs and no-sched-prolog. This compiler options are not available on clang, and clang is not able to generate the required prologue. Make the FRAME_POINTER config symbol depending on !clang. Suggested-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Stefan Agner <stefan@agner.ch> Reviewed-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk> Signed-off-by: Anders Roxell <anders.roxell@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent c76bce9 commit 48c2461

2 files changed

Lines changed: 31 additions & 19 deletions

File tree

arch/arm/Kconfig.debug

Lines changed: 28 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -16,30 +16,42 @@ config ARM_PTDUMP
1616
kernel.
1717
If in doubt, say "N"
1818

19-
# RMK wants arm kernels compiled with frame pointers or stack unwinding.
20-
# If you know what you are doing and are willing to live without stack
21-
# traces, you can get a slightly smaller kernel by setting this option to
22-
# n, but then RMK will have to kill you ;).
23-
config FRAME_POINTER
24-
bool
25-
depends on !THUMB2_KERNEL
26-
default y if !ARM_UNWIND || FUNCTION_GRAPH_TRACER
19+
choice
20+
prompt "Choose kernel unwinder"
21+
default UNWINDER_ARM if AEABI && !FUNCTION_GRAPH_TRACER
22+
default UNWINDER_FRAME_POINTER if !AEABI || FUNCTION_GRAPH_TRACER
23+
help
24+
This determines which method will be used for unwinding kernel stack
25+
traces for panics, oopses, bugs, warnings, perf, /proc/<pid>/stack,
26+
livepatch, lockdep, and more.
27+
28+
config UNWINDER_FRAME_POINTER
29+
bool "Frame pointer unwinder"
30+
depends on !THUMB2_KERNEL && !CC_IS_CLANG
31+
select ARCH_WANT_FRAME_POINTERS
32+
select FRAME_POINTER
2733
help
28-
If you say N here, the resulting kernel will be slightly smaller and
29-
faster. However, if neither FRAME_POINTER nor ARM_UNWIND are enabled,
30-
when a problem occurs with the kernel, the information that is
31-
reported is severely limited.
34+
This option enables the frame pointer unwinder for unwinding
35+
kernel stack traces.
3236

33-
config ARM_UNWIND
34-
bool "Enable stack unwinding support (EXPERIMENTAL)"
37+
config UNWINDER_ARM
38+
bool "ARM EABI stack unwinder"
3539
depends on AEABI
36-
default y
40+
select ARM_UNWIND
3741
help
3842
This option enables stack unwinding support in the kernel
3943
using the information automatically generated by the
4044
compiler. The resulting kernel image is slightly bigger but
4145
the performance is not affected. Currently, this feature
42-
only works with EABI compilers. If unsure say Y.
46+
only works with EABI compilers.
47+
48+
endchoice
49+
50+
config ARM_UNWIND
51+
bool
52+
53+
config FRAME_POINTER
54+
bool
4355

4456
config OLD_MCOUNT
4557
bool

lib/Kconfig.debug

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1131,7 +1131,7 @@ config LOCKDEP
11311131
bool
11321132
depends on DEBUG_KERNEL && TRACE_IRQFLAGS_SUPPORT && STACKTRACE_SUPPORT && LOCKDEP_SUPPORT
11331133
select STACKTRACE
1134-
select FRAME_POINTER if !MIPS && !PPC && !ARM_UNWIND && !S390 && !MICROBLAZE && !ARC && !SCORE && !X86
1134+
select FRAME_POINTER if !MIPS && !PPC && !ARM && !S390 && !MICROBLAZE && !ARC && !SCORE && !X86
11351135
select KALLSYMS
11361136
select KALLSYMS_ALL
11371137

@@ -1566,7 +1566,7 @@ config FAULT_INJECTION_STACKTRACE_FILTER
15661566
depends on FAULT_INJECTION_DEBUG_FS && STACKTRACE_SUPPORT
15671567
depends on !X86_64
15681568
select STACKTRACE
1569-
select FRAME_POINTER if !MIPS && !PPC && !S390 && !MICROBLAZE && !ARM_UNWIND && !ARC && !SCORE && !X86
1569+
select FRAME_POINTER if !MIPS && !PPC && !S390 && !MICROBLAZE && !ARM && !ARC && !SCORE && !X86
15701570
help
15711571
Provide stacktrace filter for fault-injection capabilities
15721572

@@ -1575,7 +1575,7 @@ config LATENCYTOP
15751575
depends on DEBUG_KERNEL
15761576
depends on STACKTRACE_SUPPORT
15771577
depends on PROC_FS
1578-
select FRAME_POINTER if !MIPS && !PPC && !S390 && !MICROBLAZE && !ARM_UNWIND && !ARC && !X86
1578+
select FRAME_POINTER if !MIPS && !PPC && !S390 && !MICROBLAZE && !ARM && !ARC && !X86
15791579
select KALLSYMS
15801580
select KALLSYMS_ALL
15811581
select STACKTRACE

0 commit comments

Comments
 (0)