The DWARF unwinder is in place and ready. So introduce the config option
to allow users to enable it. It is by default off due to missing
assembly annotations.

And we now allow turning off FRAME_POINTERS if DWARF unwinder is
selected.

Signed-off-by: Jiri Slaby <jsl...@suse.cz>
Cc: Thomas Gleixner <t...@linutronix.de>
Cc: Ingo Molnar <mi...@redhat.com>
Cc: "H. Peter Anvin" <h...@zytor.com>
Cc: x...@kernel.org
---
 arch/x86/Kconfig  |  2 +-
 lib/Kconfig.debug | 17 +++++++++++++++--
 2 files changed, 16 insertions(+), 3 deletions(-)

diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index cd18994a9555..b37fa89c5f19 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -689,7 +689,7 @@ config X86_32_IRIS
 config SCHED_OMIT_FRAME_POINTER
        def_bool y
        prompt "Single-depth WCHAN output"
-       depends on X86
+       depends on X86 && !DWARF_UNWIND
        ---help---
          Calculate simpler /proc/<PID>/wchan values. If this option
          is disabled then wchan values will recurse back to the
diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug
index e90125b6498e..03297955ece0 100644
--- a/lib/Kconfig.debug
+++ b/lib/Kconfig.debug
@@ -55,6 +55,17 @@ config UNWIND_INFO
          If you don't debug the kernel, you can say N, but we may not be able
          to solve problems without frame unwind information or frame pointers.
 
+config DWARF_UNWIND
+       bool "DWARF stack unwind support"
+       depends on UNWIND_INFO && !KASAN
+       depends on X86
+       help
+         This enables more precise stack traces, omitting all unrelated
+         occurrences of pointers into kernel code from the dump.
+
+         KASAN is too slow with this unwinder, so it is excluded from
+         using in parallel.
+
 config BOOT_PRINTK_DELAY
        bool "Delay each boot printk message by N milliseconds"
        depends on DEBUG_KERNEL && PRINTK && GENERIC_CALIBRATE_DELAY
@@ -1690,7 +1701,8 @@ config FAULT_INJECTION_STACKTRACE_FILTER
        depends on FAULT_INJECTION_DEBUG_FS && STACKTRACE_SUPPORT
        depends on !X86_64
        select STACKTRACE
-       select FRAME_POINTER if !MIPS && !PPC && !S390 && !MICROBLAZE && 
!ARM_UNWIND && !ARC && !SCORE
+       select FRAME_POINTER if !MIPS && !PPC && !S390 && !MICROBLAZE && !X86 
&& !ARM_UNWIND && !ARC && !SCORE
+       select UNWIND_INFO if X86 && !FRAME_POINTER
        help
          Provide stacktrace filter for fault-injection capabilities
 
@@ -1699,7 +1711,8 @@ config LATENCYTOP
        depends on DEBUG_KERNEL
        depends on STACKTRACE_SUPPORT
        depends on PROC_FS
-       select FRAME_POINTER if !MIPS && !PPC && !S390 && !MICROBLAZE && 
!ARM_UNWIND && !ARC
+       select FRAME_POINTER if !MIPS && !PPC && !S390 && !MICROBLAZE && !X86 
&& !ARM_UNWIND && !ARC
+       select UNWIND_INFO if X86 && !FRAME_POINTER
        select KALLSYMS
        select KALLSYMS_ALL
        select STACKTRACE
-- 
2.12.2

Reply via email to