History

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.

Josh Poimboeuf committed 9 years ago

Commit ee9f8fc1 parent 1ee6f0018 files · +977 −64Browse files

Showing the changes to scripts (1 of 18 files). Show all

Unified · Split

scripts/Makefile.build+10−4
@@ -258,7 +258,8 @@ ifneq ($(SKIP_STACK_VALIDATION),1) · 257 unmodified lines
258258
259259 __objtool_obj := $(objtree)/tools/objtool/objtool
260260
261−objtool_args = check
261+objtool_args = $(if $(CONFIG_ORC_UNWINDER),orc generate,check)
262+
262263 ifndef CONFIG_FRAME_POINTER
263264 objtool_args += --no-fp
264265 endif
@@ -279,6 +280,11 @@ objtool_obj = $(if $(patsubst y%,, \ · 14 unmodified lines
279280 endif # SKIP_STACK_VALIDATION
280281 endif # CONFIG_STACK_VALIDATION
281282
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+
282288 define rule_cc_o_c
283289 $(call echo-cmd,checksrc) $(cmd_checksrc) \
284290 $(call cmd_and_fixdep,cc_o_c) \
@@ -301,13 +307,13 @@ cmd_undef_syms = echo · 16 unmodified lines
301307 endif
302308
303309 # 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
305311 $(call cmd,force_checksrc)
306312 $(call if_changed_rule,cc_o_c)
307313
308314 # Single-part modules are special since we need to mark them in $(MODVERDIR)
309315
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
311317 $(call cmd,force_checksrc)
312318 $(call if_changed_rule,cc_o_c)
313319 @{ echo $(@:.o=.ko); echo $@; \
@@ -402,7 +408,7 @@ cmd_modversions_S = \ · 88 unmodified lines
402408 endif
403409 endif
404410
405−$(obj)/%.o: $(src)/%.S $(objtool_obj) FORCE
411+$(obj)/%.o: $(src)/%.S $(objtool_dep) FORCE
406412 $(call if_changed_rule,as_o_S)
407413
408414 targets += $(real-objs-y) $(real-objs-m) $(lib-y)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t