diff options
author | Steven Rostedt <srostedt@redhat.com> | 2010-10-13 17:12:30 -0400 |
---|---|---|
committer | Steven Rostedt <rostedt@goodmis.org> | 2010-10-14 16:52:41 -0400 |
commit | 72441cb1fd77d092f09ddfac748955703884c9a7 (patch) | |
tree | 3b02aecebf718f1cb6e9752b809e825b237527da | |
parent | 81d3858d3131a589cade0d8b57f95cc1fc699b89 (diff) |
ftrace/x86: Add support for C version of recordmcount
This patch adds the support for the C version of recordmcount and
compile times show ~ 12% improvement.
After verifying this works, other archs can add:
HAVE_C_MCOUNT_RECORD
in its Kconfig and it will use the C version of recordmcount
instead of the perl version.
Cc: <linux-arch@vger.kernel.org>
Cc: Michal Marek <mmarek@suse.cz>
Cc: linux-kbuild@vger.kernel.org
Cc: John Reiser <jreiser@bitwagon.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
-rw-r--r-- | Makefile | 6 | ||||
-rw-r--r-- | arch/x86/Kconfig | 1 | ||||
-rw-r--r-- | kernel/trace/Kconfig | 5 | ||||
-rw-r--r-- | scripts/Makefile | 1 | ||||
-rw-r--r-- | scripts/Makefile.build | 4 |
5 files changed, 17 insertions, 0 deletions
@@ -568,6 +568,12 @@ endif | |||
568 | 568 | ||
569 | ifdef CONFIG_FUNCTION_TRACER | 569 | ifdef CONFIG_FUNCTION_TRACER |
570 | KBUILD_CFLAGS += -pg | 570 | KBUILD_CFLAGS += -pg |
571 | ifdef CONFIG_DYNAMIC_FTRACE | ||
572 | ifdef CONFIG_HAVE_C_MCOUNT_RECORD | ||
573 | BUILD_C_RECORDMCOUNT := y | ||
574 | export BUILD_C_RECORDMCOUNT | ||
575 | endif | ||
576 | endif | ||
571 | endif | 577 | endif |
572 | 578 | ||
573 | # We trigger additional mismatches with less inlining | 579 | # We trigger additional mismatches with less inlining |
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index c14d8b4d2f71..788b50ef5fc4 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig | |||
@@ -33,6 +33,7 @@ config X86 | |||
33 | select HAVE_KRETPROBES | 33 | select HAVE_KRETPROBES |
34 | select HAVE_OPTPROBES | 34 | select HAVE_OPTPROBES |
35 | select HAVE_FTRACE_MCOUNT_RECORD | 35 | select HAVE_FTRACE_MCOUNT_RECORD |
36 | select HAVE_C_MCOUNT_RECORD | ||
36 | select HAVE_DYNAMIC_FTRACE | 37 | select HAVE_DYNAMIC_FTRACE |
37 | select HAVE_FUNCTION_TRACER | 38 | select HAVE_FUNCTION_TRACER |
38 | select HAVE_FUNCTION_GRAPH_TRACER | 39 | select HAVE_FUNCTION_GRAPH_TRACER |
diff --git a/kernel/trace/Kconfig b/kernel/trace/Kconfig index 538501c6ea50..df00fbbaf609 100644 --- a/kernel/trace/Kconfig +++ b/kernel/trace/Kconfig | |||
@@ -49,6 +49,11 @@ config HAVE_SYSCALL_TRACEPOINTS | |||
49 | help | 49 | help |
50 | See Documentation/trace/ftrace-design.txt | 50 | See Documentation/trace/ftrace-design.txt |
51 | 51 | ||
52 | config HAVE_C_MCOUNT_RECORD | ||
53 | bool | ||
54 | help | ||
55 | C version of recordmcount available? | ||
56 | |||
52 | config TRACER_MAX_TRACE | 57 | config TRACER_MAX_TRACE |
53 | bool | 58 | bool |
54 | 59 | ||
diff --git a/scripts/Makefile b/scripts/Makefile index 842dbc2d5aed..2e088109fbd5 100644 --- a/scripts/Makefile +++ b/scripts/Makefile | |||
@@ -11,6 +11,7 @@ hostprogs-$(CONFIG_KALLSYMS) += kallsyms | |||
11 | hostprogs-$(CONFIG_LOGO) += pnmtologo | 11 | hostprogs-$(CONFIG_LOGO) += pnmtologo |
12 | hostprogs-$(CONFIG_VT) += conmakehash | 12 | hostprogs-$(CONFIG_VT) += conmakehash |
13 | hostprogs-$(CONFIG_IKCONFIG) += bin2c | 13 | hostprogs-$(CONFIG_IKCONFIG) += bin2c |
14 | hostprogs-$(BUILD_C_RECORDMCOUNT) += recordmcount | ||
14 | 15 | ||
15 | always := $(hostprogs-y) $(hostprogs-m) | 16 | always := $(hostprogs-y) $(hostprogs-m) |
16 | 17 | ||
diff --git a/scripts/Makefile.build b/scripts/Makefile.build index a1a5cf95a68d..4d03a7efc689 100644 --- a/scripts/Makefile.build +++ b/scripts/Makefile.build | |||
@@ -209,12 +209,16 @@ cmd_modversions = \ | |||
209 | endif | 209 | endif |
210 | 210 | ||
211 | ifdef CONFIG_FTRACE_MCOUNT_RECORD | 211 | ifdef CONFIG_FTRACE_MCOUNT_RECORD |
212 | ifdef BUILD_C_RECORDMCOUNT | ||
213 | cmd_record_mcount = $(srctree)/scripts/recordmcount "$(@)"; | ||
214 | else | ||
212 | cmd_record_mcount = set -e ; perl $(srctree)/scripts/recordmcount.pl "$(ARCH)" \ | 215 | cmd_record_mcount = set -e ; perl $(srctree)/scripts/recordmcount.pl "$(ARCH)" \ |
213 | "$(if $(CONFIG_CPU_BIG_ENDIAN),big,little)" \ | 216 | "$(if $(CONFIG_CPU_BIG_ENDIAN),big,little)" \ |
214 | "$(if $(CONFIG_64BIT),64,32)" \ | 217 | "$(if $(CONFIG_64BIT),64,32)" \ |
215 | "$(OBJDUMP)" "$(OBJCOPY)" "$(CC)" "$(LD)" "$(NM)" "$(RM)" "$(MV)" \ | 218 | "$(OBJDUMP)" "$(OBJCOPY)" "$(CC)" "$(LD)" "$(NM)" "$(RM)" "$(MV)" \ |
216 | "$(if $(part-of-module),1,0)" "$(@)"; | 219 | "$(if $(part-of-module),1,0)" "$(@)"; |
217 | endif | 220 | endif |
221 | endif | ||
218 | 222 | ||
219 | define rule_cc_o_c | 223 | define rule_cc_o_c |
220 | $(call echo-cmd,checksrc) $(cmd_checksrc) \ | 224 | $(call echo-cmd,checksrc) $(cmd_checksrc) \ |