perf tools: New build framework
Subsystems (2)
Jiri Olsa
reviewercover perf tools: New build framework
hi,
I'm following up on latest post from Alexis:
http://marc.info/?l=linux-kernel&m=141427580405357&w=2
Since it's actually small portion of kbuild that perf needs, I realized it's actually better to steal it than 'reconfigure' kbuild to be usable for perf.
Also this patchset is kind of incremental version of the latest:
perf tools: Add kbuild support into Makefile.kbuild
so it should be easier to review.
NOTE I couldn't find any copyright/credit messages in the kbuild system, but would be happy to include it if someone suggests one.
The stolen parts are in files:
Makefile.kbuild
Build.include
The idea and more details are explained in the 'Documentation/Build' file. The basic idea is the same as in kbuild system, with some minor changes to allow for multiple binaries build definitions.
User provides 'Build' files with objects definitions like:
perf-y += perf.o
perf-y += builtin-bench.o
...
libperf-y += util/
...
and the build framework outputs files:
perf-in.o
libperf-in.o
which are then linked into appropriate binaries/libraries. (perf libperf.a libperf-gtk.so)
This patchset does not include the user configuration changes support (which is the ultimate goal), but last 2 patches shows how easy it's now to disable some parts of the perf code:
perf tools: Add support to configure builtin commands inclusion perf tools: Disable test code
Also now we have the full dependency check ((gcc -Wp,-MD,... stuff) and build command line is stored/checked automatically by the build system.
The patchset is also available in:
git://git.kernel.org/pub/scm/linux/kernel/git/jolsa/perf.git
perf/build
All tests/make tests pass. I tested only x86_64 arch.. any feedback from other archs would be great ;-)
thanks for comments,
jirka
---
Jiri Olsa (30):
perf tools: Add new build framework support
perf build: Add detected config framework support perf build: Add subdir framework support
perf build: Add bench objects building
perf build: Add tests objects building
perf build: Add builtin objects building
perf build: Add libperf objects building
perf build: Add probe objects building
perf build: Add dwarf objects building
perf build: Add dwarf unwind objects building
perf build: Add ui objects building
perf build: Add slang objects building
perf build: Add gtk objects building
perf build: Add scripts objects building
perf build: Add perf regs objects building
perf build: Add zlib objects building
perf build: Add perf.o object building
perf build: Add arch x86 objects building
perf build: Add arch arm objects building
perf build: Add arch arm64 objects building
perf build: Add arch powerpc objects building
perf build: Add arch s390 objects building
perf build: Add arch sh objects building
perf build: Add arch sparc objects building
perf build: Add single target build framework support perf make: Remove directory dependency rules
perf make: Remove uneeded variables
perf make: Remove PERF-CFLAGS file
perf tools: Add support to configure builtin commands inclusion perf tools: Disable test code
tools/perf/Build | 48 ++ tools/perf/Build.include | 75 ++++ tools/perf/Documentation/Build | 123 +++++ tools/perf/Makefile.build | 122 +++++ tools/perf/Makefile.perf | 566 +++--------------------- tools/perf/arch/Build | 2 + tools/perf/arch/arm/Build | 2 + tools/perf/arch/arm/Makefile | 11 - tools/perf/arch/arm/tests/Build | 2 + tools/perf/arch/arm/util/Build | 4 + tools/perf/arch/arm64/Build | 3 + tools/perf/arch/arm64/Makefile | 4 - tools/perf/arch/arm64/util/Build | 2 + tools/perf/arch/powerpc/Build | 1 + tools/perf/arch/powerpc/Makefile | 3 - tools/perf/arch/powerpc/util/Build | 4 + tools/perf/arch/s390/Build | 1 + tools/perf/arch/s390/Makefile | 3 - tools/perf/arch/s390/util/Build | 4 + tools/perf/arch/sh/Build | 1 + tools/perf/arch/sh/Makefile | 1 - tools/perf/arch/sh/util/Build | 1 + tools/perf/arch/sparc/Build | 1 + tools/perf/arch/sparc/Makefile | 1 - tools/perf/arch/sparc/util/Build | 1 + tools/perf/arch/x86/Build | 2 + tools/perf/arch/x86/Makefile | 15 - tools/perf/arch/x86/tests/Build | 2 + tools/perf/arch/x86/util/Build | 8 + tools/perf/bench/Build | 11 + tools/perf/builtin-cmds.h | 29 ++ tools/perf/builtin-help.c | 1 + tools/perf/config.default | 23 + tools/perf/config/Makefile | 43 ++ tools/perf/perf-sys.h | 2 +- tools/perf/perf.c | 5 + tools/perf/scripts/Build | 2 + tools/perf/scripts/perl/Perf-Trace-Util/Build | 3 + tools/perf/scripts/python/Perf-Trace-Util/Build | 3 + tools/perf/tests/Build | 43 ++ tools/perf/ui/Build | 14 + tools/perf/ui/browsers/Build | 10 + tools/perf/ui/gtk/Build | 9 + tools/perf/ui/tui/Build | 4 + tools/perf/util/Build | 137 ++++++ tools/perf/util/generate-cmdlist.sh | 10 + tools/perf/util/scripting-engines/Build | 6 + 47 files changed, 827 insertions(+), 541 deletions(-) create mode 100644 tools/perf/Build create mode 100644 tools/perf/Build.include create mode 100644 tools/perf/Documentation/Build create mode 100644 tools/perf/Makefile.build create mode 100644 tools/perf/arch/Build create mode 100644 tools/perf/arch/arm/Build create mode 100644 tools/perf/arch/arm/tests/Build create mode 100644 tools/perf/arch/arm/util/Build create mode 100644 tools/perf/arch/arm64/Build create mode 100644 tools/perf/arch/arm64/util/Build create mode 100644 tools/perf/arch/powerpc/Build create mode 100644 tools/perf/arch/powerpc/util/Build create mode 100644 tools/perf/arch/s390/Build create mode 100644 tools/perf/arch/s390/util/Build create mode 100644 tools/perf/arch/sh/Build create mode 100644 tools/perf/arch/sh/util/Build create mode 100644 tools/perf/arch/sparc/Build create mode 100644 tools/perf/arch/sparc/util/Build create mode 100644 tools/perf/arch/x86/Build create mode 100644 tools/perf/arch/x86/tests/Build create mode 100644 tools/perf/arch/x86/util/Build create mode 100644 tools/perf/bench/Build create mode 100644 tools/perf/builtin-cmds.h create mode 100644 tools/perf/config.default create mode 100644 tools/perf/scripts/Build create mode 100644 tools/perf/scripts/perl/Perf-Trace-Util/Build create mode 100644 tools/perf/scripts/python/Perf-Trace-Util/Build create mode 100644 tools/perf/tests/Build create mode 100644 tools/perf/ui/Build create mode 100644 tools/perf/ui/browsers/Build create mode 100644 tools/perf/ui/gtk/Build create mode 100644 tools/perf/ui/tui/Build create mode 100644 tools/perf/util/Build create mode 100644 tools/perf/util/scripting-engines/Build
Jiri Olsa
reviewerPATCH 1/30 perf tools: Add new build framework support
Adding new build framework. There's no change for actual building at this point, it comes in the next patches.
The idea and more details are explained in the
'Documentation/Build' file.
I stole everything from the kernel build system, with some changes to allow for multiple binaries build definitions.
While the kernel's build output is single image (forget modules) we need to be able to build several binaries/libraries.
The basic idea is that sser provides 'Build' files with objects definitions like:
perf-y += a.o
perf-y += b.o
libperf-y += c.o
libperf-y += d.o
and the build framework outputs files:
perf-in.o # a.o, b.o compiled in
libperf-in.o # c.o, d.o compiled in
--- tools/perf/Build | 0 tools/perf/Build.include | 73 ++++++++++++++++++++++++ tools/perf/Documentation/Build | 123 +++++++++++++++++++++++++++++++++++++++++ tools/perf/Makefile.build | 89 +++++++++++++++++++++++++++++ tools/perf/Makefile.perf | 14 ++++- 5 files changed, 298 insertions(+), 1 deletion(-) create mode 100644 tools/perf/Build create mode 100644 tools/perf/Build.include create mode 100644 tools/perf/Documentation/Build create mode 100644 tools/perf/Makefile.build
tools/perf/Build new file +0 -0
tools/perf/Build.include new file +73 -0
73 lines not on this page · raw message
tools/perf/Documentation/Build new file +123 -0
123 lines not on this page · raw message
tools/perf/Makefile.build new file +89 -0
89 lines not on this page · raw message
tools/perf/Makefile.perf +13 -1
@@ -89,6 +89,7 @@ $(OUTPUT)PERF-VERSION-FILE: ../../.git/HEAD @touch $(OUTPUT)PERF-VERSION-FILE CC = $(CROSS_COMPILE)gcc +LD = $(CROSS_COMPILE)ld AR = $(CROSS_COMPILE)ar PKG_CONFIG = $(CROSS_COMPILE)pkg-config
@@ -619,6 +620,14 @@ shell_compatibility_test: please_set_SHELL_PATH_to_a_more_modern_shell strip: $(PROGRAMS) $(OUTPUT)perf $(STRIP) $(STRIP_OPTS) $(PROGRAMS) $(OUTPUT)perf +PERF_IN := $(OUTPUT)perf-in.o + +export OUTPUT RM CC LD CFLAGS V +build := -f Makefile.build dir=. obj + +$(PERF_IN): FORCE + @$(MAKE) $(build)=perf + $(OUTPUT)perf.o: perf.c $(OUTPUT)common-cmds.h $(OUTPUT)PERF-CFLAGS $(QUIET_CC)$(CC) -include $(OUTPUT)PERF-VERSION-FILE \ '-DPERF_HTML_PATH="$(htmldir_SQ)"' \
@@ -978,6 +987,7 @@ config-clean: clean: $(LIBTRACEEVENT)-clean $(LIBAPIKFS)-clean config-clean $(call QUIET_CLEAN, core-objs) $(RM) $(LIB_OBJS) $(BUILTIN_OBJS) $(LIB_FILE) $(OUTPUT)perf-archive $(OUTPUT)perf-with-kcore $(OUTPUT)perf.o $(LANG_BINDINGS) $(GTK_OBJS) + @find $(if $(OUTPUT),$(OUTPUT),.) -name \*.o | xargs $(RM) $(call QUIET_CLEAN, core-progs) $(RM) $(ALL_PROGRAMS) perf perf-read-vdso32 perf-read-vdsox32 $(call QUIET_CLEAN, core-gen) $(RM) *.spec *.pyc *.pyo */*.pyc */*.pyo $(OUTPUT)common-cmds.h TAGS tags cscope* $(OUTPUT)PERF-VERSION-FILE $(OUTPUT)PERF-CFLAGS $(OUTPUT)PERF-FEATURES $(OUTPUT)util/*-bison* $(OUTPUT)util/*-flex* $(QUIET_SUBDIR0)Documentation $(QUIET_SUBDIR1) clean
@@ -993,7 +1003,9 @@ else GIT-HEAD-PHONY = endif +FORCE: + .PHONY: all install clean config-clean strip install-gtk .PHONY: shell_compatibility_test please_set_SHELL_PATH_to_a_more_modern_shell -.PHONY: $(GIT-HEAD-PHONY) TAGS tags cscope .FORCE-PERF-CFLAGS +.PHONY: $(GIT-HEAD-PHONY) TAGS tags cscope .FORCE-PERF-CFLAGS FORCE
Signature · 1 line
1.9.3
Re: [PATCH 01/30] perf tools: Add new build framework support
Quoted 18 lines · Jiri Olsa
tools/perf/Documentation/Build new file +18
-0+a) Build makefiles +------------------ +User supplies 'Build' makefiles that contains objects summary, +like for example following 'krava/Build' file: + + perf-y += a.o + perf-y += b.o + +The build framework is triggered by: + $ make -f Makefile.build dir=krava obj=perf + +which produces 'krava/perf-in.o' object file that has both +a.o and b.o objects compiled in linked together. + +The 'Build' makefile can contains multiple objects definitions +to allow building separated binaries, like: + + perf-y += a.o
tools/perf/Documentation/Build line 64
Quoted 10 lines
tools/perf/Documentation/Build new file +10
-0+ perf-y += b.o + + libperf-y += c.o + libperf-y += d.o + +If the build framework is triggered by: + $ make -f Makefile.build dir=krava obj=libperf + +it produces 'krava/libperf-in.o' object file that has both +a.o and b.o objects compiled in linked together.
Ok, question: you say those "Build" files are supplied by the user. Does that mean that everyone has to go and write their own or are we still using Kconfig and doing it in a more user-friendly manner?
I've probably missed this in the whole perf fastlane development... :)
Signature · 5 lines
Regards/Gruss,
Boris.
Sent from a fat crate under my desk. Formatting is fine.
--Re: [PATCH 01/30] perf tools: Add new build framework support
Quoted 25 lines · Borislav Petkov
Quoted 24 lines · Jiri Olsa
tools/perf/Documentation/Build new file +24
-0+a) Build makefiles +------------------ +User supplies 'Build' makefiles that contains objects summary, +like for example following 'krava/Build' file: + + perf-y += a.o + perf-y += b.o + +The build framework is triggered by: + $ make -f Makefile.build dir=krava obj=perf + +which produces 'krava/perf-in.o' object file that has both +a.o and b.o objects compiled in linked together. + +The 'Build' makefile can contains multiple objects definitions +to allow building separated binaries, like: + + perf-y += a.o + perf-y += b.o + + libperf-y += c.o + libperf-y += d.o + +If the build framework is triggered by:
Quoted 8 lines
tools/perf/Documentation/Build line 64
Quoted 4 lines
tools/perf/Documentation/Build new file +4
-0+ $ make -f Makefile.build dir=krava obj=libperf + +it produces 'krava/libperf-in.o' object file that has both +a.o and b.o objects compiled in linked together.Ok, question: you say those "Build" files are supplied by the user. Does that mean that everyone has to go and write their own or are we still using
Kconfigand doing it in a more user-friendly manner?
there's no Kconfig involved in perf build at this moment..
the 'Build' Makefiles are equivalents of Kbuild/Makefile makefiles within the kernel build system.. I just move the 'K' out
Quoted 2 lines
I've probably missed this in the whole perf fastlane development... :)
the reason for this switch is to have a first step towards easy config support 'kernel Kconfig style like' in build
also with this change it's easier to see how the perf binary is build and what flags were used for particular object.. at least for kernel developer used to kbuild ;-)
I also believe that the support to allow just part of the perf code in perf binary will force the less spaghetti code ;-)
jirka
Re: [PATCH 01/30] perf tools: Add new build framework support
Em Mon, Jan 05, 2015 at 12:13:35PM +0100, Jiri Olsa escreveu:
Quoted 46 lines · Borislav Petkov
Quoted 25 lines · Jiri Olsa
Quoted 24 lines
tools/perf/Documentation/Build new file +24
-0+a) Build makefiles +------------------ +User supplies 'Build' makefiles that contains objects summary, +like for example following 'krava/Build' file: + + perf-y += a.o + perf-y += b.o + +The build framework is triggered by: + $ make -f Makefile.build dir=krava obj=perf + +which produces 'krava/perf-in.o' object file that has both +a.o and b.o objects compiled in linked together. + +The 'Build' makefile can contains multiple objects definitions +to allow building separated binaries, like: + + perf-y += a.o + perf-y += b.o + + libperf-y += c.o + libperf-y += d.o + +If the build framework is triggered by:Quoted 8 lines
tools/perf/Documentation/Build line 64
Quoted 4 lines
tools/perf/Documentation/Build new file +4
-0+ $ make -f Makefile.build dir=krava obj=libperf + +it produces 'krava/libperf-in.o' object file that has both +a.o and b.o objects compiled in linked together.Ok, question: you say those "Build" files are supplied by the user. Does that mean that everyone has to go and write their own or are we still using
Kconfigand doing it in a more user-friendly manner?there's no
Kconfiginvolved in perf build at this moment..the 'Build' Makefiles are equivalents of Kbuild/Makefile makefiles within the kernel build system.. I just move the 'K' out
Quoted 2 lines
I've probably missed this in the whole perf fastlane development... :)
the reason for this switch is to have a first step towards easy config support 'kernel
Kconfigstyle like' in build
Quoted 6 lines
also with this change it's easier to see how the perf binary is build and what flags were used for particular object.. at least for kernel developer used to kbuild ;-)
I also believe that the support to allow just part of the perf code in perf binary will force the less spaghetti code ;-)
Right, making it possible for us to build a minimalistic perf will have manifold good implications :-)
But perhaps we could continue calling it the same way as in the kernel? I.e. we would then be using the "Kbuild" build configuration mechanism, the K would be there just for historic reasons.
- Arnaldo
Re: [PATCH 01/30] perf tools: Add new build framework support
On Tue, Jan 06, 2015 at 11:41:08AM -0200, Arnaldo Carvalho de Melo wrote:
SNIP
Quoted 10 lines
Quoted 9 lines
the reason for this switch is to have a first step towards easy config support 'kernel
Kconfigstyle like' in buildalso with this change it's easier to see how the perf binary is build and what flags were used for particular object.. at least for kernel developer used to kbuild ;-)
I also believe that the support to allow just part of the perf code in perf binary will force the less spaghetti code ;-)
Quoted 6 lines
Right, making it possible for us to build a minimalistic perf will have manifold good implications :-)
But perhaps we could continue calling it the same way as in the kernel? I.e. we would then be using the "
Kbuild" build configuration mechanism, the K would be there just for historic reasons.
well, the main reason I used 'Build' instead of 'KBuild' was to 'say' that this is not Kbuild makefile.. because it's not ;-)
It's separated build framework with no dependency on KBuild makefiles. I think the 'KBuild' name could mislead folks when hunting things in perf build.
jirka
Namhyung Kim
maintainerRe: [PATCH 01/30] perf tools: Add new build framework support
In reply to Jiri OlsaQuoted 5 lines · Jiri Olsa
Adding new build framework. There's no change for actual building at this point, it comes in the next patches.
The idea and more details are explained in the
'Documentation/Build' file.
[SNIP]
Quoted 6 lines
tools/perf/Documentation/Build new file +0
-0
tools/perf/Documentation/Build line 9
Quoted 9 lines
tools/perf/Documentation/Build new file +9
-0@@ -0,0 +1,123 @@ + +1) perf build +============= +The perf build process consists of several separated building blocks, +which are linked together to form the perf binary: + - libperf library (static) + - perf builtin commands + - traceevent library (static) + - GTK ui library
And libapikfs library (static) ?
Thanks,
Namhyung
Re: [PATCH 01/30] perf tools: Add new build framework support
Quoted 18 lines · Namhyung Kim
Quoted 5 lines · Jiri Olsa
Adding new build framework. There's no change for actual building at this point, it comes in the next patches.
The idea and more details are explained in the
'Documentation/Build' file.[SNIP]
Quoted 9 lines
tools/perf/Documentation/Build new file +3
-0@@ -0,0 +1,123 @@ + +1) perf build +=============
Quoted 8 lines
tools/perf/Documentation/Build line 9
Quoted 6 lines
tools/perf/Documentation/Build new file +6
-0+The perf build process consists of several separated building blocks, +which are linked together to form the perf binary: + - libperf library (static) + - perf builtin commands + - traceevent library (static) + - GTK ui libraryAnd libapikfs library (static) ?
yep, forgot to add that one.., thanks
jirka
Jiri Olsa
reviewerPATCH 2/30 perf build: Add detected config framework support
In reply to Jiri OlsaAdding support to include detected configuration makefile into the build process. This will allow the Build objects to be configurable based on the config data, like:
perf-$(CONFIG_KRAVA) += krava.o
The configuration is stored in '.config-detected' file, which is generated for each compilation.
--- tools/perf/Makefile.build | 3 +++ tools/perf/Makefile.perf | 1 + tools/perf/config/Makefile | 4 ++++ 3 files changed, 8 insertions(+)
tools/perf/Makefile.build +3 -0
@@ -15,6 +15,9 @@ endif # Generic definitions include Build.include +# do not force detected configuration +-include .config-detected + # Init all relevant variables used in build files so # 1) they have correct type # 2) they do not inherit any value from the environment
tools/perf/Makefile.perf +1 -0
@@ -988,6 +988,7 @@ config-clean: clean: $(LIBTRACEEVENT)-clean $(LIBAPIKFS)-clean config-clean $(call QUIET_CLEAN, core-objs) $(RM) $(LIB_OBJS) $(BUILTIN_OBJS) $(LIB_FILE) $(OUTPUT)perf-archive $(OUTPUT)perf-with-kcore $(OUTPUT)perf.o $(LANG_BINDINGS) $(GTK_OBJS) @find $(if $(OUTPUT),$(OUTPUT),.) -name \*.o | xargs $(RM) + @$(RM) .config-detected $(call QUIET_CLEAN, core-progs) $(RM) $(ALL_PROGRAMS) perf perf-read-vdso32 perf-read-vdsox32 $(call QUIET_CLEAN, core-gen) $(RM) *.spec *.pyc *.pyo */*.pyc */*.pyo $(OUTPUT)common-cmds.h TAGS tags cscope* $(OUTPUT)PERF-VERSION-FILE $(OUTPUT)PERF-CFLAGS $(OUTPUT)PERF-FEATURES $(OUTPUT)util/*-bison* $(OUTPUT)util/*-flex* $(QUIET_SUBDIR0)Documentation $(QUIET_SUBDIR1) clean
tools/perf/config/Makefile +4 -0
@@ -11,6 +11,10 @@ ifneq ($(obj-perf),) obj-perf := $(abspath $(obj-perf))/ endif +$(shell echo -n > .config-detected) +detected = $(shell echo "$(1)=y" >> .config-detected) +detected_var = $(shell echo "$(1)=$($(1))" >> .config-detected) + LIB_INCLUDE := $(srctree)/tools/lib/ CFLAGS := $(EXTRA_CFLAGS) $(EXTRA_WARNINGS)
Signature · 1 line
1.9.3
Jiri Olsa
reviewerPATCH 3/30 perf build: Add subdir framework support
In reply to Jiri OlsaAdd support to make directory any time we build objects out of the tree (O=/tmp/krava) and the output directory does not exist.
--- tools/perf/Makefile.build | 6 ++++++ 1 file changed, 6 insertions(+)
tools/perf/Makefile.build +6 -0
@@ -30,6 +30,10 @@ subdir-obj-y := build-file := $(dir)/Build include $(build-file) +# Create directory unless it exists +quiet_cmd_mkdir = MKDIR $(dir $@) + cmd_mkdir = $(if $(wildcard $(dir $@)),,@$(call echo-cmd,mkdir) mkdir -p $(dir $@)) + # Compile command quiet_cmd_cc_o_c = CC $@ cmd_cc_o_c = $(CC) $(c_flags) -c -o $@ $<
@@ -40,9 +44,11 @@ quiet_cmd_ld_multi = LD $@ # Build rules $(OUTPUT)%.o: %.c FORCE + $(call cmd_mkdir) $(call if_changed_dep,cc_o_c) $(OUTPUT)%.o: %.S FORCE + $(call cmd_mkdir) $(call if_changed_dep,cc_o_c) # Gather build data:
Signature · 1 line
1.9.3
Jiri Olsa
reviewerPATCH 4/30 perf build: Add bench objects building
In reply to Jiri OlsaMove bench objects building under build framework and enable perf-in.o rule.
--- tools/perf/Build | 2 ++ tools/perf/Makefile.perf | 21 ++------------------- tools/perf/bench/Build | 11 +++++++++++ tools/perf/config/Makefile | 2 ++ 4 files changed, 17 insertions(+), 19 deletions(-) create mode 100644 tools/perf/bench/Build
tools/perf/Build +2 -0
@@ -0,0 +1,2 @@ +perf-y += builtin-bench.o +perf-y += bench/
tools/perf/Makefile.perf +2 -19
@@ -459,19 +459,6 @@ LIB_OBJS += $(OUTPUT)tests/thread-mg-share.o LIB_OBJS += $(OUTPUT)tests/switch-tracking.o BUILTIN_OBJS += $(OUTPUT)builtin-annotate.o -BUILTIN_OBJS += $(OUTPUT)builtin-bench.o -# Benchmark modules -BUILTIN_OBJS += $(OUTPUT)bench/sched-messaging.o -BUILTIN_OBJS += $(OUTPUT)bench/sched-pipe.o -ifeq ($(RAW_ARCH),x86_64) -BUILTIN_OBJS += $(OUTPUT)bench/mem-memcpy-x86-64-asm.o -BUILTIN_OBJS += $(OUTPUT)bench/mem-memset-x86-64-asm.o -endif -BUILTIN_OBJS += $(OUTPUT)bench/mem-memcpy.o -BUILTIN_OBJS += $(OUTPUT)bench/futex-hash.o -BUILTIN_OBJS += $(OUTPUT)bench/futex-wake.o -BUILTIN_OBJS += $(OUTPUT)bench/futex-requeue.o - BUILTIN_OBJS += $(OUTPUT)builtin-diff.o BUILTIN_OBJS += $(OUTPUT)builtin-evlist.o BUILTIN_OBJS += $(OUTPUT)builtin-help.o
@@ -590,10 +577,6 @@ ifeq ($(NO_PERF_REGS),0) LIB_OBJS += $(OUTPUT)util/perf_regs.o endif -ifndef NO_LIBNUMA - BUILTIN_OBJS += $(OUTPUT)bench/numa.o -endif - ifndef NO_ZLIB LIB_OBJS += $(OUTPUT)util/zlib.o endif
@@ -633,9 +616,9 @@ $(OUTPUT)perf.o: perf.c $(OUTPUT)common-cmds.h $(OUTPUT)PERF-CFLAGS '-DPERF_HTML_PATH="$(htmldir_SQ)"' \ $(CFLAGS) -c $(filter %.c,$^) -o $@ -$(OUTPUT)perf: $(OUTPUT)perf.o $(BUILTIN_OBJS) $(PERFLIBS) +$(OUTPUT)perf: $(OUTPUT)perf.o $(BUILTIN_OBJS) $(PERFLIBS) $(PERF_IN) $(QUIET_LINK)$(CC) $(CFLAGS) $(LDFLAGS) $(OUTPUT)perf.o \ - $(BUILTIN_OBJS) $(LIBS) -o $@ + $(BUILTIN_OBJS) $(PERF_IN) $(LIBS) -o $@ $(GTK_OBJS): $(OUTPUT)%.o: %.c $(LIB_H) $(QUIET_CC)$(CC) -o $@ -c -fPIC $(CFLAGS) $(GTK_CFLAGS) $<
tools/perf/bench/Build new file +11 -0
@@ -0,0 +1,11 @@ +perf-y += sched-messaging.o +perf-y += sched-pipe.o +perf-y += mem-memcpy.o +perf-y += futex-hash.o +perf-y += futex-wake.o +perf-y += futex-requeue.o + +perf-$(CONFIG_X86_64) += mem-memcpy-x86-64-asm.o +perf-$(CONFIG_X86_64) += mem-memset-x86-64-asm.o + +perf-$(CONFIG_NUMA) += numa.o
tools/perf/config/Makefile +2 -0
@@ -28,6 +28,7 @@ ifeq ($(ARCH),x86) CFLAGS += -DHAVE_ARCH_X86_64_SUPPORT ARCH_INCLUDE = ../../arch/x86/lib/memcpy_64.S ../../arch/x86/lib/memset_64.S LIBUNWIND_LIBS = -lunwind -lunwind-x86_64 + $(call detected,CONFIG_X86_64) else LIBUNWIND_LIBS = -lunwind -lunwind-x86 endif
@@ -633,6 +634,7 @@ ifndef NO_LIBNUMA else CFLAGS += -DHAVE_LIBNUMA_SUPPORT EXTLIBS += -lnuma + $(call detected,CONFIG_NUMA) endif endif
Signature · 1 line
1.9.3
Jiri Olsa
reviewerPATCH 5/30 perf build: Add tests objects building
In reply to Jiri OlsaMove test objects building under build framework.
--- tools/perf/Build | 1 + tools/perf/Build.include | 3 ++- tools/perf/Makefile.perf | 55 ---------------------------------------------- tools/perf/config/Makefile | 10 +++++++++ tools/perf/tests/Build | 43 ++++++++++++++++++++++++++++++++++++ 5 files changed, 56 insertions(+), 56 deletions(-) create mode 100644 tools/perf/tests/Build
tools/perf/Build +1 -0
@@ -1,2 +1,3 @@ perf-y += builtin-bench.o perf-y += bench/ +perf-y += tests/
tools/perf/Build.include +2 -1
@@ -70,4 +70,5 @@ if_changed = $(if $(strip $(any-prereq) $(arg-check)), \ # - depfile generation # - global $(CFLAGS) # - per target C flags -c_flags = -Wp,-MD,$(depfile),-MT,$@ $(CFLAGS) $(CFLAGS_$(basetarget).o) +# - BUILD_STR macro to allow '-D"$(variable)"' constructs +c_flags = -Wp,-MD,$(depfile),-MT,$@ $(CFLAGS) -D"BUILD_STR(s)=\#s" $(CFLAGS_$(basetarget).o)
tools/perf/Makefile.perf +0 -55
79 lines not on this page · raw message
tools/perf/config/Makefile +10 -0
@@ -20,10 +20,13 @@ CFLAGS := $(EXTRA_CFLAGS) $(EXTRA_WARNINGS) include $(src-perf)/config/Makefile.arch +$(call detected_var,ARCH) + NO_PERF_REGS := 1 # Additional ARCH settings for x86 ifeq ($(ARCH),x86) + $(call detected,CONFIG_X86) ifeq (${IS_X86_64}, 1) CFLAGS += -DHAVE_ARCH_X86_64_SUPPORT ARCH_INCLUDE = ../../arch/x86/lib/memcpy_64.S ../../arch/x86/lib/memset_64.S
@@ -418,6 +421,7 @@ endif ifeq ($(dwarf-post-unwind),1) CFLAGS += -DHAVE_DWARF_UNWIND_SUPPORT + $(call detected,CONFIG_DWARF_UNWIND) else NO_DWARF_UNWIND := 1 endif
@@ -815,3 +819,9 @@ endif ifeq ($(display_lib),1) $(info ) endif + +$(call detected_var,bindir_SQ) +$(call detected_var,PYTHON_WORD) +ifneq ($(OUTPUT),) +$(call detected_var,OUTPUT) +endif
tools/perf/tests/Build new file +43 -0
43 lines not on this page · raw message
Signature · 1 line
1.9.3
Jiri Olsa
reviewerPATCH 6/30 perf build: Add builtin objects building
In reply to Jiri OlsaMove the rest of builtin objects (bench and test are already in) building under build framework.
--- tools/perf/Build | 29 +++++++++++++++++++++++++++++ tools/perf/Makefile.perf | 35 ----------------------------------- tools/perf/config/Makefile | 4 ++++ 3 files changed, 33 insertions(+), 35 deletions(-)
tools/perf/Build +29 -0
@@ -1,3 +1,32 @@ perf-y += builtin-bench.o +perf-y += builtin-annotate.o +perf-y += builtin-diff.o +perf-y += builtin-evlist.o +perf-y += builtin-help.o +perf-y += builtin-sched.o +perf-y += builtin-buildid-list.o +perf-y += builtin-buildid-cache.o +perf-y += builtin-list.o +perf-y += builtin-record.o +perf-y += builtin-report.o +perf-y += builtin-stat.o +perf-y += builtin-timechart.o +perf-y += builtin-top.o +perf-y += builtin-script.o +perf-y += builtin-kmem.o +perf-y += builtin-lock.o +perf-y += builtin-kvm.o +perf-y += builtin-inject.o +perf-y += builtin-mem.o + +perf-$(CONFIG_AUDIT) += builtin-trace.o + perf-y += bench/ perf-y += tests/ + +paths += -DPERF_HTML_PATH="BUILD_STR($(htmldir_SQ))" +paths += -DPERF_INFO_PATH="BUILD_STR($(infodir_SQ))" +paths += -DPERF_MAN_PATH="BUILD_STR($(mandir_SQ))" + +CFLAGS_builtin-help.o += $(paths) +CFLAGS_builtin-timechart.o += $(paths)
tools/perf/Makefile.perf +0 -35
@@ -419,26 +419,7 @@ LIB_OBJS += $(OUTPUT)ui/stdio/hist.o LIB_OBJS += $(OUTPUT)arch/common.o -BUILTIN_OBJS += $(OUTPUT)builtin-annotate.o -BUILTIN_OBJS += $(OUTPUT)builtin-diff.o -BUILTIN_OBJS += $(OUTPUT)builtin-evlist.o -BUILTIN_OBJS += $(OUTPUT)builtin-help.o -BUILTIN_OBJS += $(OUTPUT)builtin-sched.o -BUILTIN_OBJS += $(OUTPUT)builtin-buildid-list.o -BUILTIN_OBJS += $(OUTPUT)builtin-buildid-cache.o -BUILTIN_OBJS += $(OUTPUT)builtin-list.o -BUILTIN_OBJS += $(OUTPUT)builtin-record.o -BUILTIN_OBJS += $(OUTPUT)builtin-report.o -BUILTIN_OBJS += $(OUTPUT)builtin-stat.o -BUILTIN_OBJS += $(OUTPUT)builtin-timechart.o -BUILTIN_OBJS += $(OUTPUT)builtin-top.o -BUILTIN_OBJS += $(OUTPUT)builtin-script.o BUILTIN_OBJS += $(OUTPUT)builtin-probe.o -BUILTIN_OBJS += $(OUTPUT)builtin-kmem.o -BUILTIN_OBJS += $(OUTPUT)builtin-lock.o -BUILTIN_OBJS += $(OUTPUT)builtin-kvm.o -BUILTIN_OBJS += $(OUTPUT)builtin-inject.o -BUILTIN_OBJS += $(OUTPUT)builtin-mem.o PERFLIBS = $(LIB_FILE) $(LIBAPIKFS) $(LIBTRACEEVENT)
@@ -480,10 +461,6 @@ ifndef NO_LIBUNWIND LIB_OBJS += $(OUTPUT)util/unwind-libunwind.o endif -ifndef NO_LIBAUDIT - BUILTIN_OBJS += $(OUTPUT)builtin-trace.o -endif - ifndef NO_SLANG LIB_OBJS += $(OUTPUT)ui/browser.o LIB_OBJS += $(OUTPUT)ui/browsers/annotate.o
@@ -585,18 +562,6 @@ $(GTK_OBJS): $(OUTPUT)%.o: %.c $(LIB_H) $(OUTPUT)libperf-gtk.so: $(GTK_OBJS) $(PERFLIBS) $(QUIET_LINK)$(CC) -o $@ -shared $(LDFLAGS) $(filter %.o,$^) $(GTK_LIBS) -$(OUTPUT)builtin-help.o: builtin-help.c $(OUTPUT)common-cmds.h $(OUTPUT)PERF-CFLAGS - $(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) \ - '-DPERF_HTML_PATH="$(htmldir_SQ)"' \ - '-DPERF_MAN_PATH="$(mandir_SQ)"' \ - '-DPERF_INFO_PATH="$(infodir_SQ)"' $< - -$(OUTPUT)builtin-timechart.o: builtin-timechart.c $(OUTPUT)common-cmds.h $(OUTPUT)PERF-CFLAGS - $(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) \ - '-DPERF_HTML_PATH="$(htmldir_SQ)"' \ - '-DPERF_MAN_PATH="$(mandir_SQ)"' \ - '-DPERF_INFO_PATH="$(infodir_SQ)"' $< - $(OUTPUT)common-cmds.h: util/generate-cmdlist.sh command-list.txt $(OUTPUT)common-cmds.h: $(wildcard Documentation/perf-*.txt)
tools/perf/config/Makefile +4 -0
@@ -450,6 +450,7 @@ ifndef NO_LIBAUDIT else CFLAGS += -DHAVE_LIBAUDIT_SUPPORT EXTLIBS += -laudit + $(call detected,CONFIG_AUDIT) endif endif
@@ -825,3 +826,6 @@ $(call detected_var,PYTHON_WORD) ifneq ($(OUTPUT),) $(call detected_var,OUTPUT) endif +$(call detected_var,htmldir_SQ) +$(call detected_var,infodir_SQ) +$(call detected_var,mandir_SQ)
Signature · 1 line
1.9.3
Jiri Olsa
reviewerPATCH 7/30 perf build: Add libperf objects building
In reply to Jiri OlsaMove the util objects building under build framework.
Add new libperf build object so it's separated from the rest of the perf code and could be librarized.
--- tools/perf/Build | 3 + tools/perf/Makefile.build | 3 + tools/perf/Makefile.perf | 145 +++++++-------------------------------------- tools/perf/arch/Build | 1 + tools/perf/config/Makefile | 4 ++ tools/perf/util/Build | 112 ++++++++++++++++++++++++++++++++++ 6 files changed, 144 insertions(+), 124 deletions(-) create mode 100644 tools/perf/arch/Build create mode 100644 tools/perf/util/Build
tools/perf/Build +3 -0
@@ -30,3 +30,6 @@ paths += -DPERF_MAN_PATH="BUILD_STR($(mandir_SQ))" CFLAGS_builtin-help.o += $(paths) CFLAGS_builtin-timechart.o += $(paths) + +libperf-y += util/ +libperf-y += arch/
tools/perf/Makefile.build +3 -0
@@ -30,6 +30,9 @@ subdir-obj-y := build-file := $(dir)/Build include $(build-file) +quiet_cmd_flex = FLEX $@ +quiet_cmd_bison = BISON $@ + # Create directory unless it exists quiet_cmd_mkdir = MKDIR $(dir $@) cmd_mkdir = $(if $(wildcard $(dir $@)),,@$(call echo-cmd,mkdir) mkdir -p $(dir $@))
tools/perf/Makefile.perf +21 -124
201 lines not on this page · raw message
tools/perf/arch/Build new file +1 -0
@@ -0,0 +1 @@ +libperf-y += common.o
tools/perf/config/Makefile +4 -0
@@ -122,6 +122,8 @@ ifdef PARSER_DEBUG PARSER_DEBUG_BISON := -t PARSER_DEBUG_FLEX := -d CFLAGS += -DPARSER_DEBUG + $(call detected_var,PARSER_DEBUG_BISON) + $(call detected_var,PARSER_DEBUG_FLEX) endif ifndef NO_LIBPYTHON
@@ -829,3 +831,5 @@ endif $(call detected_var,htmldir_SQ) $(call detected_var,infodir_SQ) $(call detected_var,mandir_SQ) +$(call detected_var,ETC_PERFCONFIG_SQ) +$(call detected_var,prefix_SQ)
tools/perf/util/Build new file +112 -0
112 lines not on this page · raw message
Signature · 1 line
1.9.3
Namhyung Kim
maintainerRe: [PATCH 07/30] perf build: Add libperf objects building
Quoted 5 lines · Jiri Olsa
Move the util objects building under build framework.
Add new libperf build object so it's separated from the rest of the perf code and could be librarized.
[SNIP]
tools/perf/util/Build line 82
Quoted 2 lines
+$(OUTPUT)util/parse-events-flex.c: util/parse-events.l $(OUTPUT)util/parse-events-bison.c
tools/perf/util/Build new file +1
-0+ @$(call echo-cmd,bison)$(FLEX) -o $@ --header-file=$(OUTPUT)util/parse-events-flex.h $(PARSER_DEBUG_FLEX) util/parse-events.l
^^^^^
s/bison/flex/ ?
tools/perf/util/Build line 85
Quoted 3 lines
tools/perf/util/Build new file +3
-0+ +$(OUTPUT)util/parse-events-bison.c: util/parse-events.y + @$(call echo-cmd,bison)$(BISON) -v util/parse-events.y -d $(PARSER_DEBUG_BISON) -o $(OUTPUT)util/parse-events-bison.c -p parse_events_
I guess we can simply use "-o $@" here.
tools/perf/util/Build line 91
Quoted 6 lines
tools/perf/util/Build new file +6
-0+ +$(OUTPUT)util/pmu-flex.c: util/pmu.l $(OUTPUT)util/pmu-bison.c + @$(call echo-cmd,flex)$(FLEX) -o $@ --header-file=$(OUTPUT)util/pmu-flex.h util/pmu.l + +$(OUTPUT)util/pmu-bison.c: util/pmu.y + @$(call echo-cmd,bison)$(BISON) -v util/pmu.y -d -o $(OUTPUT)util/pmu-bison.c -p perf_pmu_
Ditto.
Thanks,
Namhyung
Quoted 29 lines
tools/perf/util/Build new file +21
-0+ +CFLAGS_parse-events-flex.o += -w +CFLAGS_pmu-flex.o += -w +CFLAGS_parse-events-bison.o += -DYYENABLE_NLS=0 -DYYLTYPE_IS_TRIVIAL=0 -w +CFLAGS_pmu-bison.o += -DYYENABLE_NLS=0 -DYYLTYPE_IS_TRIVIAL=0 -w + +$(OUTPUT)util/parse-events.o: $(OUTPUT)util/parse-events-flex.c $(OUTPUT)util/parse-events-bison.c +$(OUTPUT)util/pmu.o: $(OUTPUT)util/pmu-flex.c $(OUTPUT)util/pmu-bison.c + +CFLAGS_find_next_bit.o += -Wno-unused-parameter -DETC_PERFCONFIG="BUILD_STR($(ETC_PERFCONFIG_SQ))" +CFLAGS_rbtree.o += -Wno-unused-parameter -DETC_PERFCONFIG="BUILD_STR($(ETC_PERFCONFIG_SQ))" +CFLAGS_parse-events.o += -Wno-redundant-decls + +$(OUTPUT)util/kallsyms.o: ../lib/symbol/kallsyms.c FORCE + $(call if_changed_dep,cc_o_c) + +$(OUTPUT)util/find_next_bit.o: ../lib/util/find_next_bit.c FORCE + $(call if_changed_dep,cc_o_c) + +$(OUTPUT)util/rbtree.o: ../../lib/rbtree.c FORCE + $(call if_changed_dep,cc_o_c)Signature · 7 lines
1.9.3 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 07/30] perf build: Add libperf objects building
Quoted 8 lines · Namhyung Kim
Quoted 5 lines · Jiri Olsa
Move the util objects building under build framework.
Add new libperf build object so it's separated from the rest of the perf code and could be librarized.
Quoted 5 lines
[SNIP]
tools/perf/util/Build line 82
Quoted 2 lines
+$(OUTPUT)util/parse-events-flex.c: util/parse-events.l $(OUTPUT)util/parse-events-bison.c
tools/perf/util/Build new file +1
-0+ @$(call echo-cmd,bison)$(FLEX) -o $@ --header-file=$(OUTPUT)util/parse-events-flex.h $(PARSER_DEBUG_FLEX) util/parse-events.l^^^^^s/bison/flex/ ?
yes
Quoted 7 lines
tools/perf/util/Build line 85
Quoted 5 lines
tools/perf/util/Build new file +3
-0+ +$(OUTPUT)util/parse-events-bison.c: util/parse-events.y + @$(call echo-cmd,bison)$(BISON) -v util/parse-events.y -d $(PARSER_DEBUG_BISON) -o $(OUTPUT)util/parse-events-bison.c -p parse_events_I guess we can simply use "-o $@" here.
yes
Quoted 10 lines
tools/perf/util/Build line 91
Quoted 8 lines
tools/perf/util/Build new file +6
-0+ +$(OUTPUT)util/pmu-flex.c: util/pmu.l $(OUTPUT)util/pmu-bison.c + @$(call echo-cmd,flex)$(FLEX) -o $@ --header-file=$(OUTPUT)util/pmu-flex.h util/pmu.l + +$(OUTPUT)util/pmu-bison.c: util/pmu.y + @$(call echo-cmd,bison)$(BISON) -v util/pmu.y -d -o $(OUTPUT)util/pmu-bison.c -p perf_pmu_Ditto.
and yes ;-)
thanks,
jirka
Jiri Olsa
reviewerPATCH 8/30 perf build: Add probe objects building
In reply to Jiri OlsaMove the probe objects building under build framework to be included in the libperf build object.
--- tools/perf/Build | 1 + tools/perf/Makefile.perf | 19 +------------------ tools/perf/config/Makefile | 1 + tools/perf/util/Build | 7 +++++++ 4 files changed, 10 insertions(+), 18 deletions(-)
tools/perf/Build +1 -0
@@ -20,6 +20,7 @@ perf-y += builtin-inject.o perf-y += builtin-mem.o perf-$(CONFIG_AUDIT) += builtin-trace.o +perf-$(CONFIG_LIBELF) += builtin-probe.o perf-y += bench/ perf-y += tests/
tools/perf/Makefile.perf +1 -18
@@ -327,9 +327,6 @@ LIB_H += util/data.h LIB_H += util/kvm-stat.h LIB_H += util/thread-stack.h -LIB_OBJS += $(OUTPUT)util/symbol-elf.o -LIB_OBJS += $(OUTPUT)util/probe-event.o - LIB_OBJS += $(OUTPUT)ui/setup.o LIB_OBJS += $(OUTPUT)ui/helpline.o LIB_OBJS += $(OUTPUT)ui/progress.o
@@ -337,8 +334,6 @@ LIB_OBJS += $(OUTPUT)ui/util.o LIB_OBJS += $(OUTPUT)ui/hist.o LIB_OBJS += $(OUTPUT)ui/stdio/hist.o -BUILTIN_OBJS += $(OUTPUT)builtin-probe.o - PERFLIBS = $(LIB_FILE) $(LIBAPIKFS) $(LIBTRACEEVENT) # We choose to avoid "if .. else if .. else .. endif endif"
@@ -351,19 +346,7 @@ ifneq ($(OUTPUT),) CFLAGS += -I$(OUTPUT) endif -ifdef NO_LIBELF -# Remove ELF/DWARF dependent codes -LIB_OBJS := $(filter-out $(OUTPUT)util/symbol-elf.o,$(LIB_OBJS)) -LIB_OBJS := $(filter-out $(OUTPUT)util/dwarf-aux.o,$(LIB_OBJS)) -LIB_OBJS := $(filter-out $(OUTPUT)util/probe-event.o,$(LIB_OBJS)) -LIB_OBJS := $(filter-out $(OUTPUT)util/probe-finder.o,$(LIB_OBJS)) - -BUILTIN_OBJS := $(filter-out $(OUTPUT)builtin-probe.o,$(BUILTIN_OBJS)) - -# Use minimal symbol handling -LIB_OBJS += $(OUTPUT)util/symbol-minimal.o - -else # NO_LIBELF +ifndef NO_LIBELF ifndef NO_DWARF LIB_OBJS += $(OUTPUT)util/probe-finder.o LIB_OBJS += $(OUTPUT)util/dwarf-aux.o
tools/perf/config/Makefile +1 -0
@@ -365,6 +365,7 @@ endif # NO_LIBELF ifndef NO_LIBELF CFLAGS += -DHAVE_LIBELF_SUPPORT EXTLIBS += -lelf + $(call detected,CONFIG_LIBELF) ifeq ($(feature-libelf-mmap), 1) CFLAGS += -DHAVE_LIBELF_MMAP_SUPPORT
tools/perf/util/Build +7 -0
@@ -75,6 +75,13 @@ libperf-y += tsc.o libperf-y += cloexec.o libperf-y += thread-stack.o +libperf-$(CONFIG_LIBELF) += symbol-elf.o +libperf-$(CONFIG_LIBELF) += probe-event.o + +ifndef CONFIG_LIBELF +libperf-y += symbol-minimal.o +endif + CFLAGS_config.o += -DETC_PERFCONFIG="BUILD_STR($(ETC_PERFCONFIG_SQ))" CFLAGS_exec_cmd.o += -DPERF_EXEC_PATH="BUILD_STR($(perfexecdir_SQ))" -DPREFIX="BUILD_STR($(prefix_SQ))"
Signature · 1 line
1.9.3
Jiri Olsa
reviewerPATCH 9/30 perf build: Add dwarf objects building
In reply to Jiri OlsaMove the dwarf objects building under build framework to be included in the libperf build object.
--- tools/perf/Makefile.perf | 7 ------- tools/perf/config/Makefile | 1 + tools/perf/util/Build | 3 +++ 3 files changed, 4 insertions(+), 7 deletions(-)
tools/perf/Makefile.perf +0 -7
@@ -346,13 +346,6 @@ ifneq ($(OUTPUT),) CFLAGS += -I$(OUTPUT) endif -ifndef NO_LIBELF -ifndef NO_DWARF - LIB_OBJS += $(OUTPUT)util/probe-finder.o - LIB_OBJS += $(OUTPUT)util/dwarf-aux.o -endif # NO_DWARF -endif # NO_LIBELF - ifndef NO_LIBDW_DWARF_UNWIND LIB_OBJS += $(OUTPUT)util/unwind-libdw.o LIB_H += util/unwind-libdw.h
tools/perf/config/Makefile +1 -0
@@ -386,6 +386,7 @@ ifndef NO_LIBELF CFLAGS += -DHAVE_DWARF_SUPPORT $(LIBDW_CFLAGS) LDFLAGS += $(LIBDW_LDFLAGS) EXTLIBS += -ldw + $(call detected,CONFIG_DWARF) endif # PERF_HAVE_DWARF_REGS endif # NO_DWARF endif # NO_LIBELF
tools/perf/util/Build +3 -0
@@ -82,6 +82,9 @@ ifndef CONFIG_LIBELF libperf-y += symbol-minimal.o endif +libperf-$(CONFIG_DWARF) += probe-finder.o +libperf-$(CONFIG_DWARF) += dwarf-aux.o + CFLAGS_config.o += -DETC_PERFCONFIG="BUILD_STR($(ETC_PERFCONFIG_SQ))" CFLAGS_exec_cmd.o += -DPERF_EXEC_PATH="BUILD_STR($(perfexecdir_SQ))" -DPREFIX="BUILD_STR($(prefix_SQ))"
Signature · 1 line
1.9.3
Jiri Olsa
reviewerPATCH 10/30 perf build: Add dwarf unwind objects building
In reply to Jiri OlsaMove the dwarf unwind objects building under build framework to be included in the libperf build object.
--- tools/perf/Makefile.perf | 9 --------- tools/perf/config/Makefile | 2 ++ tools/perf/util/Build | 3 +++ 3 files changed, 5 insertions(+), 9 deletions(-)
tools/perf/Makefile.perf +0 -9
@@ -346,15 +346,6 @@ ifneq ($(OUTPUT),) CFLAGS += -I$(OUTPUT) endif -ifndef NO_LIBDW_DWARF_UNWIND - LIB_OBJS += $(OUTPUT)util/unwind-libdw.o - LIB_H += util/unwind-libdw.h -endif - -ifndef NO_LIBUNWIND - LIB_OBJS += $(OUTPUT)util/unwind-libunwind.o -endif - ifndef NO_SLANG LIB_OBJS += $(OUTPUT)ui/browser.o LIB_OBJS += $(OUTPUT)ui/browsers/annotate.o
tools/perf/config/Makefile +2 -0
@@ -414,9 +414,11 @@ ifdef NO_LIBUNWIND dwarf-post-unwind := 0 else dwarf-post-unwind-text := libdw + $(call detected,CONFIG_LIBDW_DWARF_UNWIND) endif else dwarf-post-unwind-text := libunwind + $(call detected,CONFIG_LIBUNWIND) # Enable libunwind support by default. ifndef NO_LIBDW_DWARF_UNWIND NO_LIBDW_DWARF_UNWIND := 1
tools/perf/util/Build +3 -0
@@ -85,6 +85,9 @@ endif libperf-$(CONFIG_DWARF) += probe-finder.o libperf-$(CONFIG_DWARF) += dwarf-aux.o +libperf-$(CONFIG_LIBDW_DWARF_UNWIND) += unwind-libdw.o +libperf-$(CONFIG_LIBUNWIND) += unwind-libunwind.o + CFLAGS_config.o += -DETC_PERFCONFIG="BUILD_STR($(ETC_PERFCONFIG_SQ))" CFLAGS_exec_cmd.o += -DPERF_EXEC_PATH="BUILD_STR($(perfexecdir_SQ))" -DPREFIX="BUILD_STR($(prefix_SQ))"
Signature · 1 line
1.9.3
Jiri Olsa
reviewerPATCH 11/30 perf build: Add ui objects building
In reply to Jiri OlsaMove the ui objects building under build framework to be included in the libperf build object.
--- tools/perf/Build | 1 + tools/perf/Makefile.perf | 10 ---------- tools/perf/config/Makefile | 1 + tools/perf/ui/Build | 8 ++++++++ 4 files changed, 10 insertions(+), 10 deletions(-) create mode 100644 tools/perf/ui/Build
tools/perf/Build +1 -0
@@ -34,3 +34,4 @@ CFLAGS_builtin-timechart.o += $(paths) libperf-y += util/ libperf-y += arch/ +libperf-y += ui/
tools/perf/Makefile.perf +0 -10
@@ -327,13 +327,6 @@ LIB_H += util/data.h LIB_H += util/kvm-stat.h LIB_H += util/thread-stack.h -LIB_OBJS += $(OUTPUT)ui/setup.o -LIB_OBJS += $(OUTPUT)ui/helpline.o -LIB_OBJS += $(OUTPUT)ui/progress.o -LIB_OBJS += $(OUTPUT)ui/util.o -LIB_OBJS += $(OUTPUT)ui/hist.o -LIB_OBJS += $(OUTPUT)ui/stdio/hist.o - PERFLIBS = $(LIB_FILE) $(LIBAPIKFS) $(LIBTRACEEVENT) # We choose to avoid "if .. else if .. else .. endif endif"
@@ -492,9 +485,6 @@ $(OUTPUT)%.o: %.S $(OUTPUT)%.s: %.S $(QUIET_CC)$(CC) -o $@ -E $(CFLAGS) $< -$(OUTPUT)ui/setup.o: ui/setup.c $(OUTPUT)PERF-CFLAGS - $(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) -DLIBDIR='"$(libdir_SQ)"' $< - $(OUTPUT)ui/browser.o: ui/browser.c $(OUTPUT)PERF-CFLAGS $(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) -DENABLE_SLFUTURE_CONST $<
tools/perf/config/Makefile +1 -0
@@ -837,3 +837,4 @@ $(call detected_var,infodir_SQ) $(call detected_var,mandir_SQ) $(call detected_var,ETC_PERFCONFIG_SQ) $(call detected_var,prefix_SQ) +$(call detected_var,LIBDIR)
tools/perf/ui/Build new file +8 -0
@@ -0,0 +1,8 @@ +libperf-y += setup.o +libperf-y += helpline.o +libperf-y += progress.o +libperf-y += util.o +libperf-y += hist.o +libperf-y += stdio/hist.o + +CFLAGS_setup.o += -DLIBDIR="BUILD_STR($(LIBDIR))"
Signature · 1 line
1.9.3
Jiri Olsa
reviewerPATCH 12/30 perf build: Add slang objects building
In reply to Jiri OlsaMove the slang objects building under build framework to be included in the libperf build object.
--- tools/perf/Makefile.perf | 33 --------------------------------- tools/perf/config/Makefile | 1 + tools/perf/ui/Build | 6 ++++++ tools/perf/ui/browsers/Build | 10 ++++++++++ tools/perf/ui/tui/Build | 4 ++++ 5 files changed, 21 insertions(+), 33 deletions(-) create mode 100644 tools/perf/ui/browsers/Build create mode 100644 tools/perf/ui/tui/Build
tools/perf/Makefile.perf +0 -33
@@ -339,24 +339,6 @@ ifneq ($(OUTPUT),) CFLAGS += -I$(OUTPUT) endif -ifndef NO_SLANG - LIB_OBJS += $(OUTPUT)ui/browser.o - LIB_OBJS += $(OUTPUT)ui/browsers/annotate.o - LIB_OBJS += $(OUTPUT)ui/browsers/hists.o - LIB_OBJS += $(OUTPUT)ui/browsers/map.o - LIB_OBJS += $(OUTPUT)ui/browsers/scripts.o - LIB_OBJS += $(OUTPUT)ui/browsers/header.o - LIB_OBJS += $(OUTPUT)ui/tui/setup.o - LIB_OBJS += $(OUTPUT)ui/tui/util.o - LIB_OBJS += $(OUTPUT)ui/tui/helpline.o - LIB_OBJS += $(OUTPUT)ui/tui/progress.o - LIB_H += ui/tui/tui.h - LIB_H += ui/browser.h - LIB_H += ui/browsers/map.h - LIB_H += ui/keysyms.h - LIB_H += ui/libslang.h -endif - ifndef NO_GTK2 ALL_PROGRAMS += $(OUTPUT)libperf-gtk.so
@@ -485,21 +467,6 @@ $(OUTPUT)%.o: %.S $(OUTPUT)%.s: %.S $(QUIET_CC)$(CC) -o $@ -E $(CFLAGS) $< -$(OUTPUT)ui/browser.o: ui/browser.c $(OUTPUT)PERF-CFLAGS - $(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) -DENABLE_SLFUTURE_CONST $< - -$(OUTPUT)ui/browsers/annotate.o: ui/browsers/annotate.c $(OUTPUT)PERF-CFLAGS - $(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) -DENABLE_SLFUTURE_CONST $< - -$(OUTPUT)ui/browsers/hists.o: ui/browsers/hists.c $(OUTPUT)PERF-CFLAGS - $(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) -DENABLE_SLFUTURE_CONST $< - -$(OUTPUT)ui/browsers/map.o: ui/browsers/map.c $(OUTPUT)PERF-CFLAGS - $(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) -DENABLE_SLFUTURE_CONST $< - -$(OUTPUT)ui/browsers/scripts.o: ui/browsers/scripts.c $(OUTPUT)PERF-CFLAGS - $(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) -DENABLE_SLFUTURE_CONST $< - $(OUTPUT)util/scripting-engines/trace-event-perl.o: util/scripting-engines/trace-event-perl.c $(OUTPUT)PERF-CFLAGS $(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) $(PERL_EMBED_CCOPTS) -Wno-redundant-decls -Wno-strict-prototypes -Wno-unused-parameter -Wno-shadow -Wno-undef -Wno-switch-default $<
tools/perf/config/Makefile +1 -0
@@ -473,6 +473,7 @@ ifndef NO_SLANG CFLAGS += -I/usr/include/slang CFLAGS += -DHAVE_SLANG_SUPPORT EXTLIBS += -lslang + $(call detected,CONFIG_SLANG) endif endif
tools/perf/ui/Build +6 -0
@@ -6,3 +6,9 @@ libperf-y += hist.o libperf-y += stdio/hist.o CFLAGS_setup.o += -DLIBDIR="BUILD_STR($(LIBDIR))" + +libperf-$(CONFIG_SLANG) += browser.o +libperf-$(CONFIG_SLANG) += browsers/ +libperf-$(CONFIG_SLANG) += tui/ + +CFLAGS_browser.o += -DENABLE_SLFUTURE_CONST
tools/perf/ui/browsers/Build new file +10 -0
@@ -0,0 +1,10 @@ +libperf-y += annotate.o +libperf-y += hists.o +libperf-y += map.o +libperf-y += scripts.o +libperf-y += header.o + +CFLAGS_annotate.o += -DENABLE_SLFUTURE_CONST +CFLAGS_hists.o += -DENABLE_SLFUTURE_CONST +CFLAGS_map.o += -DENABLE_SLFUTURE_CONST +CFLAGS_scripts.o += -DENABLE_SLFUTURE_CONST
tools/perf/ui/tui/Build new file +4 -0
@@ -0,0 +1,4 @@ +libperf-y += setup.o +libperf-y += util.o +libperf-y += helpline.o +libperf-y += progress.o
Signature · 1 line
1.9.3
Jiri Olsa
reviewerPATCH 13/30 perf build: Add gtk objects building
In reply to Jiri OlsaMove the gtk objects building under build framework.
Add new gtk build object so it's separated from the rest of the code and could be librarized.
--- tools/perf/Build | 2 ++ tools/perf/Build.include | 3 ++- tools/perf/Makefile.perf | 17 +++++------------ tools/perf/config/Makefile | 1 + tools/perf/ui/gtk/Build | 9 +++++++++ 5 files changed, 19 insertions(+), 13 deletions(-) create mode 100644 tools/perf/ui/gtk/Build
tools/perf/Build +2 -0
@@ -35,3 +35,5 @@ CFLAGS_builtin-timechart.o += $(paths) libperf-y += util/ libperf-y += arch/ libperf-y += ui/ + +gtk-y += ui/gtk/
tools/perf/Build.include +2 -1
@@ -70,5 +70,6 @@ if_changed = $(if $(strip $(any-prereq) $(arg-check)), \ # - depfile generation # - global $(CFLAGS) # - per target C flags +# - per object C flags # - BUILD_STR macro to allow '-D"$(variable)"' constructs -c_flags = -Wp,-MD,$(depfile),-MT,$@ $(CFLAGS) -D"BUILD_STR(s)=\#s" $(CFLAGS_$(basetarget).o) +c_flags = -Wp,-MD,$(depfile),-MT,$@ $(CFLAGS) -D"BUILD_STR(s)=\#s" $(CFLAGS_$(basetarget).o) $(CFLAGS_$(obj))
tools/perf/Makefile.perf +5 -12
@@ -341,14 +341,7 @@ endif ifndef NO_GTK2 ALL_PROGRAMS += $(OUTPUT)libperf-gtk.so - - GTK_OBJS += $(OUTPUT)ui/gtk/browser.o - GTK_OBJS += $(OUTPUT)ui/gtk/hists.o - GTK_OBJS += $(OUTPUT)ui/gtk/setup.o - GTK_OBJS += $(OUTPUT)ui/gtk/util.o - GTK_OBJS += $(OUTPUT)ui/gtk/helpline.o - GTK_OBJS += $(OUTPUT)ui/gtk/progress.o - GTK_OBJS += $(OUTPUT)ui/gtk/annotate.o + GTK_IN := $(OUTPUT)gtk-in.o install-gtk: $(OUTPUT)libperf-gtk.so $(call QUIET_INSTALL, 'GTK UI') \
@@ -417,10 +410,10 @@ $(OUTPUT)perf: $(OUTPUT)perf.o $(BUILTIN_OBJS) $(PERFLIBS) $(PERF_IN) $(QUIET_LINK)$(CC) $(CFLAGS) $(LDFLAGS) $(OUTPUT)perf.o \ $(BUILTIN_OBJS) $(PERF_IN) $(LIBS) -o $@ -$(GTK_OBJS): $(OUTPUT)%.o: %.c $(LIB_H) - $(QUIET_CC)$(CC) -o $@ -c -fPIC $(CFLAGS) $(GTK_CFLAGS) $< +$(GTK_IN): FORCE + @$(MAKE) $(build)=gtk -$(OUTPUT)libperf-gtk.so: $(GTK_OBJS) $(PERFLIBS) +$(OUTPUT)libperf-gtk.so: $(GTK_IN) $(PERFLIBS) $(QUIET_LINK)$(CC) -o $@ -shared $(LDFLAGS) $(filter %.o,$^) $(GTK_LIBS) $(OUTPUT)common-cmds.h: util/generate-cmdlist.sh command-list.txt
@@ -700,7 +693,7 @@ config-clean: @$(MAKE) -C config/feature-checks clean >/dev/null clean: $(LIBTRACEEVENT)-clean $(LIBAPIKFS)-clean config-clean - $(call QUIET_CLEAN, core-objs) $(RM) $(LIB_OBJS) $(BUILTIN_OBJS) $(LIB_FILE) $(OUTPUT)perf-archive $(OUTPUT)perf-with-kcore $(OUTPUT)perf.o $(LANG_BINDINGS) $(GTK_OBJS) + $(call QUIET_CLEAN, core-objs) $(RM) $(LIB_OBJS) $(BUILTIN_OBJS) $(LIB_FILE) $(OUTPUT)perf-archive $(OUTPUT)perf-with-kcore $(OUTPUT)perf.o $(LANG_BINDINGS) @find $(if $(OUTPUT),$(OUTPUT),.) -name \*.o | xargs $(RM) @$(RM) .config-detected $(call QUIET_CLEAN, core-progs) $(RM) $(ALL_PROGRAMS) perf perf-read-vdso32 perf-read-vdsox32
tools/perf/config/Makefile +1 -0
@@ -839,3 +839,4 @@ $(call detected_var,mandir_SQ) $(call detected_var,ETC_PERFCONFIG_SQ) $(call detected_var,prefix_SQ) $(call detected_var,LIBDIR) +$(call detected_var,GTK_CFLAGS)
tools/perf/ui/gtk/Build new file +9 -0
@@ -0,0 +1,9 @@ +CFLAGS_gtk += -fPIC $(GTK_CFLAGS) + +gtk-y += browser.o +gtk-y += hists.o +gtk-y += setup.o +gtk-y += util.o +gtk-y += helpline.o +gtk-y += progress.o +gtk-y += annotate.o
Signature · 1 line
1.9.3
Jiri Olsa
reviewerPATCH 14/30 perf build: Add scripts objects building
In reply to Jiri OlsaMove the scripts objects building under build framework to be included in the libperf build object.
--- tools/perf/Build | 1 + tools/perf/Makefile.perf | 22 ---------------------- tools/perf/config/Makefile | 7 +++++++ tools/perf/scripts/Build | 2 ++ tools/perf/scripts/perl/Perf-Trace-Util/Build | 3 +++ tools/perf/scripts/python/Perf-Trace-Util/Build | 3 +++ tools/perf/util/Build | 2 ++ tools/perf/util/scripting-engines/Build | 6 ++++++ 8 files changed, 24 insertions(+), 22 deletions(-) create mode 100644 tools/perf/scripts/Build create mode 100644 tools/perf/scripts/perl/Perf-Trace-Util/Build create mode 100644 tools/perf/scripts/python/Perf-Trace-Util/Build create mode 100644 tools/perf/util/scripting-engines/Build
tools/perf/Build +1 -0
@@ -35,5 +35,6 @@ CFLAGS_builtin-timechart.o += $(paths) libperf-y += util/ libperf-y += arch/ libperf-y += ui/ +libperf-$(CONFIG_SCRIPT) += scripts/ gtk-y += ui/gtk/
tools/perf/Makefile.perf +0 -22
@@ -349,16 +349,6 @@ install-gtk: $(OUTPUT)libperf-gtk.so $(INSTALL) $(OUTPUT)libperf-gtk.so '$(DESTDIR_SQ)$(libdir_SQ)' endif -ifndef NO_LIBPERL - LIB_OBJS += $(OUTPUT)util/scripting-engines/trace-event-perl.o - LIB_OBJS += $(OUTPUT)scripts/perl/Perf-Trace-Util/Context.o -endif - -ifndef NO_LIBPYTHON - LIB_OBJS += $(OUTPUT)util/scripting-engines/trace-event-python.o - LIB_OBJS += $(OUTPUT)scripts/python/Perf-Trace-Util/Context.o -endif - ifeq ($(NO_PERF_REGS),0) ifeq ($(ARCH),x86) LIB_H += arch/x86/include/perf_regs.h
@@ -460,18 +450,6 @@ $(OUTPUT)%.o: %.S $(OUTPUT)%.s: %.S $(QUIET_CC)$(CC) -o $@ -E $(CFLAGS) $< -$(OUTPUT)util/scripting-engines/trace-event-perl.o: util/scripting-engines/trace-event-perl.c $(OUTPUT)PERF-CFLAGS - $(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) $(PERL_EMBED_CCOPTS) -Wno-redundant-decls -Wno-strict-prototypes -Wno-unused-parameter -Wno-shadow -Wno-undef -Wno-switch-default $< - -$(OUTPUT)scripts/perl/Perf-Trace-Util/Context.o: scripts/perl/Perf-Trace-Util/Context.c $(OUTPUT)PERF-CFLAGS - $(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) $(PERL_EMBED_CCOPTS) -Wno-redundant-decls -Wno-strict-prototypes -Wno-unused-parameter -Wno-nested-externs -Wno-undef -Wno-switch-default $< - -$(OUTPUT)util/scripting-engines/trace-event-python.o: util/scripting-engines/trace-event-python.c $(OUTPUT)PERF-CFLAGS - $(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) $(PYTHON_EMBED_CCOPTS) -Wno-redundant-decls -Wno-strict-prototypes -Wno-unused-parameter -Wno-shadow $< - -$(OUTPUT)scripts/python/Perf-Trace-Util/Context.o: scripts/python/Perf-Trace-Util/Context.c $(OUTPUT)PERF-CFLAGS - $(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) $(PYTHON_EMBED_CCOPTS) -Wno-redundant-decls -Wno-strict-prototypes -Wno-unused-parameter -Wno-nested-externs $< - $(OUTPUT)perf-%: %.o $(PERFLIBS) $(QUIET_LINK)$(CC) $(CFLAGS) -o $@ $(LDFLAGS) $(filter %.o,$^) $(LIBS)
tools/perf/config/Makefile +7 -0
@@ -512,6 +512,8 @@ else else LDFLAGS += $(PERL_EMBED_LDFLAGS) EXTLIBS += $(PERL_EMBED_LIBADD) + $(call detected,CONFIG_LIBPERL) + CONFIG_SCRIPT := y endif endif
@@ -571,6 +573,8 @@ else LDFLAGS += $(PYTHON_EMBED_LDFLAGS) EXTLIBS += $(PYTHON_EMBED_LIBADD) LANG_BINDINGS += $(obj-perf)python/perf.so + $(call detected,CONFIG_LIBPYTHON) + CONFIG_SCRIPT := y endif endif endif
@@ -840,3 +844,6 @@ $(call detected_var,ETC_PERFCONFIG_SQ) $(call detected_var,prefix_SQ) $(call detected_var,LIBDIR) $(call detected_var,GTK_CFLAGS) +$(call detected_var,PERL_EMBED_CCOPTS) +$(call detected_var,PYTHON_EMBED_CCOPTS) +$(call detected_var,CONFIG_SCRIPT)
tools/perf/scripts/Build new file +2 -0
@@ -0,0 +1,2 @@ +libperf-$(CONFIG_LIBPERL) += perl/Perf-Trace-Util/ +libperf-$(CONFIG_LIBPYTHON) += python/Perf-Trace-Util/
tools/perf/scripts/perl/Perf-Trace-Util/Build new file +3 -0
@@ -0,0 +1,3 @@ +libperf-y += Context.o + +CFLAGS_Context.o += $(PERL_EMBED_CCOPTS) -Wno-redundant-decls -Wno-strict-prototypes -Wno-unused-parameter -Wno-nested-externs -Wno-undef -Wno-switch-default
tools/perf/scripts/python/Perf-Trace-Util/Build new file +3 -0
@@ -0,0 +1,3 @@ +libperf-y += Context.o + +CFLAGS_Context.o += $(PYTHON_EMBED_CCOPTS) -Wno-redundant-decls -Wno-strict-prototypes -Wno-unused-parameter -Wno-nested-externs
tools/perf/util/Build +2 -0
@@ -88,6 +88,8 @@ libperf-$(CONFIG_DWARF) += dwarf-aux.o libperf-$(CONFIG_LIBDW_DWARF_UNWIND) += unwind-libdw.o libperf-$(CONFIG_LIBUNWIND) += unwind-libunwind.o +libperf-$(CONFIG_SCRIPT) += scripting-engines/ + CFLAGS_config.o += -DETC_PERFCONFIG="BUILD_STR($(ETC_PERFCONFIG_SQ))" CFLAGS_exec_cmd.o += -DPERF_EXEC_PATH="BUILD_STR($(perfexecdir_SQ))" -DPREFIX="BUILD_STR($(prefix_SQ))"
tools/perf/util/scripting-engines/Build new file +6 -0
@@ -0,0 +1,6 @@ +libperf-$(CONFIG_LIBPERL) += trace-event-perl.o +libperf-$(CONFIG_LIBPYTHON) += trace-event-python.o + +CFLAGS_trace-event-perl.o += $(PERL_EMBED_CCOPTS) -Wno-redundant-decls -Wno-strict-prototypes -Wno-unused-parameter -Wno-shadow -Wno-undef -Wno-switch-default + +CFLAGS_trace-event-python.o += $(PYTHON_EMBED_CCOPTS) -Wno-redundant-decls -Wno-strict-prototypes -Wno-unused-parameter -Wno-shadow
Signature · 1 line
1.9.3
Jiri Olsa
reviewerPATCH 15/30 perf build: Add perf regs objects building
In reply to Jiri OlsaMove the regs objects building under build framework to be included in the libperf build object.
--- tools/perf/Makefile.perf | 7 ------- tools/perf/config/Makefile | 4 ++++ tools/perf/util/Build | 2 ++ 3 files changed, 6 insertions(+), 7 deletions(-)
tools/perf/Makefile.perf +0 -7
@@ -349,13 +349,6 @@ install-gtk: $(OUTPUT)libperf-gtk.so $(INSTALL) $(OUTPUT)libperf-gtk.so '$(DESTDIR_SQ)$(libdir_SQ)' endif -ifeq ($(NO_PERF_REGS),0) - ifeq ($(ARCH),x86) - LIB_H += arch/x86/include/perf_regs.h - endif - LIB_OBJS += $(OUTPUT)util/perf_regs.o -endif - ifndef NO_ZLIB LIB_OBJS += $(OUTPUT)util/zlib.o endif
tools/perf/config/Makefile +4 -0
@@ -48,6 +48,10 @@ ifeq ($(ARCH),arm64) LIBUNWIND_LIBS = -lunwind -lunwind-aarch64 endif +ifeq ($(NO_PERF_REGS),0) +$(call detected,CONFIG_PERF_REGS) +endif + # So far there's only x86 and arm libdw unwind support merged in perf. # Disable it on all other architectures in case libdw unwind # support is detected in system. Add supported architectures
tools/perf/util/Build +2 -0
@@ -90,6 +90,8 @@ libperf-$(CONFIG_LIBUNWIND) += unwind-libunwind.o libperf-$(CONFIG_SCRIPT) += scripting-engines/ +libperf-$(CONFIG_PERF_REGS) += perf_regs.o + CFLAGS_config.o += -DETC_PERFCONFIG="BUILD_STR($(ETC_PERFCONFIG_SQ))" CFLAGS_exec_cmd.o += -DPERF_EXEC_PATH="BUILD_STR($(perfexecdir_SQ))" -DPREFIX="BUILD_STR($(prefix_SQ))"
Signature · 1 line
1.9.3
Jiri Olsa
reviewerPATCH 16/30 perf build: Add zlib objects building
In reply to Jiri OlsaMove the zlib objects building under build framework to be included in the libperf build object.
--- tools/perf/Makefile.perf | 4 ---- tools/perf/config/Makefile | 1 + tools/perf/util/Build | 1 + 3 files changed, 2 insertions(+), 4 deletions(-)
tools/perf/Makefile.perf +0 -4
@@ -349,10 +349,6 @@ install-gtk: $(OUTPUT)libperf-gtk.so $(INSTALL) $(OUTPUT)libperf-gtk.so '$(DESTDIR_SQ)$(libdir_SQ)' endif -ifndef NO_ZLIB - LIB_OBJS += $(OUTPUT)util/zlib.o -endif - ifdef ASCIIDOC8 export ASCIIDOC8 endif
tools/perf/config/Makefile +1 -0
@@ -636,6 +636,7 @@ ifndef NO_ZLIB ifeq ($(feature-zlib), 1) CFLAGS += -DHAVE_ZLIB_SUPPORT EXTLIBS += -lz + $(call detected,CONFIG_ZLIB) else NO_ZLIB := 1 endif
tools/perf/util/Build +1 -0
@@ -91,6 +91,7 @@ libperf-$(CONFIG_LIBUNWIND) += unwind-libunwind.o libperf-$(CONFIG_SCRIPT) += scripting-engines/ libperf-$(CONFIG_PERF_REGS) += perf_regs.o +libperf-$(CONFIG_ZLIB) += zlib.o CFLAGS_config.o += -DETC_PERFCONFIG="BUILD_STR($(ETC_PERFCONFIG_SQ))" CFLAGS_exec_cmd.o += -DPERF_EXEC_PATH="BUILD_STR($(perfexecdir_SQ))" -DPREFIX="BUILD_STR($(prefix_SQ))"
Signature · 1 line
1.9.3
Jiri Olsa
reviewerPATCH 17/30 perf build: Add perf.o object building
In reply to Jiri OlsaMove the perf object building under build framework to be included in the perf build object.
--- tools/perf/Build | 3 +++ tools/perf/Makefile.perf | 16 +++++----------- 2 files changed, 8 insertions(+), 11 deletions(-)
tools/perf/Build +3 -0
@@ -25,12 +25,15 @@ perf-$(CONFIG_LIBELF) += builtin-probe.o perf-y += bench/ perf-y += tests/ +perf-y += perf.o + paths += -DPERF_HTML_PATH="BUILD_STR($(htmldir_SQ))" paths += -DPERF_INFO_PATH="BUILD_STR($(infodir_SQ))" paths += -DPERF_MAN_PATH="BUILD_STR($(mandir_SQ))" CFLAGS_builtin-help.o += $(paths) CFLAGS_builtin-timechart.o += $(paths) +CFLAGS_perf.o += -DPERF_HTML_PATH="BUILD_STR($(htmldir_SQ))" -include $(OUTPUT)PERF-VERSION-FILE libperf-y += util/ libperf-y += arch/
tools/perf/Makefile.perf +5 -11
@@ -377,16 +377,11 @@ export OUTPUT RM CC LD CFLAGS V BISON FLEX build := -f Makefile.build dir=. obj -$(PERF_IN): FORCE +$(PERF_IN): $(OUTPUT)PERF-VERSION-FILE $(OUTPUT)common-cmds.h FORCE @$(MAKE) $(build)=perf -$(OUTPUT)perf.o: perf.c $(OUTPUT)common-cmds.h $(OUTPUT)PERF-CFLAGS - $(QUIET_CC)$(CC) -include $(OUTPUT)PERF-VERSION-FILE \ - '-DPERF_HTML_PATH="$(htmldir_SQ)"' \ - $(CFLAGS) -c $(filter %.c,$^) -o $@ - -$(OUTPUT)perf: $(OUTPUT)perf.o $(BUILTIN_OBJS) $(PERFLIBS) $(PERF_IN) - $(QUIET_LINK)$(CC) $(CFLAGS) $(LDFLAGS) $(OUTPUT)perf.o \ +$(OUTPUT)perf: $(BUILTIN_OBJS) $(PERFLIBS) $(PERF_IN) + $(QUIET_LINK)$(CC) $(CFLAGS) $(LDFLAGS) \ $(BUILTIN_OBJS) $(PERF_IN) $(LIBS) -o $@ $(GTK_IN): FORCE
@@ -404,8 +399,7 @@ $(SCRIPTS) : % : %.sh $(QUIET_GEN)$(INSTALL) '[email protected]' '$(OUTPUT)$@' # These can record PERF_VERSION -$(OUTPUT)perf.o perf.spec \ - $(SCRIPTS) \ +perf.spec $(SCRIPTS) \ : $(OUTPUT)PERF-VERSION-FILE .SUFFIXES:
@@ -660,7 +654,7 @@ config-clean: @$(MAKE) -C config/feature-checks clean >/dev/null clean: $(LIBTRACEEVENT)-clean $(LIBAPIKFS)-clean config-clean - $(call QUIET_CLEAN, core-objs) $(RM) $(LIB_OBJS) $(BUILTIN_OBJS) $(LIB_FILE) $(OUTPUT)perf-archive $(OUTPUT)perf-with-kcore $(OUTPUT)perf.o $(LANG_BINDINGS) + $(call QUIET_CLEAN, core-objs) $(RM) $(LIB_OBJS) $(BUILTIN_OBJS) $(LIB_FILE) $(OUTPUT)perf-archive $(OUTPUT)perf-with-kcore $(LANG_BINDINGS) @find $(if $(OUTPUT),$(OUTPUT),.) -name \*.o | xargs $(RM) @$(RM) .config-detected $(call QUIET_CLEAN, core-progs) $(RM) $(ALL_PROGRAMS) perf perf-read-vdso32 perf-read-vdsox32
Signature · 1 line
1.9.3
Jiri Olsa
reviewerPATCH 18/30 perf build: Add arch x86 objects building
In reply to Jiri OlsaMove the x86 arch objects building under build framework to be included in the libperf build object.
--- tools/perf/arch/Build | 1 + tools/perf/arch/arm/Build | 0 tools/perf/arch/arm64/Build | 0 tools/perf/arch/powerpc/Build | 0 tools/perf/arch/s390/Build | 0 tools/perf/arch/sh/Build | 0 tools/perf/arch/sparc/Build | 0 tools/perf/arch/x86/Build | 2 ++ tools/perf/arch/x86/Makefile | 15 --------------- tools/perf/arch/x86/tests/Build | 2 ++ tools/perf/arch/x86/util/Build | 8 ++++++++ 11 files changed, 13 insertions(+), 15 deletions(-) create mode 100644 tools/perf/arch/arm/Build create mode 100644 tools/perf/arch/arm64/Build create mode 100644 tools/perf/arch/powerpc/Build create mode 100644 tools/perf/arch/s390/Build create mode 100644 tools/perf/arch/sh/Build create mode 100644 tools/perf/arch/sparc/Build create mode 100644 tools/perf/arch/x86/Build create mode 100644 tools/perf/arch/x86/tests/Build create mode 100644 tools/perf/arch/x86/util/Build
tools/perf/arch/Build +1 -0
@@ -1 +1,2 @@ libperf-y += common.o +libperf-y += $(ARCH)/
tools/perf/arch/arm/Build new file +0 -0
tools/perf/arch/arm64/Build new file +0 -0
tools/perf/arch/powerpc/Build new file +0 -0
tools/perf/arch/s390/Build new file +0 -0
tools/perf/arch/sh/Build new file +0 -0
tools/perf/arch/sparc/Build new file +0 -0
tools/perf/arch/x86/Build new file +2 -0
@@ -0,0 +1,2 @@ +libperf-y += util/ +libperf-$(CONFIG_DWARF_UNWIND) += tests/
tools/perf/arch/x86/Makefile +0 -15
@@ -1,19 +1,4 @@ ifndef NO_DWARF PERF_HAVE_DWARF_REGS := 1 -LIB_OBJS += $(OUTPUT)arch/$(ARCH)/util/dwarf-regs.o endif -ifndef NO_LIBUNWIND -LIB_OBJS += $(OUTPUT)arch/$(ARCH)/util/unwind-libunwind.o -endif -ifndef NO_LIBDW_DWARF_UNWIND -LIB_OBJS += $(OUTPUT)arch/$(ARCH)/util/unwind-libdw.o -endif -ifndef NO_DWARF_UNWIND -LIB_OBJS += $(OUTPUT)arch/$(ARCH)/tests/regs_load.o -LIB_OBJS += $(OUTPUT)arch/$(ARCH)/tests/dwarf-unwind.o -endif -LIB_OBJS += $(OUTPUT)arch/$(ARCH)/util/header.o -LIB_OBJS += $(OUTPUT)arch/$(ARCH)/util/tsc.o -LIB_H += arch/$(ARCH)/util/tsc.h HAVE_KVM_STAT_SUPPORT := 1 -LIB_OBJS += $(OUTPUT)arch/$(ARCH)/util/kvm-stat.o
tools/perf/arch/x86/tests/Build new file +2 -0
@@ -0,0 +1,2 @@ +libperf-y += regs_load.o +libperf-y += dwarf-unwind.o
tools/perf/arch/x86/util/Build new file +8 -0
@@ -0,0 +1,8 @@ +libperf-y += header.o +libperf-y += tsc.o +libperf-y += kvm-stat.o + +libperf-$(CONFIG_DWARF) += dwarf-regs.o + +libperf-$(CONFIG_LIBUNWIND) += unwind-libunwind.o +libperf-$(CONFIG_LIBDW_DWARF_UNWIND) += unwind-libdw.o
Signature · 1 line
1.9.3
Jiri Olsa
reviewerPATCH 19/30 perf build: Add arch arm objects building
In reply to Jiri OlsaMove the arm arch objects building under build framework to be included in the libperf build object.
--- tools/perf/arch/arm/Build | 2 ++ tools/perf/arch/arm/Makefile | 11 ----------- tools/perf/arch/arm/tests/Build | 2 ++ tools/perf/arch/arm/util/Build | 4 ++++ 4 files changed, 8 insertions(+), 11 deletions(-) create mode 100644 tools/perf/arch/arm/tests/Build create mode 100644 tools/perf/arch/arm/util/Build
tools/perf/arch/arm/Build +2 -0
@@ -0,0 +1,2 @@ +libperf-y += util/ +libperf-$(CONFIG_DWARF_UNWIND) += tests/
tools/perf/arch/arm/Makefile +0 -11
@@ -1,14 +1,3 @@ ifndef NO_DWARF PERF_HAVE_DWARF_REGS := 1 -LIB_OBJS += $(OUTPUT)arch/$(ARCH)/util/dwarf-regs.o -endif -ifndef NO_LIBUNWIND -LIB_OBJS += $(OUTPUT)arch/$(ARCH)/util/unwind-libunwind.o -endif -ifndef NO_LIBDW_DWARF_UNWIND -LIB_OBJS += $(OUTPUT)arch/$(ARCH)/util/unwind-libdw.o -endif -ifndef NO_DWARF_UNWIND -LIB_OBJS += $(OUTPUT)arch/$(ARCH)/tests/regs_load.o -LIB_OBJS += $(OUTPUT)arch/$(ARCH)/tests/dwarf-unwind.o endif
tools/perf/arch/arm/tests/Build new file +2 -0
@@ -0,0 +1,2 @@ +libperf-y += regs_load.o +libperf-y += dwarf-unwind.o
tools/perf/arch/arm/util/Build new file +4 -0
@@ -0,0 +1,4 @@ +libperf-$(CONFIG_DWARF) += dwarf-regs.o + +libperf-$(CONFIG_LIBUNWIND) += unwind-libunwind.o +libperf-$(CONFIG_LIBDW_DWARF_UNWIND) += unwind-libdw.o
Signature · 1 line
1.9.3
Jiri Olsa
reviewerPATCH 20/30 perf build: Add arch arm64 objects building
In reply to Jiri OlsaMove the arm64 arch objects building under build framework to be included in the libperf build object.
--- tools/perf/arch/arm64/Build | 3 +++ tools/perf/arch/arm64/Makefile | 4 ---- tools/perf/arch/arm64/util/Build | 2 ++ 3 files changed, 5 insertions(+), 4 deletions(-) create mode 100644 tools/perf/arch/arm64/util/Build
tools/perf/arch/arm64/Build +3 -0
@@ -0,0 +1,3 @@ +ifneq ($(CONFIG_DWARF)$(CONFIG_LIBUNWIND),) +libperf-y += util/ +endif
tools/perf/arch/arm64/Makefile +0 -4
@@ -1,7 +1,3 @@ ifndef NO_DWARF PERF_HAVE_DWARF_REGS := 1 -LIB_OBJS += $(OUTPUT)arch/$(ARCH)/util/dwarf-regs.o -endif -ifndef NO_LIBUNWIND -LIB_OBJS += $(OUTPUT)arch/$(ARCH)/util/unwind-libunwind.o endif
tools/perf/arch/arm64/util/Build new file +2 -0
@@ -0,0 +1,2 @@ +libperf-$(CONFIG_DWARF) += dwarf-regs.o +libperf-$(CONFIG_LIBUNWIND) += unwind-libunwind.o
Signature · 1 line
1.9.3
Jiri Olsa
reviewerPATCH 21/30 perf build: Add arch powerpc objects building
In reply to Jiri OlsaMove the powerpc arch objects building under build framework to be included in the libperf build object.
--- tools/perf/arch/powerpc/Build | 1 + tools/perf/arch/powerpc/Makefile | 3 --- tools/perf/arch/powerpc/util/Build | 4 ++++ 3 files changed, 5 insertions(+), 3 deletions(-) create mode 100644 tools/perf/arch/powerpc/util/Build
tools/perf/arch/powerpc/Build +1 -0
@@ -0,0 +1 @@ +libperf-y += util/
tools/perf/arch/powerpc/Makefile +0 -3
@@ -1,6 +1,3 @@ ifndef NO_DWARF PERF_HAVE_DWARF_REGS := 1 -LIB_OBJS += $(OUTPUT)arch/$(ARCH)/util/dwarf-regs.o -LIB_OBJS += $(OUTPUT)arch/$(ARCH)/util/skip-callchain-idx.o endif -LIB_OBJS += $(OUTPUT)arch/$(ARCH)/util/header.o
tools/perf/arch/powerpc/util/Build new file +4 -0
@@ -0,0 +1,4 @@ +libperf-y += header.o + +libperf-$(CONFIG_DWARF) += dwarf-regs.o +libperf-$(CONFIG_DWARF) += skip-callchain-idx.o
Signature · 1 line
1.9.3
Jiri Olsa
reviewerPATCH 22/30 perf build: Add arch s390 objects building
In reply to Jiri OlsaMove the s390 arch objects building under build framework to be included in the libperf build object.
--- tools/perf/arch/s390/Build | 1 + tools/perf/arch/s390/Makefile | 3 --- tools/perf/arch/s390/util/Build | 4 ++++ 3 files changed, 5 insertions(+), 3 deletions(-) create mode 100644 tools/perf/arch/s390/util/Build
tools/perf/arch/s390/Build +1 -0
@@ -0,0 +1 @@ +libperf-y += util/
tools/perf/arch/s390/Makefile +0 -3
@@ -1,7 +1,4 @@ ifndef NO_DWARF PERF_HAVE_DWARF_REGS := 1 -LIB_OBJS += $(OUTPUT)arch/$(ARCH)/util/dwarf-regs.o endif -LIB_OBJS += $(OUTPUT)arch/$(ARCH)/util/header.o HAVE_KVM_STAT_SUPPORT := 1 -LIB_OBJS += $(OUTPUT)arch/$(ARCH)/util/kvm-stat.o
tools/perf/arch/s390/util/Build new file +4 -0
@@ -0,0 +1,4 @@ +libperf-y += header.o +libperf-y += kvm-stat.o + +libperf-$(CONFIG_DWARF) += dwarf-regs.o
Signature · 1 line
1.9.3
Jiri Olsa
reviewerPATCH 23/30 perf build: Add arch sh objects building
In reply to Jiri OlsaMove the sh arch objects building under build framework to be included in the libperf build object.
--- tools/perf/arch/sh/Build | 1 + tools/perf/arch/sh/Makefile | 1 - tools/perf/arch/sh/util/Build | 1 + 3 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 tools/perf/arch/sh/util/Build
tools/perf/arch/sh/Build +1 -0
@@ -0,0 +1 @@ +libperf-$(CONFIG_DWARF) += util/
tools/perf/arch/sh/Makefile +0 -1
@@ -1,4 +1,3 @@ ifndef NO_DWARF PERF_HAVE_DWARF_REGS := 1 -LIB_OBJS += $(OUTPUT)arch/$(ARCH)/util/dwarf-regs.o endif
tools/perf/arch/sh/util/Build new file +1 -0
@@ -0,0 +1 @@ +libperf-y += dwarf-regs.o
Signature · 1 line
1.9.3
Jiri Olsa
reviewerPATCH 24/30 perf build: Add arch sparc objects building
In reply to Jiri OlsaMove the sparc arch objects building under build framework to be included in the libperf build object.
--- tools/perf/arch/sparc/Build | 1 + tools/perf/arch/sparc/Makefile | 1 - tools/perf/arch/sparc/util/Build | 1 + 3 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 tools/perf/arch/sparc/util/Build
tools/perf/arch/sparc/Build +1 -0
@@ -0,0 +1 @@ +libperf-$(CONFIG_DWARF) += util/
tools/perf/arch/sparc/Makefile +0 -1
@@ -1,4 +1,3 @@ ifndef NO_DWARF PERF_HAVE_DWARF_REGS := 1 -LIB_OBJS += $(OUTPUT)arch/$(ARCH)/util/dwarf-regs.o endif
tools/perf/arch/sparc/util/Build new file +1 -0
@@ -0,0 +1 @@ +libperf-y += dwarf-regs.o
Signature · 1 line
1.9.3
Jiri Olsa
reviewerPATCH 25/30 perf build: Add single target build framework support
In reply to Jiri OlsaAdd support to build single targets, like:
$ make util/map.o # objects $ make util/map.i # preprocessor $ make util/map.s # assembly
--- tools/perf/Makefile.build | 20 +++++++++++++++++++- tools/perf/Makefile.perf | 39 ++++++++++++++++++++++++++++----------- tools/perf/util/Build | 7 +++++++ 3 files changed, 54 insertions(+), 12 deletions(-)
tools/perf/Makefile.build +19 -1
@@ -41,6 +41,12 @@ quiet_cmd_mkdir = MKDIR $(dir $@) quiet_cmd_cc_o_c = CC $@ cmd_cc_o_c = $(CC) $(c_flags) -c -o $@ $< +quiet_cmd_cc_i_c = CPP $@ + cmd_cc_i_c = $(CC) $(c_flags) -E -o $@ $< + +quiet_cmd_cc_s_c = AS $@ + cmd_cc_s_c = $(CC) $(c_flags) -S -o $@ $< + # Link agregate command quiet_cmd_ld_multi = LD $@ cmd_ld_multi = $(LD) -r -o $@ $^
@@ -54,6 +60,18 @@ $(OUTPUT)%.o: %.S FORCE $(call cmd_mkdir) $(call if_changed_dep,cc_o_c) +$(OUTPUT)%.i: %.c FORCE + $(call cmd_mkdir) + $(call if_changed_dep,cc_i_c) + +$(OUTPUT)%.i: %.S FORCE + $(call cmd_mkdir) + $(call if_changed_dep,cc_i_c) + +$(OUTPUT)%.s: %.c FORCE + $(call cmd_mkdir) + $(call if_changed_dep,cc_s_c) + # Gather build data: # obj-y - list of build objects # subdir-y - list of directories to nest
@@ -91,7 +109,7 @@ FORCE: # Include all cmd files to get all the dependency rules # for all objects included -targets := $(wildcard $(sort $(obj-y))) +targets := $(wildcard $(sort $(obj-y) $(MAKECMDGOALS))) cmd_files := $(wildcard $(foreach f,$(targets),$(dir $(f)).$(notdir $(f)).cmd)) ifneq ($(cmd_files),)
tools/perf/Makefile.perf +28 -11
@@ -422,16 +422,33 @@ endif # These two need to be here so that when O= is not used they take precedence # over the general rule for .o -$(OUTPUT)%.o: %.c $(OUTPUT)PERF-CFLAGS - $(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) $< -$(OUTPUT)%.i: %.c $(OUTPUT)PERF-CFLAGS - $(QUIET_CC)$(CC) -o $@ -E $(CFLAGS) $< -$(OUTPUT)%.s: %.c $(OUTPUT)PERF-CFLAGS - $(QUIET_CC)$(CC) -o $@ -S $(CFLAGS) $< -$(OUTPUT)%.o: %.S - $(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) $< -$(OUTPUT)%.s: %.S - $(QUIET_CC)$(CC) -o $@ -E $(CFLAGS) $< +# get relative building directory (to $(OUTPUT)) +# and '.' if it's $(OUTPUT) itself +__build-dir = $(subst $(OUTPUT),,$(dir $@)) +build-dir = $(if $(__build-dir),$(__build-dir),.) + +single_dep: $(OUTPUT)PERF-VERSION-FILE $(OUTPUT)common-cmds.h + +$(OUTPUT)%.o: %.c single_dep FORCE + @$(MAKE) -f Makefile.build dir=$(build-dir) $@ + +$(OUTPUT)%.i: %.c single_dep FORCE + @$(MAKE) -f Makefile.build dir=$(build-dir) $@ + +$(OUTPUT)%.s: %.c single_dep FORCE + @$(MAKE) -f Makefile.build dir=$(build-dir) $@ + +$(OUTPUT)%-bison.o: %.c single_dep FORCE + @$(MAKE) -f Makefile.build dir=$(build-dir) $@ + +$(OUTPUT)%-flex.o: %.c single_dep FORCE + @$(MAKE) -f Makefile.build dir=$(build-dir) $@ + +$(OUTPUT)%.o: %.S single_dep FORCE + @$(MAKE) -f Makefile.build dir=$(build-dir) $@ + +$(OUTPUT)%.i: %.S single_dep FORCE + @$(MAKE) -f Makefile.build dir=$(build-dir) $@ $(OUTPUT)perf-%: %.o $(PERFLIBS) $(QUIET_LINK)$(CC) $(CFLAGS) -o $@ $(LDFLAGS) $(filter %.o,$^) $(LIBS)
@@ -676,5 +693,5 @@ FORCE: .PHONY: all install clean config-clean strip install-gtk .PHONY: shell_compatibility_test please_set_SHELL_PATH_to_a_more_modern_shell -.PHONY: $(GIT-HEAD-PHONY) TAGS tags cscope .FORCE-PERF-CFLAGS FORCE +.PHONY: $(GIT-HEAD-PHONY) TAGS tags cscope .FORCE-PERF-CFLAGS FORCE single_dep
tools/perf/util/Build +7 -0
@@ -97,15 +97,19 @@ CFLAGS_config.o += -DETC_PERFCONFIG="BUILD_STR($(ETC_PERFCONFIG_SQ))" CFLAGS_exec_cmd.o += -DPERF_EXEC_PATH="BUILD_STR($(perfexecdir_SQ))" -DPREFIX="BUILD_STR($(prefix_SQ))" $(OUTPUT)util/parse-events-flex.c: util/parse-events.l $(OUTPUT)util/parse-events-bison.c + $(call cmd_mkdir) @$(call echo-cmd,bison)$(FLEX) -o $@ --header-file=$(OUTPUT)util/parse-events-flex.h $(PARSER_DEBUG_FLEX) util/parse-events.l $(OUTPUT)util/parse-events-bison.c: util/parse-events.y + $(call cmd_mkdir) @$(call echo-cmd,bison)$(BISON) -v util/parse-events.y -d $(PARSER_DEBUG_BISON) -o $(OUTPUT)util/parse-events-bison.c -p parse_events_ $(OUTPUT)util/pmu-flex.c: util/pmu.l $(OUTPUT)util/pmu-bison.c + $(call cmd_mkdir) @$(call echo-cmd,flex)$(FLEX) -o $@ --header-file=$(OUTPUT)util/pmu-flex.h util/pmu.l $(OUTPUT)util/pmu-bison.c: util/pmu.y + $(call cmd_mkdir) @$(call echo-cmd,bison)$(BISON) -v util/pmu.y -d -o $(OUTPUT)util/pmu-bison.c -p perf_pmu_ CFLAGS_parse-events-flex.o += -w
@@ -121,10 +125,13 @@ CFLAGS_rbtree.o += -Wno-unused-parameter -DETC_PERFCONFIG="BUILD_STR($(ET CFLAGS_parse-events.o += -Wno-redundant-decls $(OUTPUT)util/kallsyms.o: ../lib/symbol/kallsyms.c FORCE + $(call cmd_mkdir) $(call if_changed_dep,cc_o_c) $(OUTPUT)util/find_next_bit.o: ../lib/util/find_next_bit.c FORCE + $(call cmd_mkdir) $(call if_changed_dep,cc_o_c) $(OUTPUT)util/rbtree.o: ../../lib/rbtree.c FORCE + $(call cmd_mkdir) $(call if_changed_dep,cc_o_c)
Signature · 1 line
1.9.3
Jiri Olsa
reviewerPATCH 26/30 perf make: Remove directory dependency rules
In reply to Jiri OlsaRemoving subdirectories creation support from Makefile.perf as it's no longer needed, since it's properly handled by new build system.
--- tools/perf/Makefile.perf | 15 --------------- 1 file changed, 15 deletions(-)
tools/perf/Makefile.perf +0 -15
@@ -466,21 +466,6 @@ endif $(LIB_OBJS) $(BUILTIN_OBJS): $(LIB_H) $(patsubst perf-%,%.o,$(PROGRAMS)): $(LIB_H) $(wildcard */*.h) -# we compile into subdirectories. if the target directory is not the source directory, they might not exists. So -# we depend the various files onto their directories. -DIRECTORY_DEPS = $(LIB_OBJS) $(BUILTIN_OBJS) $(GTK_OBJS) -DIRECTORY_DEPS += $(OUTPUT)PERF-VERSION-FILE $(OUTPUT)common-cmds.h -# no need to add flex objects, because they depend on bison ones -DIRECTORY_DEPS += $(OUTPUT)util/parse-events-bison.c -DIRECTORY_DEPS += $(OUTPUT)util/pmu-bison.c - -OUTPUT_DIRECTORIES := $(sort $(dir $(DIRECTORY_DEPS))) - -$(DIRECTORY_DEPS): | $(OUTPUT_DIRECTORIES) -# In the second step, we make a rule to actually create these directories -$(OUTPUT_DIRECTORIES): - $(QUIET_MKDIR)$(MKDIR) -p $@ 2>/dev/null - LIBPERF_IN := $(OUTPUT)libperf-in.o $(LIBPERF_IN): FORCE
Signature · 1 line
1.9.3
Jiri Olsa
reviewerPATCH 27/30 perf make: Remove uneeded variables
In reply to Jiri OlsaRemoving uneeded variables from Makefile.perf:
BUILTIN_OBJS LIB_OBJS GTK_OBJS
- objects are now hold by in the build Makefiles
LIB_H
- header dependencies iare now handled by Build framework
--- tools/perf/Makefile.perf | 123 ++--------------------------------------------- 1 file changed, 5 insertions(+), 118 deletions(-)
tools/perf/Makefile.perf +5 -118
@@ -139,10 +139,6 @@ export prefix bindir sharedir sysconfdir DESTDIR SPARSE_FLAGS = -D__BIG_ENDIAN__ -D__powerpc__ # Guard against environment variables -BUILTIN_OBJS = -LIB_H = -LIB_OBJS = -GTK_OBJS = PYRF_OBJS = SCRIPT_SH =
@@ -220,113 +216,6 @@ export PERL_PATH LIB_FILE=$(OUTPUT)libperf.a -LIB_H += ../lib/symbol/kallsyms.h -LIB_H += ../../include/uapi/linux/perf_event.h -LIB_H += ../../include/linux/rbtree.h -LIB_H += ../../include/linux/list.h -LIB_H += ../../include/uapi/linux/const.h -LIB_H += ../include/linux/hash.h -LIB_H += ../../include/linux/stringify.h -LIB_H += util/include/linux/bitmap.h -LIB_H += ../include/linux/bitops.h -LIB_H += ../include/asm-generic/bitops/atomic.h -LIB_H += ../include/asm-generic/bitops/find.h -LIB_H += ../include/asm-generic/bitops/fls64.h -LIB_H += ../include/asm-generic/bitops/fls.h -LIB_H += ../include/asm-generic/bitops/__ffs.h -LIB_H += ../include/asm-generic/bitops/__fls.h -LIB_H += ../include/asm-generic/bitops.h -LIB_H += ../include/linux/compiler.h -LIB_H += ../include/linux/log2.h -LIB_H += util/include/linux/const.h -LIB_H += util/include/linux/ctype.h -LIB_H += util/include/linux/kernel.h -LIB_H += util/include/linux/list.h -LIB_H += ../include/linux/export.h -LIB_H += util/include/linux/poison.h -LIB_H += util/include/linux/rbtree.h -LIB_H += util/include/linux/rbtree_augmented.h -LIB_H += util/include/linux/string.h -LIB_H += ../include/linux/types.h -LIB_H += util/include/linux/linkage.h -LIB_H += util/include/asm/asm-offsets.h -LIB_H += ../include/asm/bug.h -LIB_H += util/include/asm/byteorder.h -LIB_H += util/include/asm/hweight.h -LIB_H += util/include/asm/swab.h -LIB_H += util/include/asm/system.h -LIB_H += util/include/asm/uaccess.h -LIB_H += util/include/dwarf-regs.h -LIB_H += util/include/asm/dwarf2.h -LIB_H += util/include/asm/cpufeature.h -LIB_H += util/include/asm/unistd_32.h -LIB_H += util/include/asm/unistd_64.h -LIB_H += perf.h -LIB_H += util/annotate.h -LIB_H += util/cache.h -LIB_H += util/callchain.h -LIB_H += util/build-id.h -LIB_H += util/db-export.h -LIB_H += util/debug.h -LIB_H += util/pmu.h -LIB_H += util/event.h -LIB_H += util/evsel.h -LIB_H += util/evlist.h -LIB_H += util/exec_cmd.h -LIB_H += util/find-vdso-map.c -LIB_H += util/levenshtein.h -LIB_H += util/machine.h -LIB_H += util/map.h -LIB_H += util/parse-options.h -LIB_H += util/parse-events.h -LIB_H += util/quote.h -LIB_H += util/util.h -LIB_H += util/xyarray.h -LIB_H += util/header.h -LIB_H += util/help.h -LIB_H += util/session.h -LIB_H += util/ordered-events.h -LIB_H += util/strbuf.h -LIB_H += util/strlist.h -LIB_H += util/strfilter.h -LIB_H += util/svghelper.h -LIB_H += util/tool.h -LIB_H += util/run-command.h -LIB_H += util/sigchain.h -LIB_H += util/dso.h -LIB_H += util/symbol.h -LIB_H += util/color.h -LIB_H += util/values.h -LIB_H += util/sort.h -LIB_H += util/hist.h -LIB_H += util/comm.h -LIB_H += util/thread.h -LIB_H += util/thread_map.h -LIB_H += util/trace-event.h -LIB_H += util/probe-finder.h -LIB_H += util/dwarf-aux.h -LIB_H += util/probe-event.h -LIB_H += util/pstack.h -LIB_H += util/cpumap.h -LIB_H += util/top.h -LIB_H += $(ARCH_INCLUDE) -LIB_H += util/cgroup.h -LIB_H += $(LIB_INCLUDE)traceevent/event-parse.h -LIB_H += util/target.h -LIB_H += util/rblist.h -LIB_H += util/intlist.h -LIB_H += util/perf_regs.h -LIB_H += util/unwind.h -LIB_H += util/vdso.h -LIB_H += util/tsc.h -LIB_H += ui/helpline.h -LIB_H += ui/progress.h -LIB_H += ui/util.h -LIB_H += ui/ui.h -LIB_H += util/data.h -LIB_H += util/kvm-stat.h -LIB_H += util/thread-stack.h - PERFLIBS = $(LIB_FILE) $(LIBAPIKFS) $(LIBTRACEEVENT) # We choose to avoid "if .. else if .. else .. endif endif"
@@ -380,9 +269,8 @@ build := -f Makefile.build dir=. obj $(PERF_IN): $(OUTPUT)PERF-VERSION-FILE $(OUTPUT)common-cmds.h FORCE @$(MAKE) $(build)=perf -$(OUTPUT)perf: $(BUILTIN_OBJS) $(PERFLIBS) $(PERF_IN) - $(QUIET_LINK)$(CC) $(CFLAGS) $(LDFLAGS) \ - $(BUILTIN_OBJS) $(PERF_IN) $(LIBS) -o $@ +$(OUTPUT)perf: $(PERFLIBS) $(PERF_IN) + $(QUIET_LINK)$(CC) $(CFLAGS) $(LDFLAGS) $(PERF_IN) $(LIBS) -o $@ $(GTK_IN): FORCE @$(MAKE) $(build)=gtk
@@ -463,15 +351,14 @@ $(OUTPUT)perf-read-vdsox32: perf-read-vdso.c util/find-vdso-map.c $(QUIET_CC)$(CC) -mx32 $(filter -static,$(LDFLAGS)) -Wall -Werror -o $@ perf-read-vdso.c endif -$(LIB_OBJS) $(BUILTIN_OBJS): $(LIB_H) -$(patsubst perf-%,%.o,$(PROGRAMS)): $(LIB_H) $(wildcard */*.h) +$(patsubst perf-%,%.o,$(PROGRAMS)): $(wildcard */*.h) LIBPERF_IN := $(OUTPUT)libperf-in.o $(LIBPERF_IN): FORCE @$(MAKE) $(build)=libperf -$(LIB_FILE): $(LIB_OBJS) $(LIBPERF_IN) +$(LIB_FILE): $(LIBPERF_IN) $(QUIET_AR)$(RM) $@ && $(AR) rcs $@ $(LIBPERF_IN) $(LIB_OBJS) # libtraceevent.a
@@ -656,7 +543,7 @@ config-clean: @$(MAKE) -C config/feature-checks clean >/dev/null clean: $(LIBTRACEEVENT)-clean $(LIBAPIKFS)-clean config-clean - $(call QUIET_CLEAN, core-objs) $(RM) $(LIB_OBJS) $(BUILTIN_OBJS) $(LIB_FILE) $(OUTPUT)perf-archive $(OUTPUT)perf-with-kcore $(LANG_BINDINGS) + $(call QUIET_CLEAN, core-objs) $(RM) $(LIB_FILE) $(OUTPUT)perf-archive $(OUTPUT)perf-with-kcore $(LANG_BINDINGS) @find $(if $(OUTPUT),$(OUTPUT),.) -name \*.o | xargs $(RM) @$(RM) .config-detected $(call QUIET_CLEAN, core-progs) $(RM) $(ALL_PROGRAMS) perf perf-read-vdso32 perf-read-vdsox32
Signature · 1 line
1.9.3
Jiri Olsa
reviewerPATCH 28/30 perf make: Remove PERF-CFLAGS file
In reply to Jiri OlsaRemoving PERF-CFLAGS file, because the build framework stores full build command line for each object and triggers rebuilt if necessary.
--- tools/perf/Makefile.perf | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-)
tools/perf/Makefile.perf +3 -14
@@ -368,7 +368,7 @@ LIBTRACEEVENT_FLAGS = $(QUIET_SUBDIR1) O=$(OUTPUT) LIBTRACEEVENT_FLAGS += CFLAGS="-g -Wall $(EXTRA_CFLAGS)" LIBTRACEEVENT_FLAGS += plugin_dir=$(plugindir_SQ) -$(LIBTRACEEVENT): $(TE_SOURCES) $(OUTPUT)PERF-CFLAGS +$(LIBTRACEEVENT): $(TE_SOURCES) $(QUIET_SUBDIR0)$(TRACE_EVENT_DIR) $(LIBTRACEEVENT_FLAGS) libtraceevent.a plugins $(LIBTRACEEVENT)-clean:
@@ -447,17 +447,6 @@ cscope: $(QUIET_GEN)$(RM) cscope*; \ $(FIND) $(TAG_FOLDERS) -name '*.[hcS]' -print | xargs cscope -b $(TAG_FILES) -### Detect prefix changes -TRACK_CFLAGS = $(subst ','\'',$(CFLAGS)):\ - $(bindir_SQ):$(perfexecdir_SQ):$(template_dir_SQ):$(prefix_SQ):$(plugindir_SQ) - -$(OUTPUT)PERF-CFLAGS: .FORCE-PERF-CFLAGS - @FLAGS='$(TRACK_CFLAGS)'; \ - if test x"$$FLAGS" != x"`cat $(OUTPUT)PERF-CFLAGS 2>/dev/null`" ; then \ - echo 1>&2 " FLAGS: * new build flags or prefix"; \ - echo "$$FLAGS" >$(OUTPUT)PERF-CFLAGS; \ - fi - ### Testing rules # GNU make supports exporting all variables by "export" without parameters.
@@ -547,7 +536,7 @@ clean: $(LIBTRACEEVENT)-clean $(LIBAPIKFS)-clean config-clean @find $(if $(OUTPUT),$(OUTPUT),.) -name \*.o | xargs $(RM) @$(RM) .config-detected $(call QUIET_CLEAN, core-progs) $(RM) $(ALL_PROGRAMS) perf perf-read-vdso32 perf-read-vdsox32 - $(call QUIET_CLEAN, core-gen) $(RM) *.spec *.pyc *.pyo */*.pyc */*.pyo $(OUTPUT)common-cmds.h TAGS tags cscope* $(OUTPUT)PERF-VERSION-FILE $(OUTPUT)PERF-CFLAGS $(OUTPUT)PERF-FEATURES $(OUTPUT)util/*-bison* $(OUTPUT)util/*-flex* + $(call QUIET_CLEAN, core-gen) $(RM) *.spec *.pyc *.pyo */*.pyc */*.pyo $(OUTPUT)common-cmds.h TAGS tags cscope* $(OUTPUT)PERF-VERSION-FILE $(OUTPUT)PERF-FEATURES $(OUTPUT)util/*-bison* $(OUTPUT)util/*-flex* $(QUIET_SUBDIR0)Documentation $(QUIET_SUBDIR1) clean $(python-clean)
@@ -565,5 +554,5 @@ FORCE: .PHONY: all install clean config-clean strip install-gtk .PHONY: shell_compatibility_test please_set_SHELL_PATH_to_a_more_modern_shell -.PHONY: $(GIT-HEAD-PHONY) TAGS tags cscope .FORCE-PERF-CFLAGS FORCE single_dep +.PHONY: $(GIT-HEAD-PHONY) TAGS tags cscope FORCE single_dep
Signature · 1 line
1.9.3
Jiri Olsa
reviewerPATCH 29/30 perf tools: Add support to configure builtin commands inclusion
In reply to Jiri OlsaNOTE: hack
Adding support to configure builtin commands inclusion in the build, so we could later disable particular builtin command.
--- tools/perf/Build | 53 ++++++++++++++++++++----------------- tools/perf/Makefile.build | 3 +++ tools/perf/Makefile.perf | 7 +++-- tools/perf/builtin-cmds.h | 29 ++++++++++++++++++++ tools/perf/builtin-help.c | 1 + tools/perf/config.default | 23 ++++++++++++++++ tools/perf/perf.c | 1 + tools/perf/util/generate-cmdlist.sh | 10 +++++++ 8 files changed, 101 insertions(+), 26 deletions(-) create mode 100644 tools/perf/builtin-cmds.h create mode 100644 tools/perf/config.default
tools/perf/Build +29 -24
@@ -1,29 +1,34 @@ -perf-y += builtin-bench.o -perf-y += builtin-annotate.o -perf-y += builtin-diff.o -perf-y += builtin-evlist.o -perf-y += builtin-help.o -perf-y += builtin-sched.o -perf-y += builtin-buildid-list.o -perf-y += builtin-buildid-cache.o -perf-y += builtin-list.o -perf-y += builtin-record.o -perf-y += builtin-report.o -perf-y += builtin-stat.o -perf-y += builtin-timechart.o -perf-y += builtin-top.o -perf-y += builtin-script.o -perf-y += builtin-kmem.o -perf-y += builtin-lock.o -perf-y += builtin-kvm.o -perf-y += builtin-inject.o -perf-y += builtin-mem.o - -perf-$(CONFIG_AUDIT) += builtin-trace.o -perf-$(CONFIG_LIBELF) += builtin-probe.o +perf-$(CONFIG_BUILTIN_BENCH) += builtin-bench.o +perf-$(CONFIG_BUILTIN_ANNOTATE) += builtin-annotate.o +perf-$(CONFIG_BUILTIN_DIFF) += builtin-diff.o +perf-$(CONFIG_BUILTIN_EVLIST) += builtin-evlist.o +perf-$(CONFIG_BUILTIN_HELP) += builtin-help.o +perf-$(CONFIG_BUILTIN_SCHED) += builtin-sched.o +perf-$(CONFIG_BUILTIN_BUILDID_LIST) += builtin-buildid-list.o +perf-$(CONFIG_BUILTIN_BUILDID_CACHE) += builtin-buildid-cache.o +perf-$(CONFIG_BUILTIN_LIST) += builtin-list.o +perf-$(CONFIG_BUILTIN_RECORD) += builtin-record.o +perf-$(CONFIG_BUILTIN_REPORT) += builtin-report.o +perf-$(CONFIG_BUILTIN_STAT) += builtin-stat.o +perf-$(CONFIG_BUILTIN_TIMECHART) += builtin-timechart.o +perf-$(CONFIG_BUILTIN_TOP) += builtin-top.o +perf-$(CONFIG_BUILTIN_SCRIPT) += builtin-script.o +perf-$(CONFIG_BUILTIN_KMEM) += builtin-kmem.o +perf-$(CONFIG_BUILTIN_LOCK) += builtin-lock.o +perf-$(CONFIG_BUILTIN_KVM) += builtin-kvm.o +perf-$(CONFIG_BUILTIN_INJECT) += builtin-inject.o +perf-$(CONFIG_BUILTIN_MEM) += builtin-mem.o + +ifeq ($(CONFIG_AUDIT),y) +perf-$(CONFIG_BUILTIN_TRACE) += builtin-trace.o +endif + +ifeq ($(CONFIG_LIBELF),y) +perf-$(CONFIG_BUILTIN_PROBE) += builtin-probe.o +endif perf-y += bench/ -perf-y += tests/ +perf-$(CONFIG_BUILTIN_TEST) += tests/ perf-y += perf.o
tools/perf/Makefile.build +3 -0
@@ -18,6 +18,9 @@ include Build.include # do not force detected configuration -include .config-detected +# do not force user's configuration +-include .config-user + # Init all relevant variables used in build files so # 1) they have correct type # 2) they do not inherit any value from the environment
tools/perf/Makefile.perf +5 -2
@@ -250,7 +250,10 @@ export INSTALL SHELL_PATH SHELL = $(SHELL_PATH) -all: shell_compatibility_test $(ALL_PROGRAMS) $(LANG_BINDINGS) $(OTHER_PROGRAMS) +config_def: + @cp config.default .config-user + +all: config_def shell_compatibility_test $(ALL_PROGRAMS) $(LANG_BINDINGS) $(OTHER_PROGRAMS) please_set_SHELL_PATH_to_a_more_modern_shell: @$$(:)
@@ -554,5 +557,5 @@ FORCE: .PHONY: all install clean config-clean strip install-gtk .PHONY: shell_compatibility_test please_set_SHELL_PATH_to_a_more_modern_shell -.PHONY: $(GIT-HEAD-PHONY) TAGS tags cscope FORCE single_dep +.PHONY: $(GIT-HEAD-PHONY) TAGS tags cscope FORCE single_dep config_def
tools/perf/builtin-cmds.h new file +29 -0
@@ -0,0 +1,29 @@ +#ifndef BUILTIN_CMDS_H +#define BUILTIN_CMDS_H + +#define CONFIG_BUILTIN_REPORT +#define CONFIG_BUILTIN_SCRIPT +#define CONFIG_BUILTIN_BENCH +#define CONFIG_BUILTIN_SCHED +#define CONFIG_BUILTIN_TRACE +#define CONFIG_BUILTIN_TOP +#define CONFIG_BUILTIN_RECORD +#define CONFIG_BUILTIN_BUILDID_LIST +#define CONFIG_BUILTIN_INJECT +#define CONFIG_BUILTIN_LOCK +#define CONFIG_BUILTIN_KVM +#define CONFIG_BUILTIN_BUILDID_CACHE +#define CONFIG_BUILTIN_EVLIST +#define CONFIG_BUILTIN_KMEM +#define CONFIG_BUILTIN_STAT +#define CONFIG_BUILTIN_DIFF +#define CONFIG_BUILTIN_ANNOTATE +#define CONFIG_BUILTIN_TIMECHART +#define CONFIG_BUILTIN_LIST +#define CONFIG_BUILTIN_HELP +#define CONFIG_BUILTIN_PROBE +#define CONFIG_BUILTIN_MEM +#define CONFIG_BUILTIN_TEST + +#endif /* BUILTIN_CMDS_H */ +
tools/perf/builtin-help.c +1 -0
@@ -6,6 +6,7 @@#include "perf.h" #include "util/cache.h" #include "builtin.h" +#include "builtin-cmds.h" #include "util/exec_cmd.h" #include "common-cmds.h" #include "util/parse-options.h"
tools/perf/config.default new file +23 -0
@@ -0,0 +1,23 @@ +CONFIG_BUILTIN_BENCH := y +CONFIG_BUILTIN_ANNOTATE := y +CONFIG_BUILTIN_DIFF := y +CONFIG_BUILTIN_EVLIST := y +CONFIG_BUILTIN_HELP := y +CONFIG_BUILTIN_SCHED := y +CONFIG_BUILTIN_BUILDID_LIST := y +CONFIG_BUILTIN_BUILDID_CACHE := y +CONFIG_BUILTIN_LIST := y +CONFIG_BUILTIN_RECORD := y +CONFIG_BUILTIN_REPORT := y +CONFIG_BUILTIN_STAT := y +CONFIG_BUILTIN_TIMECHART := y +CONFIG_BUILTIN_TOP := y +CONFIG_BUILTIN_SCRIPT := y +CONFIG_BUILTIN_KMEM := y +CONFIG_BUILTIN_LOCK := y +CONFIG_BUILTIN_KVM := y +CONFIG_BUILTIN_INJECT := y +CONFIG_BUILTIN_MEM := y +CONFIG_BUILTIN_TRACE := y +CONFIG_BUILTIN_PROBE := y +CONFIG_BUILTIN_TEST := y
tools/perf/perf.c +1 -0
@@ -7,6 +7,7 @@* perf top, perf record, perf report, etc.) are started. */ #include "builtin.h" +#include "builtin-cmds.h" #include "util/exec_cmd.h" #include "util/cache.h"
tools/perf/util/generate-cmdlist.sh +10 -0
@@ -1,5 +1,11 @@ #!/bin/sh +function cfg() +{ + cfg=`echo $1 | tr '[:lower:]' '[:upper:]' | sed 's/-/_/g'` + echo "$cfg" +} + echo "/* Automatically generated by $0 */ struct cmdname_help {
@@ -13,6 +19,7 @@ sed -n -e 's/^perf-\([^ ]*\)[ ].* common.*/\1/p' command-list.txt | sort | while read cmd do + echo "#ifdef CONFIG_BUILTIN_$(cfg $cmd)" sed -n ' /^NAME/,/perf-'"$cmd"'/H ${
@@ -20,6 +27,7 @@ do s/.*perf-'"$cmd"' - \(.*\)/ {"'"$cmd"'", "\1"},/ p }' "Documentation/perf-$cmd.txt" + echo "#endif" done echo "#ifdef HAVE_LIBELF_SUPPORT"
@@ -27,6 +35,7 @@ sed -n -e 's/^perf-\([^ ]*\)[ ].* full.*/\1/p' command-list.txt | sort | while read cmd do + echo "#ifdef CONFIG_BUILTIN_$(cfg $cmd)" sed -n ' /^NAME/,/perf-'"$cmd"'/H ${
@@ -34,6 +43,7 @@ do s/.*perf-'"$cmd"' - \(.*\)/ {"'"$cmd"'", "\1"},/ p }' "Documentation/perf-$cmd.txt" + echo "#endif" done echo "#endif /* HAVE_LIBELF_SUPPORT */" echo "};"
Signature · 1 line
1.9.3
Namhyung Kim
maintainerRe: [PATCH 29/30] perf tools: Add support to configure builtin commands inclusion
Quoted 79 lines · Jiri Olsa
NOTE: hack
Adding support to configure builtin commands inclusion in the build, so we could later disable particular builtin command.
Signed-off-by Jiri Olsa <[email protected]>Cc Alexis Berlemont <[email protected]>Cc Arnaldo Carvalho de Melo <[email protected]>Cc Borislav Petkov <[email protected]>Cc Corey Ashford <[email protected]>Cc David Ahern <[email protected]>Cc Frederic Weisbecker <[email protected]>Cc Ingo Molnar <[email protected]>Cc Namhyung Kim <[email protected]>Cc Paul Mackerras <[email protected]>Cc Peter Zijlstra <[email protected]>Cc Stephane Eranian <[email protected]>--- tools/perf/Build | 53 ++++++++++++++++++++----------------- tools/perf/Makefile.build | 3 +++ tools/perf/Makefile.perf | 7 +++-- tools/perf/builtin-cmds.h | 29 ++++++++++++++++++++ tools/perf/builtin-help.c | 1 + tools/perf/config.default | 23 ++++++++++++++++ tools/perf/perf.c | 1 + tools/perf/util/generate-cmdlist.sh | 10 +++++++ 8 files changed, 101 insertions(+), 26 deletions(-) create mode 100644 tools/perf/builtin-cmds.h create mode 100644 tools/perf/config.defaulttools/perf/Build +20
-23@@ -1,29 +1,34 @@ -perf-y += builtin-bench.o -perf-y += builtin-annotate.o -perf-y += builtin-diff.o -perf-y += builtin-evlist.o -perf-y += builtin-help.o -perf-y += builtin-sched.o -perf-y += builtin-buildid-list.o -perf-y += builtin-buildid-cache.o -perf-y += builtin-list.o -perf-y += builtin-record.o -perf-y += builtin-report.o -perf-y += builtin-stat.o -perf-y += builtin-timechart.o -perf-y += builtin-top.o -perf-y += builtin-script.o -perf-y += builtin-kmem.o -perf-y += builtin-lock.o -perf-y += builtin-kvm.o -perf-y += builtin-inject.o -perf-y += builtin-mem.o - -perf-$(CONFIG_AUDIT) += builtin-trace.o -perf-$(CONFIG_LIBELF) += builtin-probe.o +perf-$(CONFIG_BUILTIN_BENCH) += builtin-bench.o +perf-$(CONFIG_BUILTIN_ANNOTATE) += builtin-annotate.o +perf-$(CONFIG_BUILTIN_DIFF) += builtin-diff.o +perf-$(CONFIG_BUILTIN_EVLIST) += builtin-evlist.o +perf-$(CONFIG_BUILTIN_HELP) += builtin-help.o +perf-$(CONFIG_BUILTIN_SCHED) += builtin-sched.o +perf-$(CONFIG_BUILTIN_BUILDID_LIST) += builtin-buildid-list.o +perf-$(CONFIG_BUILTIN_BUILDID_CACHE) += builtin-buildid-cache.o +perf-$(CONFIG_BUILTIN_LIST) += builtin-list.o +perf-$(CONFIG_BUILTIN_RECORD) += builtin-record.o +perf-$(CONFIG_BUILTIN_REPORT) += builtin-report.o +perf-$(CONFIG_BUILTIN_STAT) += builtin-stat.o +perf-$(CONFIG_BUILTIN_TIMECHART) += builtin-timechart.o +perf-$(CONFIG_BUILTIN_TOP) += builtin-top.o +perf-$(CONFIG_BUILTIN_SCRIPT) += builtin-script.o +perf-$(CONFIG_BUILTIN_KMEM) += builtin-kmem.o +perf-$(CONFIG_BUILTIN_LOCK) += builtin-lock.o +perf-$(CONFIG_BUILTIN_KVM) += builtin-kvm.o +perf-$(CONFIG_BUILTIN_INJECT) += builtin-inject.o +perf-$(CONFIG_BUILTIN_MEM) += builtin-mem.o
tools/perf/Build line 30
Quoted 10 lines
tools/perf/Build +8
-0+ +ifeq ($(CONFIG_AUDIT),y) +perf-$(CONFIG_BUILTIN_TRACE) += builtin-trace.o +endif + +ifeq ($(CONFIG_LIBELF),y) +perf-$(CONFIG_BUILTIN_PROBE) += builtin-probe.o +endif perf-y += bench/
I guess it also needs to be changed like below?
perf-$(CONFIG_BUILTIN_BENCH) += bench/
Thanks,
Namhyung
Quoted 4 lines
tools/perf/Build +1
-1-perf-y += tests/ +perf-$(CONFIG_BUILTIN_TEST) += tests/ perf-y += perf.o
Re: [PATCH 29/30] perf tools: Add support to configure builtin commands inclusion
On Thu, Jan 08, 2015 at 04:15:27PM +0900, Namhyung Kim wrote:
SNIP
Quoted 12 lines
Quoted 12 lines
tools/perf/Build +11
-0+perf-$(CONFIG_BUILTIN_KVM) += builtin-kvm.o +perf-$(CONFIG_BUILTIN_INJECT) += builtin-inject.o +perf-$(CONFIG_BUILTIN_MEM) += builtin-mem.o + +ifeq ($(CONFIG_AUDIT),y) +perf-$(CONFIG_BUILTIN_TRACE) += builtin-trace.o +endif + +ifeq ($(CONFIG_LIBELF),y) +perf-$(CONFIG_BUILTIN_PROBE) += builtin-probe.o +endif
Quoted 6 lines
Quoted 1 line
perf-y += bench/
I guess it also needs to be changed like below?
perf-$(CONFIG_BUILTIN_BENCH) += bench/
right, thanks
jirka
Jiri Olsa
reviewerPATCH 30/30 perf tools: Disable test code
In reply to Jiri OlsaNOTE: hack
Forcing test objects not to be compiled into perf code. This saves almost 1MB of perf binary size on my setup:
# standard perf binary $ ls -l perf -rwxrwxr-x 1 jolsa jolsa 10283684 Jan 1 15:52 perf
# current perf binary $ ls -l perf -rwxrwxr-x 1 jolsa jolsa 9303174 Jan 1 15:58 perf
--- tools/perf/builtin-cmds.h | 2 +- tools/perf/config.default | 2 +- tools/perf/perf-sys.h | 2 +- tools/perf/perf.c | 4 ++++ 4 files changed, 7 insertions(+), 3 deletions(-)
tools/perf/builtin-cmds.h +1 -1
@@ -23,7 +23,7 @@#define CONFIG_BUILTIN_HELP #define CONFIG_BUILTIN_PROBE #define CONFIG_BUILTIN_MEM -#define CONFIG_BUILTIN_TEST +//#define CONFIG_BUILTIN_TEST #endif /* BUILTIN_CMDS_H */
tools/perf/config.default +1 -1
@@ -20,4 +20,4 @@ CONFIG_BUILTIN_INJECT := y CONFIG_BUILTIN_MEM := y CONFIG_BUILTIN_TRACE := y CONFIG_BUILTIN_PROBE := y -CONFIG_BUILTIN_TEST := y +CONFIG_BUILTIN_TEST := n
tools/perf/perf-sys.h +1 -1
@@ -181,7 +181,7 @@ sys_perf_event_open(struct perf_event_attr *attr, fd =syscall (__NR_perf_event_open, attr, pid, cpu, group_fd, flags); -#ifdef HAVE_ATTR_TEST +#if defined(CONFIG_BUILTIN_TEST ) && defined(HAVE_ATTR_TEST )if (unlikely (test_attr__enabled))test_attr__open (attr, pid, cpu, fd, group_fd, flags);#endif
tools/perf/perf.c +4 -0
@@ -57,7 +57,9 @@ static struct cmd_struct commands[] = { { "kmem", cmd_kmem, 0 }, { "lock", cmd_lock, 0 }, { "kvm", cmd_kvm, 0 }, +#ifdef CONFIG_BUILTIN_TEST { "test", cmd_test, 0 }, +#endif #ifdef HAVE_LIBAUDIT_SUPPORT { "trace", cmd_trace, 0 }, #endif
@@ -539,7 +541,9 @@ int main(int argc, const char **argv) } cmd = argv[0 ]; +#ifdef CONFIG_BUILTIN_TEST test_attr__init (); +#endif /* * We use PATH to find perf commands, but we prepend some higher
Signature · 1 line
1.9.3
Re: [PATCH 30/30] perf tools: Disable test code
Quoted 5 lines · Jiri Olsa
NOTE: hack
Forcing test objects not to be compiled into perf code. This saves almost 1MB of perf binary size on my setup:
Quoted 7 lines
# standard perf binary $ ls -l perf -rwxrwxr-x 1 jolsa jolsa 10283684 Jan 1 15:52 perf# current perf binary $ ls -l perf -rwxrwxr-x 1 jolsa jolsa 9303174 Jan 1 15:58 perf
nice. I had done the same locally; never got around to pushing that patch upstream.
https://github.com/dsahern/linux/commit/20b85d1cbf5c46a5d9966bfcb7c0dbcb8f0cc8d0
David
Quoted 10 lines · Jiri Olsa
[...] The basic idea is the same as in kbuild system, with some minor changes to allow for multiple binaries build definitions.
tools/perf/Build | 48 ++ tools/perf/Build.include | 75 ++++ tools/perf/Documentation/Build | 123 +++++ tools/perf/Makefile.build | 122 +++++ tools/perf/Makefile.perf | 566 +++---------------------47 files changed, 827 insertions(+), 541 deletions(-)
Even the diffstat looks pretty good: only a modest line count increase.
It would be useful to put this (and other build features - such as features/parallelisation support) into tools/kbuild/ though, so that other tooling can make easy use of it as well. For example tools/kvm/ (an external project) started off with an earlier version of the perf build system.
Sharing that would make quite a bit of sense, as tooling (and most user-space project) build systems are usually have pretty poor quality.
Thanks,
Ingo
Quoted 14 lines · Ingo Molnar
Quoted 10 lines · Jiri Olsa
[...] The basic idea is the same as in kbuild system, with some minor changes to allow for multiple binaries build definitions.
tools/perf/Build | 48 ++ tools/perf/Build.include | 75 ++++ tools/perf/Documentation/Build | 123 +++++ tools/perf/Makefile.build | 122 +++++ tools/perf/Makefile.perf | 566 +++---------------------47 files changed, 827 insertions(+), 541 deletions(-)
Quoted 8 lines
Even the diffstat looks pretty good: only a modest line count increase.
It would be useful to put this (and other build features - such as features/parallelisation support) into
tools/kbuild/though, so that other tooling can make easy use of it as well. For exampletools/kvm/(an external project) started off with an earlier version of the perf build system.
right, I'll put it in tools/build.. looks like the tools/lib/* could use it, probably others as well
thanks,
jirka
Quoted 8 lines
Sharing that would make quite a bit of sense, as tooling (and most user-space project) build systems are usually have pretty poor quality.
Thanks,
Ingo