lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <1584442939-8911-1-git-send-email-john.garry@huawei.com>
Date:   Tue, 17 Mar 2020 19:02:12 +0800
From:   John Garry <john.garry@...wei.com>
To:     <peterz@...radead.org>, <mingo@...hat.com>, <acme@...nel.org>,
        <mark.rutland@....com>, <alexander.shishkin@...ux.intel.com>,
        <jolsa@...hat.com>, <namhyung@...nel.org>
CC:     <will@...nel.org>, <ak@...ux.intel.com>, <linuxarm@...wei.com>,
        <linux-kernel@...r.kernel.org>, <james.clark@....com>,
        <qiangqing.zhang@....com>, John Garry <john.garry@...wei.com>
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
  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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ