linux/tools/perf/tests
John Garry 956a78356c perf test: Test pmu-events aliases
Add creating event aliases to the pmu-events test.

So currently we verify that the generated pmu-events.c is as expected for
some test events. Now test that we generate aliases as expected for those
events during normal operation.

For that, we cycle through each HW PMU in the system, and use the test
events to create aliases, and verify those against known, expected values.

For core PMUs, we should create an alias for every event in
test_cpu_events[].

However, for uncore PMUs, they need to be matched by the pmu_event.pmu
member, so use test_uncore_events[]; so check the match beforehand with
pmu_uncore_alias_match().

A sample run is as follows for my x86 machine:

  john@linux-3c19:~/linux> tools/perf/perf test -vv 10
  10: PMU events                                            :
  --- start ---

  ...

  testing PMU uncore_arb aliases: no events to match
  testing PMU cstate_pkg aliases: no events to match
  skipping testing PMU breakpoint
  testing aliases PMU uncore_cbox_1: matched event unc_cbo_xsnp_response.miss_eviction
  testing PMU uncore_cbox_1 aliases: pass
  testing PMU power aliases: no events to match
  testing aliases PMU cpu: matched event bp_l1_btb_correct
  testing aliases PMU cpu: matched event bp_l2_btb_correct
  testing aliases PMU cpu: matched event segment_reg_loads.any
  testing aliases PMU cpu: matched event dispatch_blocked.any
  testing aliases PMU cpu: matched event eist_trans
  testing PMU cpu aliases: pass
  testing PMU intel_pt aliases: no events to match
  skipping testing PMU software
  skipping testing PMU intel_bts
  testing PMU uncore_imc aliases: no events to match
  testing aliases PMU uncore_cbox_0: matched event unc_cbo_xsnp_response.miss_eviction
  testing PMU uncore_cbox_0 aliases: pass
  testing PMU cstate_core aliases: no events to match
  skipping testing PMU tracepoint
  testing PMU msr aliases: no events to match
  test child finished with 0

Signed-off-by: John Garry <john.garry@huawei.com>
Acked-by: Jiri Olsa <jolsa@redhat.com>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: James Clark <james.clark@arm.com>
Cc: Joakim Zhang <qiangqing.zhang@nxp.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Will Deacon <will@kernel.org>
Cc: linuxarm@huawei.com
Link: http://lore.kernel.org/lkml/1584442939-8911-8-git-send-email-john.garry@huawei.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2020-03-24 10:36:00 -03:00
..
attr perf tools: Add kernel AUX area sampling definitions 2019-11-21 10:54:20 -03:00
shell perf test: Fix test trace+probe_vfs_getname.sh on s390 2020-02-18 10:13:28 -03:00
.gitignore perf test: Add libbpf relocation checker 2016-01-26 12:10:55 -03:00
attr.c perf debug: Remove needless include directives from debug.h 2019-08-31 19:10:19 -03:00
attr.py perf script python: Add Python3 support to tests/attr.py 2019-02-05 10:31:08 -03:00
backward-ring-buffer.c perf tests: Fix out of bounds memory access 2019-11-07 09:04:22 -03:00
bitmap.c perf env: Remove needless cpumap.h header 2019-09-20 09:19:21 -03:00
bp_account.c perf tests bp_account: Make global variable static 2020-03-02 11:15:07 -03:00
bp_signal.c perf tests bp_signal: Show expected versus obtained values 2020-01-06 11:46:09 -03:00
bp_signal_overflow.c perf debug: Remove needless include directives from debug.h 2019-08-31 19:10:19 -03:00
bpf-script-example.c perf tests: Add missing SPDX headers 2019-06-17 15:57:19 -03:00
bpf-script-test-kbuild.c perf tests: Add missing SPDX headers 2019-06-17 15:57:19 -03:00
bpf-script-test-prologue.c perf tests: Add missing SPDX headers 2019-06-17 15:57:19 -03:00
bpf-script-test-relocation.c perf tests: Add missing SPDX headers 2019-06-17 15:57:19 -03:00
bpf.c libperf: Adopt perf_mmap__read_event() from tools/perf 2019-10-10 11:49:46 -03:00
Build perf test: Add pmu-events test 2020-03-24 10:35:59 -03:00
builtin-test.c perf test: Add pmu-events test 2020-03-24 10:35:59 -03:00
clang.c perf tools: Remove util.h from where it is not needed 2019-09-20 09:19:20 -03:00
code-reading.c perf thread: Rename thread->mg to thread->maps 2019-11-26 11:07:46 -03:00
cpumap.c perf test: Fix test case Merge cpu map 2020-01-30 11:55:02 +01:00
dso-data.c perf tools: Remove util.h from where it is not needed 2019-09-20 09:19:20 -03:00
dwarf-unwind.c perf unwind: Use 'struct map_symbol' in 'struct unwind_entry' 2019-11-12 08:20:53 -03:00
event-times.c perf stat: Use affinity for opening events 2019-11-29 12:20:45 -03:00
event_update.c libperf: Add perf_evlist__id_add() function 2019-09-25 09:51:48 -03:00
evsel-roundtrip-name.c libperf: Add perf_evlist__first()/last() functions 2019-09-25 09:51:48 -03:00
evsel-tp-sched.c perf evsel: Rename perf_evsel__delete() to evsel__delete() 2019-07-29 18:34:43 -03:00
expr.c perf expr: Make expr__parse() return -1 on error 2020-03-09 21:43:25 -03:00
fdarray.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
genelf.c perf jit: Move test functionality in to a test 2019-11-29 12:20:45 -03:00
hists_common.c perf tools: Move event synthesizing routines to separate header 2019-09-20 09:19:22 -03:00
hists_common.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
hists_cumulate.c libperf: Add perf_evlist__first()/last() functions 2019-09-25 09:51:48 -03:00
hists_filter.c perf tools: Remove needless thread.h include directives 2019-08-31 22:24:10 -03:00
hists_link.c libperf: Add perf_evlist__first()/last() functions 2019-09-25 09:51:48 -03:00
hists_output.c libperf: Add perf_evlist__first()/last() functions 2019-09-25 09:51:48 -03:00
is_printable_array.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
keep-tracking.c libperf: Adopt perf_mmap__read_event() from tools/perf 2019-10-10 11:49:46 -03:00
kmod-path.c perf debug: Remove needless include directives from debug.h 2019-08-31 19:10:19 -03:00
llvm.c perf tools: Remove util.h from where it is not needed 2019-09-20 09:19:20 -03:00
llvm.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
make perf tests: Fix static build test 2019-09-20 14:37:28 -03:00
maps.c perf tests: Rename tests/map_groups.c to tests/maps.c 2019-11-26 11:07:46 -03:00
mem.c perf symbols: Move mem_info and branch_info out of symbol.h 2019-08-31 22:27:48 -03:00
mem2node.c perf env: Remove needless cpumap.h header 2019-09-20 09:19:21 -03:00
mmap-basic.c libperf: Adopt perf_mmap__read_event() from tools/perf 2019-10-10 11:49:46 -03:00
mmap-thread-lookup.c libperf: Move 'page_size' global variable to libperf 2019-09-25 09:51:48 -03:00
openat-syscall-all-cpus.c perf env: Remove needless cpumap.h header 2019-09-20 09:19:21 -03:00
openat-syscall-tp-fields.c libperf: Adopt perf_mmap__read_event() from tools/perf 2019-10-10 11:49:46 -03:00
openat-syscall.c perf debug: Remove needless include directives from debug.h 2019-08-31 19:10:19 -03:00
parse-events.c perf parse: Report initial event parsing error 2019-11-18 19:14:29 -03:00
parse-no-sample-id-all.c perf tools: Remove util.h from where it is not needed 2019-09-20 09:19:20 -03:00
perf-hooks.c perf tests: Avoid raising SEGV using an obvious NULL dereference 2019-09-27 09:26:14 -03:00
perf-record.c libperf: Adopt perf_mmap__read_event() from tools/perf 2019-10-10 11:49:46 -03:00
perf-targz-src-pkg License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
pmu-events.c perf test: Test pmu-events aliases 2020-03-24 10:36:00 -03:00
pmu.c perf tools: Remove util.h from where it is not needed 2019-09-20 09:19:20 -03:00
python-use.c perf test: Use header file util/debug.h 2018-06-04 10:28:53 -03:00
sample-parsing.c perf tools: Add hw_idx in struct branch_stack 2020-03-09 21:42:53 -03:00
sdt.c perf tools: No need to include internal/lib.h from util/util.h 2019-09-25 09:51:48 -03:00
stat.c perf tools: Move event synthesizing routines to separate header 2019-09-20 09:19:22 -03:00
sw-clock.c libperf: Adopt perf_mmap__read_event() from tools/perf 2019-10-10 11:49:46 -03:00
switch-tracking.c libperf: Adopt perf_mmap__read_event() from tools/perf 2019-10-10 11:49:46 -03:00
task-exit.c perf test: Avoid infinite loop for task exit case 2019-10-15 08:36:22 -03:00
tests.h perf test: Add pmu-events test 2020-03-24 10:35:59 -03:00
thread-map.c perf tools: Move event synthesizing routines to separate header 2019-09-20 09:19:22 -03:00
thread-maps-share.c perf tests: Rename thread-mg-share to thread-maps-share 2019-11-26 11:07:46 -03:00
time-utils-test.c perf evlist: Rename struct perf_evlist to struct evlist 2019-07-29 18:34:42 -03:00
topology.c perf session: Return error code for perf_session__new() function on failure 2019-09-20 15:58:11 -03:00
unit_number__scnprintf.c perf debug: Remove needless include directives from debug.h 2019-08-31 19:10:19 -03:00
vmlinux-kallsyms.c perf maps: Merge 'struct maps' with 'struct map_groups' 2019-11-26 11:07:46 -03:00
wp.c perf debug: Remove needless include directives from debug.h 2019-08-31 19:10:19 -03:00