Commit 690a973f authored by Jan Beulich's avatar Jan Beulich Committed by Andi Kleen

[PATCH] x86-64: Speed up dwarf2 unwinder

This changes the dwarf2 unwinder to do a binary search for CIEs
instead of a linear work. The linker is unfortunately not
able to build a proper lookup table at link time, instead it creates
one at runtime as soon as the bootmem allocator is usable (so you'll continue
using the linear lookup for the first [hopefully] few calls).
The code should be ready to utilize a build-time created table once
a fixed linker becomes available.
Signed-off-by: default avatarJan Beulich <jbeulich@novell.com>
Signed-off-by: default avatarAndi Kleen <ak@suse.de>
parent cdfce1f5
...@@ -499,6 +499,7 @@ endif ...@@ -499,6 +499,7 @@ endif
ifdef CONFIG_UNWIND_INFO ifdef CONFIG_UNWIND_INFO
CFLAGS += -fasynchronous-unwind-tables CFLAGS += -fasynchronous-unwind-tables
LDFLAGS_vmlinux += --eh-frame-hdr
endif endif
ifdef CONFIG_DEBUG_INFO ifdef CONFIG_DEBUG_INFO
......
...@@ -125,6 +125,10 @@ ...@@ -125,6 +125,10 @@
*(__param) \ *(__param) \
VMLINUX_SYMBOL(__stop___param) = .; \ VMLINUX_SYMBOL(__stop___param) = .; \
} \ } \
\
/* Unwind data binary search table */ \
EH_FRAME_HDR \
\
__end_rodata = .; \ __end_rodata = .; \
. = ALIGN(4096); . = ALIGN(4096);
...@@ -157,6 +161,18 @@ ...@@ -157,6 +161,18 @@
*(.kprobes.text) \ *(.kprobes.text) \
VMLINUX_SYMBOL(__kprobes_text_end) = .; VMLINUX_SYMBOL(__kprobes_text_end) = .;
#ifdef CONFIG_STACK_UNWIND
/* Unwind data binary search table */
#define EH_FRAME_HDR \
.eh_frame_hdr : AT(ADDR(.eh_frame_hdr) - LOAD_OFFSET) { \
VMLINUX_SYMBOL(__start_unwind_hdr) = .; \
*(.eh_frame_hdr) \
VMLINUX_SYMBOL(__end_unwind_hdr) = .; \
}
#else
#define EH_FRAME_HDR
#endif
/* DWARF debug sections. /* DWARF debug sections.
Symbols in the DWARF debugging sections are relative to Symbols in the DWARF debugging sections are relative to
the beginning of the section so we begin them at 0. */ the beginning of the section so we begin them at 0. */
......
...@@ -26,6 +26,7 @@ struct module; ...@@ -26,6 +26,7 @@ struct module;
* Initialize unwind support. * Initialize unwind support.
*/ */
extern void unwind_init(void); extern void unwind_init(void);
extern void unwind_setup(void);
#ifdef CONFIG_MODULES #ifdef CONFIG_MODULES
...@@ -73,6 +74,7 @@ extern int unwind_to_user(struct unwind_frame_info *); ...@@ -73,6 +74,7 @@ extern int unwind_to_user(struct unwind_frame_info *);
struct unwind_frame_info {}; struct unwind_frame_info {};
static inline void unwind_init(void) {} static inline void unwind_init(void) {}
static inline void unwind_setup(void) {}
#ifdef CONFIG_MODULES #ifdef CONFIG_MODULES
......
...@@ -503,6 +503,7 @@ asmlinkage void __init start_kernel(void) ...@@ -503,6 +503,7 @@ asmlinkage void __init start_kernel(void)
printk(KERN_NOTICE); printk(KERN_NOTICE);
printk(linux_banner); printk(linux_banner);
setup_arch(&command_line); setup_arch(&command_line);
unwind_setup();
setup_per_cpu_areas(); setup_per_cpu_areas();
smp_prepare_boot_cpu(); /* arch-specific boot-cpu hooks */ smp_prepare_boot_cpu(); /* arch-specific boot-cpu hooks */
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment