[lkml]   [2020]   [Mar]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Subject[PATCH v2 0/7] perf test pmu-events case
This series introduces a basic pmu-events test case.

The test works in two steps:
- Verifies events in generated pmu-events.c are as expected for some test
- Verifies correctly created aliases for those test events for the HW PMUs
in the host system

The test events are invented, and are (mostly) arch agnostic (even though
I copied these events from pre-existing x86 and arm64 JSONs).

In the test, core and uncore events are treated slightly differently for
testing aliases. For core test events, all events are matched. However,
for uncore test events, these have "Unit" property, so can only be matched
when the corresponding HW PMU exists in the host sytem.

A test run looks like this on my x86 dev box:

$ tools/perf/perf test -vv 10

10: PMU events :
--- start ---
test child forked, pid 26610
testing event table bp_l1_btb_correct: pass
testing event table bp_l2_btb_correct: pass
testing event table segment_reg_loads.any: pass
testing event table dispatch_blocked.any: pass
testing event table eist_trans: pass
testing event table uncore_hisi_ddrc.flux_wcmd: pass
testing event table unc_cbo_xsnp_response.miss_eviction: pass
Using CPUID GenuineIntel-6-3D-4
intel_pt default config: tsc,pt,branch
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 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
skipping testing PMU software
skipping testing PMU intel_bts
testing aliases PMU uncore_cbox_0: matched event unc_cbo_xsnp_response.miss_eviction
testing PMU uncore_cbox_0 aliases: pass
skipping testing PMU tracepoint
test child finished with 0
---- end ----
PMU events: Ok

Changes since v1:
- Verify event table in generated pmu-events.c, in addition to verifying
- Don't create separate table for test events, but include as a "testcpu"

John Garry (7):
perf jevents: Add some test events
perf jevents: Support test events folder
perf pmu: Refactor pmu_add_cpu_aliases()
perf test: Add pmu-events test
perf pmu: Add is_pmu_core()
perf pmu: Make pmu_uncore_alias_match() public
perf test: Test pmu-events aliases

.../perf/pmu-events/arch/test/test_cpu/branch.json | 12 +
.../perf/pmu-events/arch/test/test_cpu/other.json | 26 ++
.../perf/pmu-events/arch/test/test_cpu/uncore.json | 21 ++
tools/perf/pmu-events/jevents.c | 30 ++
tools/perf/tests/Build | 1 +
tools/perf/tests/builtin-test.c | 4 +
tools/perf/tests/pmu-events.c | 373 +++++++++++++++++++++
tools/perf/tests/tests.h | 1 +
tools/perf/util/pmu.c | 28 +-
tools/perf/util/pmu.h | 5 +
10 files changed, 492 insertions(+), 9 deletions(-)
create mode 100644 tools/perf/pmu-events/arch/test/test_cpu/branch.json
create mode 100644 tools/perf/pmu-events/arch/test/test_cpu/other.json
create mode 100644 tools/perf/pmu-events/arch/test/test_cpu/uncore.json
create mode 100644 tools/perf/tests/pmu-events.c


 \ /
  Last update: 2020-03-17 12:20    [W:0.095 / U:2.016 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site