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: <20240721202113.380750-1-leo.yan@arm.com>
Date: Sun, 21 Jul 2024 21:21:07 +0100
From: Leo Yan <leo.yan@....com>
To: Arnaldo Carvalho de Melo <acme@...nel.org>,
	Namhyung Kim <namhyung@...nel.org>,
	Ian Rogers <irogers@...gle.com>,
	Adrian Hunter <adrian.hunter@...el.com>,
	James Clark <james.clark@...aro.org>,
	Suzuki K Poulose <suzuki.poulose@....com>,
	Mike Leach <mike.leach@...aro.org>,
	John Garry <john.g.garry@...cle.com>,
	Will Deacon <will@...nel.org>,
	Jiri Olsa <jolsa@...nel.org>,
	Mark Rutland <mark.rutland@....com>,
	coresight@...ts.linaro.org,
	linux-arm-kernel@...ts.infradead.org,
	linux-perf-users@...r.kernel.org,
	linux-kernel@...r.kernel.org
Cc: Leo Yan <leo.yan@....com>
Subject: [PATCH v1 0/6] perf auxtrace: Support multiple AUX events

This series is to support multiple events with the *same* type in Perf
AUX trace. As the first enabled instance, the patch series enables
multiple Arm SPE events (e.g. arm_spe_0, arm_spe_1, etc) in AUX trace.

The solution for support multiple AUX events with same type is not
difficult. As the events are same type, the trace data shares the same
format and can be decoded by the same decoder. Essentially, this patch
series is to extend the AUX trace flow from support single PMU event to
multiple events.

Note, this series does not support a more complex case - different types
of AUX events, (e.g. Arm CoreSight event and Arm SPE events are enabled
simultaneously).

Patch 01 is a minor refactoring for dereference PMU pointer from evsel
structure.

Patches 02, 03 and 04 are to use the 'auxtrace' flag for support multiple
AUX events. Firstly, we need to set the 'auxtrace' flag for Arm and s390
AUX events (Intel PT and bts have set already it). Afterwards, by using
the evsel__is_aux_event() function, the core layer iterates the whole
evlist - which allows the buffer index can be matched to corresponding
AUX event.

Patches 05 and 06 are to configure multiple SPE event in architecture
dependent code. The old code is only initialize the first AUX event.
with this series, it initializes all SPE PMU events.

This patch series has been tested with the normal 'perf record' command
and 'perf mem record' command.  And verified for the decoding commands
'perf script' and 'perf mem report'.

I observed one prominent issue is for per-CPU profiling. For example,
when specifying option '-C 2' for profiling on CPU2, in this case the
'arm_spe_0' event supports CPU2 but the 'arm_spe_1' event does not
support the CPU. As a result, 'arm_spe_1' event reports failure. This
is likely a common issue for support Per-CPU profiling with multiple
PMU events and every PMU event only support partial CPUs. This issue
will be addressed later.


Leo Yan (6):
  perf pmu: Directly use evsel's PMU pointer
  perf auxtrace arm: Set the 'auxtrace' flag for AUX events
  perf auxtrace s390: Set the 'auxtrace' flag for AUX events
  perf auxtrace: Iterate all AUX events when finish reading
  perf arm-spe: Extract evsel setting up
  perf arm-spe: Support multiple Arm SPE events

 tools/perf/arch/arm/util/pmu.c       |   3 +
 tools/perf/arch/arm64/util/arm-spe.c | 107 ++++++++++++++++-----------
 tools/perf/arch/s390/util/auxtrace.c |   1 +
 tools/perf/util/auxtrace.c           |  15 +++-
 tools/perf/util/pmu.c                |   2 +-
 5 files changed, 78 insertions(+), 50 deletions(-)

-- 
2.34.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ