[ Added kbuild maintainers ]
On Wed, 2010-10-27 at 18:39 +0800, Wu Zhangjin wrote:
Thanks! I was going to do this myself, but just have not gotten around
to it.
I need a SoB from Michal to apply it.
FTRACE_MCOUNT_RECORD depends on DYNAMIC_FTRACE, so if you require
FTRACE_MCOUNT_RECORD, you can remove the ifdef CONFIG_DYNAMIC_FTRACE.
Note, this does not catch objects that have the -pg stripped by
CFLAGS_REMOVE_object.o
How about something like this:
ifdef DEFINE_CMD_RECORD_MCOUNT
ifdef BUILD_C_RECORDMCOUNT
sub_cmd_record_mcount = if [ $(@) != "scripts/mod/empty.o" ]; then \
$(objtree)/scripts/recordmcount "$(@)"; \
fi;
else
sub_cmd_record_mcount = set -e ; perl $(srctree)/scripts/recordmcount.pl "$(ARCH)" \
"$(if $(CONFIG_CPU_BIG_ENDIAN),big,little)" \
"$(if $(CONFIG_64BIT),64,32)" \
"$(OBJDUMP)" "$(OBJCOPY)" "$(CC) $(KBUILD_CFLAGS)" \
"$(LD)" "$(NM)" "$(RM)" "$(MV)" \
"$(if $(part-of-module),1,0)" "$(@)";
endif
cmd_record_mcount = \
if [ "$(findstring -pg, $(_c_flags))" == "-pg" ]; then \
$(sub_cmd_record_mcount) \
fi;
endif
I tested the above and it seemed to work (although, I did it on another
machine, and copied it here by hand, so this version may have a typo).
-- Steve
--