diff options
| author | Josh Poimboeuf <jpoimboe@redhat.com> | 2017-07-24 19:36:57 -0400 |
|---|---|---|
| committer | Ingo Molnar <mingo@kernel.org> | 2017-07-26 07:18:20 -0400 |
| commit | ee9f8fce99640811b2b8e79d0d1dbe8bab69ba67 (patch) | |
| tree | be03fe86edb9ebd70b4d29ca2bc8a4d972ff6644 /scripts | |
| parent | 1ee6f00d1164955b7bdadd36fc0f2736754784d9 (diff) | |
x86/unwind: Add the ORC unwinder
Add the new ORC unwinder which is enabled by CONFIG_ORC_UNWINDER=y.
It plugs into the existing x86 unwinder framework.
It relies on objtool to generate the needed .orc_unwind and
.orc_unwind_ip sections.
For more details on why ORC is used instead of DWARF, see
Documentation/x86/orc-unwinder.txt - but the short version is
that it's a simplified, fundamentally more robust debugninfo
data structure, which also allows up to two orders of magnitude
faster lookups than the DWARF unwinder - which matters to
profiling workloads like perf.
Thanks to Andy Lutomirski for the performance improvement ideas:
splitting the ORC unwind table into two parallel arrays and creating a
fast lookup table to search a subset of the unwind table.
Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: Denys Vlasenko <dvlasenk@redhat.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Jiri Slaby <jslaby@suse.cz>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: live-patching@vger.kernel.org
Link: http://lkml.kernel.org/r/0a6cbfb40f8da99b7a45a1a8302dc6aef16ec812.1500938583.git.jpoimboe@redhat.com
[ Extended the changelog. ]
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'scripts')
| -rw-r--r-- | scripts/Makefile.build | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/scripts/Makefile.build b/scripts/Makefile.build index 854608d42e85..80ed14809a05 100644 --- a/scripts/Makefile.build +++ b/scripts/Makefile.build | |||
| @@ -258,7 +258,8 @@ ifneq ($(SKIP_STACK_VALIDATION),1) | |||
| 258 | 258 | ||
| 259 | __objtool_obj := $(objtree)/tools/objtool/objtool | 259 | __objtool_obj := $(objtree)/tools/objtool/objtool |
| 260 | 260 | ||
| 261 | objtool_args = check | 261 | objtool_args = $(if $(CONFIG_ORC_UNWINDER),orc generate,check) |
| 262 | |||
| 262 | ifndef CONFIG_FRAME_POINTER | 263 | ifndef CONFIG_FRAME_POINTER |
| 263 | objtool_args += --no-fp | 264 | objtool_args += --no-fp |
| 264 | endif | 265 | endif |
| @@ -279,6 +280,11 @@ objtool_obj = $(if $(patsubst y%,, \ | |||
| 279 | endif # SKIP_STACK_VALIDATION | 280 | endif # SKIP_STACK_VALIDATION |
| 280 | endif # CONFIG_STACK_VALIDATION | 281 | endif # CONFIG_STACK_VALIDATION |
| 281 | 282 | ||
| 283 | # Rebuild all objects when objtool changes, or is enabled/disabled. | ||
| 284 | objtool_dep = $(objtool_obj) \ | ||
| 285 | $(wildcard include/config/orc/unwinder.h \ | ||
| 286 | include/config/stack/validation.h) | ||
| 287 | |||
| 282 | define rule_cc_o_c | 288 | define rule_cc_o_c |
| 283 | $(call echo-cmd,checksrc) $(cmd_checksrc) \ | 289 | $(call echo-cmd,checksrc) $(cmd_checksrc) \ |
| 284 | $(call cmd_and_fixdep,cc_o_c) \ | 290 | $(call cmd_and_fixdep,cc_o_c) \ |
| @@ -301,13 +307,13 @@ cmd_undef_syms = echo | |||
| 301 | endif | 307 | endif |
| 302 | 308 | ||
| 303 | # Built-in and composite module parts | 309 | # Built-in and composite module parts |
| 304 | $(obj)/%.o: $(src)/%.c $(recordmcount_source) $(objtool_obj) FORCE | 310 | $(obj)/%.o: $(src)/%.c $(recordmcount_source) $(objtool_dep) FORCE |
| 305 | $(call cmd,force_checksrc) | 311 | $(call cmd,force_checksrc) |
| 306 | $(call if_changed_rule,cc_o_c) | 312 | $(call if_changed_rule,cc_o_c) |
| 307 | 313 | ||
| 308 | # Single-part modules are special since we need to mark them in $(MODVERDIR) | 314 | # Single-part modules are special since we need to mark them in $(MODVERDIR) |
| 309 | 315 | ||
| 310 | $(single-used-m): $(obj)/%.o: $(src)/%.c $(recordmcount_source) $(objtool_obj) FORCE | 316 | $(single-used-m): $(obj)/%.o: $(src)/%.c $(recordmcount_source) $(objtool_dep) FORCE |
| 311 | $(call cmd,force_checksrc) | 317 | $(call cmd,force_checksrc) |
| 312 | $(call if_changed_rule,cc_o_c) | 318 | $(call if_changed_rule,cc_o_c) |
| 313 | @{ echo $(@:.o=.ko); echo $@; \ | 319 | @{ echo $(@:.o=.ko); echo $@; \ |
| @@ -402,7 +408,7 @@ cmd_modversions_S = \ | |||
| 402 | endif | 408 | endif |
| 403 | endif | 409 | endif |
| 404 | 410 | ||
| 405 | $(obj)/%.o: $(src)/%.S $(objtool_obj) FORCE | 411 | $(obj)/%.o: $(src)/%.S $(objtool_dep) FORCE |
| 406 | $(call if_changed_rule,as_o_S) | 412 | $(call if_changed_rule,as_o_S) |
| 407 | 413 | ||
| 408 | targets += $(real-objs-y) $(real-objs-m) $(lib-y) | 414 | targets += $(real-objs-y) $(real-objs-m) $(lib-y) |
