diff options
-rw-r--r-- | tools/perf/Makefile.config | 38 | ||||
-rw-r--r-- | tools/perf/Makefile.perf | 2 | ||||
-rw-r--r-- | tools/perf/arch/Build | 2 | ||||
-rw-r--r-- | tools/perf/pmu-events/Build | 4 | ||||
-rw-r--r-- | tools/perf/tests/Build | 2 | ||||
-rw-r--r-- | tools/perf/tests/task-exit.c | 2 | ||||
-rw-r--r-- | tools/perf/util/evsel.c | 12 | ||||
-rw-r--r-- | tools/perf/util/header.c | 2 | ||||
-rw-r--r-- | tools/perf/util/unwind-libdw.c | 8 |
9 files changed, 46 insertions, 26 deletions
diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config index 8354d04b392f..1f4fbc9a3292 100644 --- a/tools/perf/Makefile.config +++ b/tools/perf/Makefile.config | |||
@@ -19,18 +19,18 @@ CFLAGS := $(EXTRA_CFLAGS) $(EXTRA_WARNINGS) | |||
19 | 19 | ||
20 | include $(srctree)/tools/scripts/Makefile.arch | 20 | include $(srctree)/tools/scripts/Makefile.arch |
21 | 21 | ||
22 | $(call detected_var,ARCH) | 22 | $(call detected_var,SRCARCH) |
23 | 23 | ||
24 | NO_PERF_REGS := 1 | 24 | NO_PERF_REGS := 1 |
25 | 25 | ||
26 | # Additional ARCH settings for ppc | 26 | # Additional ARCH settings for ppc |
27 | ifeq ($(ARCH),powerpc) | 27 | ifeq ($(SRCARCH),powerpc) |
28 | NO_PERF_REGS := 0 | 28 | NO_PERF_REGS := 0 |
29 | LIBUNWIND_LIBS := -lunwind -lunwind-ppc64 | 29 | LIBUNWIND_LIBS := -lunwind -lunwind-ppc64 |
30 | endif | 30 | endif |
31 | 31 | ||
32 | # Additional ARCH settings for x86 | 32 | # Additional ARCH settings for x86 |
33 | ifeq ($(ARCH),x86) | 33 | ifeq ($(SRCARCH),x86) |
34 | $(call detected,CONFIG_X86) | 34 | $(call detected,CONFIG_X86) |
35 | ifeq (${IS_64_BIT}, 1) | 35 | ifeq (${IS_64_BIT}, 1) |
36 | CFLAGS += -DHAVE_ARCH_X86_64_SUPPORT -DHAVE_SYSCALL_TABLE -I$(OUTPUT)arch/x86/include/generated | 36 | CFLAGS += -DHAVE_ARCH_X86_64_SUPPORT -DHAVE_SYSCALL_TABLE -I$(OUTPUT)arch/x86/include/generated |
@@ -43,12 +43,12 @@ ifeq ($(ARCH),x86) | |||
43 | NO_PERF_REGS := 0 | 43 | NO_PERF_REGS := 0 |
44 | endif | 44 | endif |
45 | 45 | ||
46 | ifeq ($(ARCH),arm) | 46 | ifeq ($(SRCARCH),arm) |
47 | NO_PERF_REGS := 0 | 47 | NO_PERF_REGS := 0 |
48 | LIBUNWIND_LIBS = -lunwind -lunwind-arm | 48 | LIBUNWIND_LIBS = -lunwind -lunwind-arm |
49 | endif | 49 | endif |
50 | 50 | ||
51 | ifeq ($(ARCH),arm64) | 51 | ifeq ($(SRCARCH),arm64) |
52 | NO_PERF_REGS := 0 | 52 | NO_PERF_REGS := 0 |
53 | LIBUNWIND_LIBS = -lunwind -lunwind-aarch64 | 53 | LIBUNWIND_LIBS = -lunwind -lunwind-aarch64 |
54 | endif | 54 | endif |
@@ -61,7 +61,7 @@ endif | |||
61 | # Disable it on all other architectures in case libdw unwind | 61 | # Disable it on all other architectures in case libdw unwind |
62 | # support is detected in system. Add supported architectures | 62 | # support is detected in system. Add supported architectures |
63 | # to the check. | 63 | # to the check. |
64 | ifneq ($(ARCH),$(filter $(ARCH),x86 arm)) | 64 | ifneq ($(SRCARCH),$(filter $(SRCARCH),x86 arm)) |
65 | NO_LIBDW_DWARF_UNWIND := 1 | 65 | NO_LIBDW_DWARF_UNWIND := 1 |
66 | endif | 66 | endif |
67 | 67 | ||
@@ -115,9 +115,9 @@ endif | |||
115 | FEATURE_CHECK_CFLAGS-libbabeltrace := $(LIBBABELTRACE_CFLAGS) | 115 | FEATURE_CHECK_CFLAGS-libbabeltrace := $(LIBBABELTRACE_CFLAGS) |
116 | FEATURE_CHECK_LDFLAGS-libbabeltrace := $(LIBBABELTRACE_LDFLAGS) -lbabeltrace-ctf | 116 | FEATURE_CHECK_LDFLAGS-libbabeltrace := $(LIBBABELTRACE_LDFLAGS) -lbabeltrace-ctf |
117 | 117 | ||
118 | FEATURE_CHECK_CFLAGS-bpf = -I. -I$(srctree)/tools/include -I$(srctree)/tools/arch/$(ARCH)/include/uapi -I$(srctree)/tools/include/uapi | 118 | FEATURE_CHECK_CFLAGS-bpf = -I. -I$(srctree)/tools/include -I$(srctree)/tools/arch/$(SRCARCH)/include/uapi -I$(srctree)/tools/include/uapi |
119 | # include ARCH specific config | 119 | # include ARCH specific config |
120 | -include $(src-perf)/arch/$(ARCH)/Makefile | 120 | -include $(src-perf)/arch/$(SRCARCH)/Makefile |
121 | 121 | ||
122 | ifdef PERF_HAVE_ARCH_REGS_QUERY_REGISTER_OFFSET | 122 | ifdef PERF_HAVE_ARCH_REGS_QUERY_REGISTER_OFFSET |
123 | CFLAGS += -DHAVE_ARCH_REGS_QUERY_REGISTER_OFFSET | 123 | CFLAGS += -DHAVE_ARCH_REGS_QUERY_REGISTER_OFFSET |
@@ -228,12 +228,12 @@ ifeq ($(DEBUG),0) | |||
228 | endif | 228 | endif |
229 | 229 | ||
230 | INC_FLAGS += -I$(src-perf)/util/include | 230 | INC_FLAGS += -I$(src-perf)/util/include |
231 | INC_FLAGS += -I$(src-perf)/arch/$(ARCH)/include | 231 | INC_FLAGS += -I$(src-perf)/arch/$(SRCARCH)/include |
232 | INC_FLAGS += -I$(srctree)/tools/include/uapi | 232 | INC_FLAGS += -I$(srctree)/tools/include/uapi |
233 | INC_FLAGS += -I$(srctree)/tools/include/ | 233 | INC_FLAGS += -I$(srctree)/tools/include/ |
234 | INC_FLAGS += -I$(srctree)/tools/arch/$(ARCH)/include/uapi | 234 | INC_FLAGS += -I$(srctree)/tools/arch/$(SRCARCH)/include/uapi |
235 | INC_FLAGS += -I$(srctree)/tools/arch/$(ARCH)/include/ | 235 | INC_FLAGS += -I$(srctree)/tools/arch/$(SRCARCH)/include/ |
236 | INC_FLAGS += -I$(srctree)/tools/arch/$(ARCH)/ | 236 | INC_FLAGS += -I$(srctree)/tools/arch/$(SRCARCH)/ |
237 | 237 | ||
238 | # $(obj-perf) for generated common-cmds.h | 238 | # $(obj-perf) for generated common-cmds.h |
239 | # $(obj-perf)/util for generated bison/flex headers | 239 | # $(obj-perf)/util for generated bison/flex headers |
@@ -355,7 +355,7 @@ ifndef NO_LIBELF | |||
355 | 355 | ||
356 | ifndef NO_DWARF | 356 | ifndef NO_DWARF |
357 | ifeq ($(origin PERF_HAVE_DWARF_REGS), undefined) | 357 | ifeq ($(origin PERF_HAVE_DWARF_REGS), undefined) |
358 | msg := $(warning DWARF register mappings have not been defined for architecture $(ARCH), DWARF support disabled); | 358 | msg := $(warning DWARF register mappings have not been defined for architecture $(SRCARCH), DWARF support disabled); |
359 | NO_DWARF := 1 | 359 | NO_DWARF := 1 |
360 | else | 360 | else |
361 | CFLAGS += -DHAVE_DWARF_SUPPORT $(LIBDW_CFLAGS) | 361 | CFLAGS += -DHAVE_DWARF_SUPPORT $(LIBDW_CFLAGS) |
@@ -380,7 +380,7 @@ ifndef NO_LIBELF | |||
380 | CFLAGS += -DHAVE_BPF_PROLOGUE | 380 | CFLAGS += -DHAVE_BPF_PROLOGUE |
381 | $(call detected,CONFIG_BPF_PROLOGUE) | 381 | $(call detected,CONFIG_BPF_PROLOGUE) |
382 | else | 382 | else |
383 | msg := $(warning BPF prologue is not supported by architecture $(ARCH), missing regs_query_register_offset()); | 383 | msg := $(warning BPF prologue is not supported by architecture $(SRCARCH), missing regs_query_register_offset()); |
384 | endif | 384 | endif |
385 | else | 385 | else |
386 | msg := $(warning DWARF support is off, BPF prologue is disabled); | 386 | msg := $(warning DWARF support is off, BPF prologue is disabled); |
@@ -406,7 +406,7 @@ ifdef PERF_HAVE_JITDUMP | |||
406 | endif | 406 | endif |
407 | endif | 407 | endif |
408 | 408 | ||
409 | ifeq ($(ARCH),powerpc) | 409 | ifeq ($(SRCARCH),powerpc) |
410 | ifndef NO_DWARF | 410 | ifndef NO_DWARF |
411 | CFLAGS += -DHAVE_SKIP_CALLCHAIN_IDX | 411 | CFLAGS += -DHAVE_SKIP_CALLCHAIN_IDX |
412 | endif | 412 | endif |
@@ -487,7 +487,7 @@ else | |||
487 | endif | 487 | endif |
488 | 488 | ||
489 | ifndef NO_LOCAL_LIBUNWIND | 489 | ifndef NO_LOCAL_LIBUNWIND |
490 | ifeq ($(ARCH),$(filter $(ARCH),arm arm64)) | 490 | ifeq ($(SRCARCH),$(filter $(SRCARCH),arm arm64)) |
491 | $(call feature_check,libunwind-debug-frame) | 491 | $(call feature_check,libunwind-debug-frame) |
492 | ifneq ($(feature-libunwind-debug-frame), 1) | 492 | ifneq ($(feature-libunwind-debug-frame), 1) |
493 | msg := $(warning No debug_frame support found in libunwind); | 493 | msg := $(warning No debug_frame support found in libunwind); |
@@ -740,7 +740,7 @@ ifeq (${IS_64_BIT}, 1) | |||
740 | NO_PERF_READ_VDSO32 := 1 | 740 | NO_PERF_READ_VDSO32 := 1 |
741 | endif | 741 | endif |
742 | endif | 742 | endif |
743 | ifneq ($(ARCH), x86) | 743 | ifneq ($(SRCARCH), x86) |
744 | NO_PERF_READ_VDSOX32 := 1 | 744 | NO_PERF_READ_VDSOX32 := 1 |
745 | endif | 745 | endif |
746 | ifndef NO_PERF_READ_VDSOX32 | 746 | ifndef NO_PERF_READ_VDSOX32 |
@@ -769,7 +769,7 @@ ifdef LIBBABELTRACE | |||
769 | endif | 769 | endif |
770 | 770 | ||
771 | ifndef NO_AUXTRACE | 771 | ifndef NO_AUXTRACE |
772 | ifeq ($(ARCH),x86) | 772 | ifeq ($(SRCARCH),x86) |
773 | ifeq ($(feature-get_cpuid), 0) | 773 | ifeq ($(feature-get_cpuid), 0) |
774 | msg := $(warning Your gcc lacks the __get_cpuid() builtin, disables support for auxtrace/Intel PT, please install a newer gcc); | 774 | msg := $(warning Your gcc lacks the __get_cpuid() builtin, disables support for auxtrace/Intel PT, please install a newer gcc); |
775 | NO_AUXTRACE := 1 | 775 | NO_AUXTRACE := 1 |
@@ -872,7 +872,7 @@ sysconfdir = $(prefix)/etc | |||
872 | ETC_PERFCONFIG = etc/perfconfig | 872 | ETC_PERFCONFIG = etc/perfconfig |
873 | endif | 873 | endif |
874 | ifndef lib | 874 | ifndef lib |
875 | ifeq ($(ARCH)$(IS_64_BIT), x861) | 875 | ifeq ($(SRCARCH)$(IS_64_BIT), x861) |
876 | lib = lib64 | 876 | lib = lib64 |
877 | else | 877 | else |
878 | lib = lib | 878 | lib = lib |
diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf index 79fe31f20a17..5008f51a08a2 100644 --- a/tools/perf/Makefile.perf +++ b/tools/perf/Makefile.perf | |||
@@ -226,7 +226,7 @@ endif | |||
226 | 226 | ||
227 | ifeq ($(config),0) | 227 | ifeq ($(config),0) |
228 | include $(srctree)/tools/scripts/Makefile.arch | 228 | include $(srctree)/tools/scripts/Makefile.arch |
229 | -include arch/$(ARCH)/Makefile | 229 | -include arch/$(SRCARCH)/Makefile |
230 | endif | 230 | endif |
231 | 231 | ||
232 | # The FEATURE_DUMP_EXPORT holds location of the actual | 232 | # The FEATURE_DUMP_EXPORT holds location of the actual |
diff --git a/tools/perf/arch/Build b/tools/perf/arch/Build index 109eb75cf7de..d9b6af837c7d 100644 --- a/tools/perf/arch/Build +++ b/tools/perf/arch/Build | |||
@@ -1,2 +1,2 @@ | |||
1 | libperf-y += common.o | 1 | libperf-y += common.o |
2 | libperf-y += $(ARCH)/ | 2 | libperf-y += $(SRCARCH)/ |
diff --git a/tools/perf/pmu-events/Build b/tools/perf/pmu-events/Build index 9213a1273697..999a4e878162 100644 --- a/tools/perf/pmu-events/Build +++ b/tools/perf/pmu-events/Build | |||
@@ -2,7 +2,7 @@ hostprogs := jevents | |||
2 | 2 | ||
3 | jevents-y += json.o jsmn.o jevents.o | 3 | jevents-y += json.o jsmn.o jevents.o |
4 | pmu-events-y += pmu-events.o | 4 | pmu-events-y += pmu-events.o |
5 | JDIR = pmu-events/arch/$(ARCH) | 5 | JDIR = pmu-events/arch/$(SRCARCH) |
6 | JSON = $(shell [ -d $(JDIR) ] && \ | 6 | JSON = $(shell [ -d $(JDIR) ] && \ |
7 | find $(JDIR) -name '*.json' -o -name 'mapfile.csv') | 7 | find $(JDIR) -name '*.json' -o -name 'mapfile.csv') |
8 | # | 8 | # |
@@ -10,4 +10,4 @@ JSON = $(shell [ -d $(JDIR) ] && \ | |||
10 | # directory and create tables in pmu-events.c. | 10 | # directory and create tables in pmu-events.c. |
11 | # | 11 | # |
12 | $(OUTPUT)pmu-events/pmu-events.c: $(JSON) $(JEVENTS) | 12 | $(OUTPUT)pmu-events/pmu-events.c: $(JSON) $(JEVENTS) |
13 | $(Q)$(call echo-cmd,gen)$(JEVENTS) $(ARCH) pmu-events/arch $(OUTPUT)pmu-events/pmu-events.c $(V) | 13 | $(Q)$(call echo-cmd,gen)$(JEVENTS) $(SRCARCH) pmu-events/arch $(OUTPUT)pmu-events/pmu-events.c $(V) |
diff --git a/tools/perf/tests/Build b/tools/perf/tests/Build index af58ebc243ef..84222bdb8689 100644 --- a/tools/perf/tests/Build +++ b/tools/perf/tests/Build | |||
@@ -75,7 +75,7 @@ $(OUTPUT)tests/llvm-src-relocation.c: tests/bpf-script-test-relocation.c tests/B | |||
75 | $(Q)sed -e 's/"/\\"/g' -e 's/\(.*\)/"\1\\n"/g' $< >> $@ | 75 | $(Q)sed -e 's/"/\\"/g' -e 's/\(.*\)/"\1\\n"/g' $< >> $@ |
76 | $(Q)echo ';' >> $@ | 76 | $(Q)echo ';' >> $@ |
77 | 77 | ||
78 | ifeq ($(ARCH),$(filter $(ARCH),x86 arm arm64 powerpc)) | 78 | ifeq ($(SRCARCH),$(filter $(SRCARCH),x86 arm arm64 powerpc)) |
79 | perf-$(CONFIG_DWARF_UNWIND) += dwarf-unwind.o | 79 | perf-$(CONFIG_DWARF_UNWIND) += dwarf-unwind.o |
80 | endif | 80 | endif |
81 | 81 | ||
diff --git a/tools/perf/tests/task-exit.c b/tools/perf/tests/task-exit.c index 32873ec91a4e..cf00ebad2ef5 100644 --- a/tools/perf/tests/task-exit.c +++ b/tools/perf/tests/task-exit.c | |||
@@ -83,7 +83,7 @@ int test__task_exit(int subtest __maybe_unused) | |||
83 | 83 | ||
84 | evsel = perf_evlist__first(evlist); | 84 | evsel = perf_evlist__first(evlist); |
85 | evsel->attr.task = 1; | 85 | evsel->attr.task = 1; |
86 | evsel->attr.sample_freq = 0; | 86 | evsel->attr.sample_freq = 1; |
87 | evsel->attr.inherit = 0; | 87 | evsel->attr.inherit = 0; |
88 | evsel->attr.watermark = 0; | 88 | evsel->attr.watermark = 0; |
89 | evsel->attr.wakeup_events = 1; | 89 | evsel->attr.wakeup_events = 1; |
diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c index e4f7902d5afa..cda44b0e821c 100644 --- a/tools/perf/util/evsel.c +++ b/tools/perf/util/evsel.c | |||
@@ -273,8 +273,20 @@ struct perf_evsel *perf_evsel__new_cycles(void) | |||
273 | struct perf_evsel *evsel; | 273 | struct perf_evsel *evsel; |
274 | 274 | ||
275 | event_attr_init(&attr); | 275 | event_attr_init(&attr); |
276 | /* | ||
277 | * Unnamed union member, not supported as struct member named | ||
278 | * initializer in older compilers such as gcc 4.4.7 | ||
279 | * | ||
280 | * Just for probing the precise_ip: | ||
281 | */ | ||
282 | attr.sample_period = 1; | ||
276 | 283 | ||
277 | perf_event_attr__set_max_precise_ip(&attr); | 284 | perf_event_attr__set_max_precise_ip(&attr); |
285 | /* | ||
286 | * Now let the usual logic to set up the perf_event_attr defaults | ||
287 | * to kick in when we return and before perf_evsel__open() is called. | ||
288 | */ | ||
289 | attr.sample_period = 0; | ||
278 | 290 | ||
279 | evsel = perf_evsel__new(&attr); | 291 | evsel = perf_evsel__new(&attr); |
280 | if (evsel == NULL) | 292 | if (evsel == NULL) |
diff --git a/tools/perf/util/header.c b/tools/perf/util/header.c index 5cac8d5e009a..b5baff3007bb 100644 --- a/tools/perf/util/header.c +++ b/tools/perf/util/header.c | |||
@@ -841,7 +841,7 @@ static int write_group_desc(int fd, struct perf_header *h __maybe_unused, | |||
841 | 841 | ||
842 | /* | 842 | /* |
843 | * default get_cpuid(): nothing gets recorded | 843 | * default get_cpuid(): nothing gets recorded |
844 | * actual implementation must be in arch/$(ARCH)/util/header.c | 844 | * actual implementation must be in arch/$(SRCARCH)/util/header.c |
845 | */ | 845 | */ |
846 | int __weak get_cpuid(char *buffer __maybe_unused, size_t sz __maybe_unused) | 846 | int __weak get_cpuid(char *buffer __maybe_unused, size_t sz __maybe_unused) |
847 | { | 847 | { |
diff --git a/tools/perf/util/unwind-libdw.c b/tools/perf/util/unwind-libdw.c index da45c4be5fb3..7755a5e0fe5e 100644 --- a/tools/perf/util/unwind-libdw.c +++ b/tools/perf/util/unwind-libdw.c | |||
@@ -178,6 +178,14 @@ frame_callback(Dwfl_Frame *state, void *arg) | |||
178 | Dwarf_Addr pc; | 178 | Dwarf_Addr pc; |
179 | bool isactivation; | 179 | bool isactivation; |
180 | 180 | ||
181 | if (!dwfl_frame_pc(state, &pc, NULL)) { | ||
182 | pr_err("%s", dwfl_errmsg(-1)); | ||
183 | return DWARF_CB_ABORT; | ||
184 | } | ||
185 | |||
186 | // report the module before we query for isactivation | ||
187 | report_module(pc, ui); | ||
188 | |||
181 | if (!dwfl_frame_pc(state, &pc, &isactivation)) { | 189 | if (!dwfl_frame_pc(state, &pc, &isactivation)) { |
182 | pr_err("%s", dwfl_errmsg(-1)); | 190 | pr_err("%s", dwfl_errmsg(-1)); |
183 | return DWARF_CB_ABORT; | 191 | return DWARF_CB_ABORT; |