aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJiri Olsa <jolsa@kernel.org>2014-12-29 09:03:09 -0500
committerArnaldo Carvalho de Melo <acme@redhat.com>2015-02-12 09:40:32 -0500
commitf39e042a133485e4b1aa73d3bc2249d01421f765 (patch)
treeebda0890d0cd2d8ceb758afb105c7a04f2875ebb
parent72965b87c5d5d15e33c620901b46c5ca1a3d6b8b (diff)
perf build: Add tests objects building
Move test objects building under build framework. Signed-off-by: Jiri Olsa <jolsa@kernel.org> Tested-by: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com> Tested-by: Will Deacon <will.deacon@arm.com> Cc: Alexis Berlemont <alexis.berlemont@gmail.com> Cc: Borislav Petkov <bp@alien8.de> Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com> Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/n/tip-azbkwd1fl32t997a4shz4lgp@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
-rw-r--r--tools/perf/Build1
-rw-r--r--tools/perf/Makefile.perf55
-rw-r--r--tools/perf/config/Makefile10
-rw-r--r--tools/perf/tests/Build42
4 files changed, 53 insertions, 55 deletions
diff --git a/tools/perf/Build b/tools/perf/Build
index 9ea828de3fde..b4b6a7ca760b 100644
--- a/tools/perf/Build
+++ b/tools/perf/Build
@@ -1,2 +1,3 @@
1perf-y += builtin-bench.o 1perf-y += builtin-bench.o
2perf-y += bench/ 2perf-y += bench/
3perf-y += tests/
diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf
index 77f67941dfc8..80c2a8f875ff 100644
--- a/tools/perf/Makefile.perf
+++ b/tools/perf/Makefile.perf
@@ -425,45 +425,6 @@ LIB_OBJS += $(OUTPUT)ui/stdio/hist.o
425 425
426LIB_OBJS += $(OUTPUT)arch/common.o 426LIB_OBJS += $(OUTPUT)arch/common.o
427 427
428LIB_OBJS += $(OUTPUT)tests/parse-events.o
429LIB_OBJS += $(OUTPUT)tests/dso-data.o
430LIB_OBJS += $(OUTPUT)tests/attr.o
431LIB_OBJS += $(OUTPUT)tests/vmlinux-kallsyms.o
432LIB_OBJS += $(OUTPUT)tests/open-syscall.o
433LIB_OBJS += $(OUTPUT)tests/open-syscall-all-cpus.o
434LIB_OBJS += $(OUTPUT)tests/open-syscall-tp-fields.o
435LIB_OBJS += $(OUTPUT)tests/mmap-basic.o
436LIB_OBJS += $(OUTPUT)tests/perf-record.o
437LIB_OBJS += $(OUTPUT)tests/rdpmc.o
438LIB_OBJS += $(OUTPUT)tests/evsel-roundtrip-name.o
439LIB_OBJS += $(OUTPUT)tests/evsel-tp-sched.o
440LIB_OBJS += $(OUTPUT)tests/fdarray.o
441LIB_OBJS += $(OUTPUT)tests/pmu.o
442LIB_OBJS += $(OUTPUT)tests/hists_common.o
443LIB_OBJS += $(OUTPUT)tests/hists_link.o
444LIB_OBJS += $(OUTPUT)tests/hists_filter.o
445LIB_OBJS += $(OUTPUT)tests/hists_output.o
446LIB_OBJS += $(OUTPUT)tests/hists_cumulate.o
447LIB_OBJS += $(OUTPUT)tests/python-use.o
448LIB_OBJS += $(OUTPUT)tests/bp_signal.o
449LIB_OBJS += $(OUTPUT)tests/bp_signal_overflow.o
450LIB_OBJS += $(OUTPUT)tests/task-exit.o
451LIB_OBJS += $(OUTPUT)tests/sw-clock.o
452ifeq ($(ARCH),x86)
453LIB_OBJS += $(OUTPUT)tests/perf-time-to-tsc.o
454endif
455LIB_OBJS += $(OUTPUT)tests/code-reading.o
456LIB_OBJS += $(OUTPUT)tests/sample-parsing.o
457LIB_OBJS += $(OUTPUT)tests/parse-no-sample-id-all.o
458ifndef NO_DWARF_UNWIND
459ifeq ($(ARCH),$(filter $(ARCH),x86 arm))
460LIB_OBJS += $(OUTPUT)tests/dwarf-unwind.o
461endif
462endif
463LIB_OBJS += $(OUTPUT)tests/mmap-thread-lookup.o
464LIB_OBJS += $(OUTPUT)tests/thread-mg-share.o
465LIB_OBJS += $(OUTPUT)tests/switch-tracking.o
466
467BUILTIN_OBJS += $(OUTPUT)builtin-annotate.o 428BUILTIN_OBJS += $(OUTPUT)builtin-annotate.o
468BUILTIN_OBJS += $(OUTPUT)builtin-diff.o 429BUILTIN_OBJS += $(OUTPUT)builtin-diff.o
469BUILTIN_OBJS += $(OUTPUT)builtin-evlist.o 430BUILTIN_OBJS += $(OUTPUT)builtin-evlist.o
@@ -483,7 +444,6 @@ BUILTIN_OBJS += $(OUTPUT)builtin-kmem.o
483BUILTIN_OBJS += $(OUTPUT)builtin-lock.o 444BUILTIN_OBJS += $(OUTPUT)builtin-lock.o
484BUILTIN_OBJS += $(OUTPUT)builtin-kvm.o 445BUILTIN_OBJS += $(OUTPUT)builtin-kvm.o
485BUILTIN_OBJS += $(OUTPUT)builtin-inject.o 446BUILTIN_OBJS += $(OUTPUT)builtin-inject.o
486BUILTIN_OBJS += $(OUTPUT)tests/builtin-test.o
487BUILTIN_OBJS += $(OUTPUT)builtin-mem.o 447BUILTIN_OBJS += $(OUTPUT)builtin-mem.o
488 448
489PERFLIBS = $(LIB_FILE) $(LIBAPIKFS) $(LIBTRACEEVENT) 449PERFLIBS = $(LIB_FILE) $(LIBAPIKFS) $(LIBTRACEEVENT)
@@ -525,7 +485,6 @@ endif
525ifndef NO_LIBUNWIND 485ifndef NO_LIBUNWIND
526 LIB_OBJS += $(OUTPUT)util/unwind-libunwind.o 486 LIB_OBJS += $(OUTPUT)util/unwind-libunwind.o
527endif 487endif
528LIB_OBJS += $(OUTPUT)tests/keep-tracking.o
529 488
530ifndef NO_LIBAUDIT 489ifndef NO_LIBAUDIT
531 BUILTIN_OBJS += $(OUTPUT)builtin-trace.o 490 BUILTIN_OBJS += $(OUTPUT)builtin-trace.o
@@ -700,20 +659,6 @@ $(OUTPUT)util/exec_cmd.o: util/exec_cmd.c $(OUTPUT)PERF-CFLAGS
700 '-DPREFIX="$(prefix_SQ)"' \ 659 '-DPREFIX="$(prefix_SQ)"' \
701 $< 660 $<
702 661
703$(OUTPUT)tests/attr.o: tests/attr.c $(OUTPUT)PERF-CFLAGS
704 $(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) \
705 '-DBINDIR="$(bindir_SQ)"' -DPYTHON='"$(PYTHON_WORD)"' \
706 $<
707
708$(OUTPUT)tests/python-use.o: tests/python-use.c $(OUTPUT)PERF-CFLAGS
709 $(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) \
710 -DPYTHONPATH='"$(OUTPUT)python"' \
711 -DPYTHON='"$(PYTHON_WORD)"' \
712 $<
713
714$(OUTPUT)tests/dwarf-unwind.o: tests/dwarf-unwind.c
715 $(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) -fno-optimize-sibling-calls $<
716
717$(OUTPUT)util/config.o: util/config.c $(OUTPUT)PERF-CFLAGS 662$(OUTPUT)util/config.o: util/config.c $(OUTPUT)PERF-CFLAGS
718 $(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) -DETC_PERFCONFIG='"$(ETC_PERFCONFIG_SQ)"' $< 663 $(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) -DETC_PERFCONFIG='"$(ETC_PERFCONFIG_SQ)"' $<
719 664
diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile
index 3e90fcab709d..2fd018529b95 100644
--- a/tools/perf/config/Makefile
+++ b/tools/perf/config/Makefile
@@ -20,10 +20,13 @@ CFLAGS := $(EXTRA_CFLAGS) $(EXTRA_WARNINGS)
20 20
21include $(src-perf)/config/Makefile.arch 21include $(src-perf)/config/Makefile.arch
22 22
23$(call detected_var,ARCH)
24
23NO_PERF_REGS := 1 25NO_PERF_REGS := 1
24 26
25# Additional ARCH settings for x86 27# Additional ARCH settings for x86
26ifeq ($(ARCH),x86) 28ifeq ($(ARCH),x86)
29 $(call detected,CONFIG_X86)
27 ifeq (${IS_64_BIT}, 1) 30 ifeq (${IS_64_BIT}, 1)
28 CFLAGS += -DHAVE_ARCH_X86_64_SUPPORT 31 CFLAGS += -DHAVE_ARCH_X86_64_SUPPORT
29 ARCH_INCLUDE = ../../arch/x86/lib/memcpy_64.S ../../arch/x86/lib/memset_64.S 32 ARCH_INCLUDE = ../../arch/x86/lib/memcpy_64.S ../../arch/x86/lib/memset_64.S
@@ -424,6 +427,7 @@ endif
424 427
425ifeq ($(dwarf-post-unwind),1) 428ifeq ($(dwarf-post-unwind),1)
426 CFLAGS += -DHAVE_DWARF_UNWIND_SUPPORT 429 CFLAGS += -DHAVE_DWARF_UNWIND_SUPPORT
430 $(call detected,CONFIG_DWARF_UNWIND)
427else 431else
428 NO_DWARF_UNWIND := 1 432 NO_DWARF_UNWIND := 1
429endif 433endif
@@ -821,3 +825,9 @@ endif
821ifeq ($(display_lib),1) 825ifeq ($(display_lib),1)
822 $(info ) 826 $(info )
823endif 827endif
828
829$(call detected_var,bindir_SQ)
830$(call detected_var,PYTHON_WORD)
831ifneq ($(OUTPUT),)
832$(call detected_var,OUTPUT)
833endif
diff --git a/tools/perf/tests/Build b/tools/perf/tests/Build
new file mode 100644
index 000000000000..2de01a4b4084
--- /dev/null
+++ b/tools/perf/tests/Build
@@ -0,0 +1,42 @@
1perf-y += builtin-test.o
2perf-y += parse-events.o
3perf-y += dso-data.o
4perf-y += attr.o
5perf-y += vmlinux-kallsyms.o
6perf-y += open-syscall.o
7perf-y += open-syscall-all-cpus.o
8perf-y += open-syscall-tp-fields.o
9perf-y += mmap-basic.o
10perf-y += perf-record.o
11perf-y += rdpmc.o
12perf-y += evsel-roundtrip-name.o
13perf-y += evsel-tp-sched.o
14perf-y += fdarray.o
15perf-y += pmu.o
16perf-y += hists_common.o
17perf-y += hists_link.o
18perf-y += hists_filter.o
19perf-y += hists_output.o
20perf-y += hists_cumulate.o
21perf-y += python-use.o
22perf-y += bp_signal.o
23perf-y += bp_signal_overflow.o
24perf-y += task-exit.o
25perf-y += sw-clock.o
26perf-y += mmap-thread-lookup.o
27perf-y += thread-mg-share.o
28perf-y += switch-tracking.o
29perf-y += keep-tracking.o
30perf-y += code-reading.o
31perf-y += sample-parsing.o
32perf-y += parse-no-sample-id-all.o
33
34perf-$(CONFIG_X86) += perf-time-to-tsc.o
35
36ifeq ($(ARCH),$(filter $(ARCH),x86 arm))
37perf-$(CONFIG_DWARF_UNWIND) += dwarf-unwind.o
38endif
39
40CFLAGS_attr.o += -DBINDIR="BUILD_STR($(bindir_SQ))" -DPYTHON="BUILD_STR($(PYTHON_WORD))"
41CFLAGS_python-use.o += -DPYTHONPATH="BUILD_STR($(OUTPUT)python)" -DPYTHON="BUILD_STR($(PYTHON_WORD))"
42CFLAGS_dwarf-unwind.o += -fno-optimize-sibling-calls