Skip to content

Commit 85356f8

Browse files
Steven Rostedtrostedt
authored andcommitted
kbuild/recordmcount: Add RECORDMCOUNT_WARN to warn about mcount callers
When mcount is called in a section that ftrace will not modify it into a nop, we want to warn about this. But not warn about this always. Now if the user builds the kernel with the option RECORDMCOUNT_WARN=1 then the build will warn about mcount callers that are ignored and will just waste execution time. Acked-by: Michal Marek <mmarek@suse.cz> Cc: linux-kbuild@vger.kernel.org Link: http://lkml.kernel.org/r/20110421023738.714956282@goodmis.org Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
1 parent dfad3d5 commit 85356f8

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

‎Makefile‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1268,6 +1268,7 @@ help:
12681268
@echo ' make C=1 [targets] Check all c source with $$CHECK (sparse by default)'
12691269
@echo ' make C=2 [targets] Force check of all c source with $$CHECK'
12701270
@echo ' make W=1 [targets] Enable extra gcc checks'
1271+
@echo ' make RECORDMCOUNT_WARN=1 [targets] Warn about ignored mcount sections'
12711272
@echo ''
12721273
@echo 'Execute "make" or "make all" to build all targets marked with [*] '
12731274
@echo 'For further info see the ./README file'

‎scripts/Makefile.build‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,13 +244,16 @@ endif
244244

245245
ifdef CONFIG_FTRACE_MCOUNT_RECORD
246246
ifdef BUILD_C_RECORDMCOUNT
247+
ifeq ("$(origin RECORDMCOUNT_WARN)", "command line")
248+
RECORDMCOUNT_FLAGS = -w
249+
endif
247250
# Due to recursion, we must skip empty.o.
248251
# The empty.o file is created in the make process in order to determine
249252
# the target endianness and word size. It is made before all other C
250253
# files, including recordmcount.
251254
sub_cmd_record_mcount = \
252255
if [ $(@) != "scripts/mod/empty.o" ]; then \
253-
$(objtree)/scripts/recordmcount "$(@)"; \
256+
$(objtree)/scripts/recordmcount $(RECORDMCOUNT_FLAGS) "$(@)"; \
254257
fi;
255258
else
256259
sub_cmd_record_mcount = set -e ; perl $(srctree)/scripts/recordmcount.pl "$(ARCH)" \

0 commit comments

Comments
 (0)