From: John Garry <john.garry@huawei.com>
To: <peterz@infradead.org>, <mingo@redhat.com>, <acme@kernel.org>,
<mark.rutland@arm.com>, <alexander.shishkin@linux.intel.com>,
<jolsa@redhat.com>, <namhyung@kernel.org>
Cc: <will@kernel.org>, <ak@linux.intel.com>, <linuxarm@huawei.com>,
<linux-kernel@vger.kernel.org>, <james.clark@arm.com>,
<qiangqing.zhang@nxp.com>, John Garry <john.garry@huawei.com>
Subject: [PATCH v2 0/7] perf test pmu-events case
Date: Tue, 17 Mar 2020 19:02:12 +0800 [thread overview]
Message-ID: <1584442939-8911-1-git-send-email-john.garry@huawei.com> (raw)
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
events
- 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
aliases
- 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
--
2.12.3
next reply other threads:[~2020-03-17 11:18 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-17 11:02 John Garry [this message]
2020-03-17 11:02 ` [PATCH v2 1/7] perf jevents: Add some test events John Garry
2020-04-04 8:41 ` [tip: perf/urgent] " tip-bot2 for John Garry
2020-03-17 11:02 ` [PATCH v2 2/7] perf jevents: Support test events folder John Garry
2020-03-17 16:20 ` Jiri Olsa
2020-03-17 16:25 ` John Garry
2020-03-17 17:06 ` Jiri Olsa
2020-03-17 17:42 ` John Garry
2020-03-17 20:41 ` Arnaldo Carvalho de Melo
2020-04-04 8:41 ` [tip: perf/urgent] " tip-bot2 for John Garry
2020-03-17 11:02 ` [PATCH v2 3/7] perf pmu: Refactor pmu_add_cpu_aliases() John Garry
2020-04-04 8:41 ` [tip: perf/urgent] " tip-bot2 for John Garry
2020-03-17 11:02 ` [PATCH v2 4/7] perf test: Add pmu-events test John Garry
2020-04-04 8:41 ` [tip: perf/urgent] " tip-bot2 for John Garry
2020-03-17 11:02 ` [PATCH v2 5/7] perf pmu: Add is_pmu_core() John Garry
2020-04-04 8:41 ` [tip: perf/urgent] " tip-bot2 for John Garry
2020-03-17 11:02 ` [PATCH v2 6/7] perf pmu: Make pmu_uncore_alias_match() public John Garry
2020-04-04 8:41 ` [tip: perf/urgent] " tip-bot2 for John Garry
2020-03-17 11:02 ` [PATCH v2 7/7] perf test: Test pmu-events aliases John Garry
2020-03-17 16:20 ` Jiri Olsa
2020-03-17 16:41 ` John Garry
2020-03-17 17:07 ` Jiri Olsa
2020-03-19 18:36 ` Arnaldo Carvalho de Melo
2020-03-20 9:24 ` John Garry
2020-03-20 9:30 ` Jiri Olsa
2020-04-04 8:41 ` [tip: perf/urgent] " tip-bot2 for John Garry
2020-03-18 7:57 ` [PATCH v2 0/7] perf test pmu-events case Jiri Olsa
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1584442939-8911-1-git-send-email-john.garry@huawei.com \
--to=john.garry@huawei.com \
--cc=acme@kernel.org \
--cc=ak@linux.intel.com \
--cc=alexander.shishkin@linux.intel.com \
--cc=james.clark@arm.com \
--cc=jolsa@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxarm@huawei.com \
--cc=mark.rutland@arm.com \
--cc=mingo@redhat.com \
--cc=namhyung@kernel.org \
--cc=peterz@infradead.org \
--cc=qiangqing.zhang@nxp.com \
--cc=will@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®