Re: [PATCH] ftrace: Speed up recordmcount

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Steven Rostedt
Date: Wednesday, October 27, 2010 - 6:21 am

[ 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


--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] ftrace: Speed up recordmcount, Wu Zhangjin, (Wed Oct 27, 3:39 am)
Re: [PATCH] ftrace: Speed up recordmcount, Steven Rostedt, (Wed Oct 27, 6:21 am)
Re: [PATCH] ftrace: Speed up recordmcount, wu zhangjin, (Wed Oct 27, 7:39 am)