File tree Expand file tree Collapse file tree 3 files changed +23
-0
lines changed Expand file tree Collapse file tree 3 files changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -860,6 +860,9 @@ ifdef CONFIG_FTRACE_MCOUNT_USE_CC
860
860
endif
861
861
endif
862
862
endif
863
+ ifdef CONFIG_FTRACE_MCOUNT_USE_OBJTOOL
864
+ CC_FLAGS_USING += -DCC_USING_NOP_MCOUNT
865
+ endif
863
866
ifdef CONFIG_FTRACE_MCOUNT_USE_RECORDMCOUNT
864
867
ifdef CONFIG_HAVE_C_RECORDMCOUNT
865
868
BUILD_C_RECORDMCOUNT := y
@@ -1236,6 +1239,10 @@ uapi-asm-generic:
1236
1239
PHONY += prepare-objtool prepare-resolve_btfids
1237
1240
prepare-objtool : $(objtool_target )
1238
1241
ifeq ($(SKIP_STACK_VALIDATION ) ,1)
1242
+ ifdef CONFIG_FTRACE_MCOUNT_USE_OBJTOOL
1243
+ @echo "error: Cannot generate __mcount_loc for CONFIG_DYNAMIC_FTRACE=y, please install libelf-dev, libelf-devel or elfutils-libelf-devel" >&2
1244
+ @false
1245
+ endif
1239
1246
ifdef CONFIG_UNWINDER_ORC
1240
1247
@echo "error: Cannot generate ORC metadata for CONFIG_UNWINDER_ORC=y, please install libelf-dev, libelf-devel or elfutils-libelf-devel" >&2
1241
1248
@false
Original file line number Diff line number Diff line change @@ -60,6 +60,11 @@ config HAVE_NOP_MCOUNT
60
60
help
61
61
Arch supports the gcc options -pg with -mrecord-mcount and -nop-mcount
62
62
63
+ config HAVE_OBJTOOL_MCOUNT
64
+ bool
65
+ help
66
+ Arch supports objtool --mcount
67
+
63
68
config HAVE_C_RECORDMCOUNT
64
69
bool
65
70
help
@@ -612,10 +617,18 @@ config FTRACE_MCOUNT_USE_CC
612
617
depends on !FTRACE_MCOUNT_USE_PATCHABLE_FUNCTION_ENTRY
613
618
depends on FTRACE_MCOUNT_RECORD
614
619
620
+ config FTRACE_MCOUNT_USE_OBJTOOL
621
+ def_bool y
622
+ depends on HAVE_OBJTOOL_MCOUNT
623
+ depends on !FTRACE_MCOUNT_USE_PATCHABLE_FUNCTION_ENTRY
624
+ depends on !FTRACE_MCOUNT_USE_CC
625
+ depends on FTRACE_MCOUNT_RECORD
626
+
615
627
config FTRACE_MCOUNT_USE_RECORDMCOUNT
616
628
def_bool y
617
629
depends on !FTRACE_MCOUNT_USE_PATCHABLE_FUNCTION_ENTRY
618
630
depends on !FTRACE_MCOUNT_USE_CC
631
+ depends on !FTRACE_MCOUNT_USE_OBJTOOL
619
632
depends on FTRACE_MCOUNT_RECORD
620
633
621
634
config TRACING_MAP
Original file line number Diff line number Diff line change @@ -238,6 +238,9 @@ endif
238
238
ifdef CONFIG_X86_SMAP
239
239
objtool_args += --uaccess
240
240
endif
241
+ ifdef CONFIG_FTRACE_MCOUNT_USE_OBJTOOL
242
+ objtool_args += --mcount
243
+ endif
241
244
242
245
# 'OBJECT_FILES_NON_STANDARD := y': skip objtool checking for a directory
243
246
# 'OBJECT_FILES_NON_STANDARD_foo.o := 'y': skip objtool checking for a file
You can’t perform that action at this time.
0 commit comments