Skip to content

Commit 0fdf136

Browse files
author
Ingo Molnar
committed
Merge branch 'tip/perf/recordmcount-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-2.6-trace into perf/core
2 parents d9d572a + cf4db25 commit 0fdf136

File tree

7 files changed

+728
-0
lines changed

7 files changed

+728
-0
lines changed

Makefile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -568,6 +568,12 @@ endif
568568

569569
ifdef CONFIG_FUNCTION_TRACER
570570
KBUILD_CFLAGS += -pg
571+
ifdef CONFIG_DYNAMIC_FTRACE
572+
ifdef CONFIG_HAVE_C_RECORDMCOUNT
573+
BUILD_C_RECORDMCOUNT := y
574+
export BUILD_C_RECORDMCOUNT
575+
endif
576+
endif
571577
endif
572578

573579
# We trigger additional mismatches with less inlining

arch/x86/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ config X86
3333
select HAVE_KRETPROBES
3434
select HAVE_OPTPROBES
3535
select HAVE_FTRACE_MCOUNT_RECORD
36+
select HAVE_C_RECORDMCOUNT
3637
select HAVE_DYNAMIC_FTRACE
3738
select HAVE_FUNCTION_TRACER
3839
select HAVE_FUNCTION_GRAPH_TRACER

kernel/trace/Kconfig

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,11 @@ config HAVE_SYSCALL_TRACEPOINTS
4949
help
5050
See Documentation/trace/ftrace-design.txt
5151

52+
config HAVE_C_RECORDMCOUNT
53+
bool
54+
help
55+
C version of recordmcount available?
56+
5257
config TRACER_MAX_TRACE
5358
bool
5459

scripts/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ hostprogs-$(CONFIG_KALLSYMS) += kallsyms
1111
hostprogs-$(CONFIG_LOGO) += pnmtologo
1212
hostprogs-$(CONFIG_VT) += conmakehash
1313
hostprogs-$(CONFIG_IKCONFIG) += bin2c
14+
hostprogs-$(BUILD_C_RECORDMCOUNT) += recordmcount
1415

1516
always := $(hostprogs-y) $(hostprogs-m)
1617

scripts/Makefile.build

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,12 +209,16 @@ cmd_modversions = \
209209
endif
210210

211211
ifdef CONFIG_FTRACE_MCOUNT_RECORD
212+
ifdef BUILD_C_RECORDMCOUNT
213+
cmd_record_mcount = $(srctree)/scripts/recordmcount "$(@)";
214+
else
212215
cmd_record_mcount = set -e ; perl $(srctree)/scripts/recordmcount.pl "$(ARCH)" \
213216
"$(if $(CONFIG_CPU_BIG_ENDIAN),big,little)" \
214217
"$(if $(CONFIG_64BIT),64,32)" \
215218
"$(OBJDUMP)" "$(OBJCOPY)" "$(CC)" "$(LD)" "$(NM)" "$(RM)" "$(MV)" \
216219
"$(if $(part-of-module),1,0)" "$(@)";
217220
endif
221+
endif
218222

219223
define rule_cc_o_c
220224
$(call echo-cmd,checksrc) $(cmd_checksrc) \

0 commit comments

Comments
 (0)