lkml.org 
[lkml]   [2023]   [May]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Subject[PATCH v4 0/4] perf: Rework event forwarding logic
Date
Usually, events are opened on the same pmu as requested by user via
perf_event_attr->type argument. But certain special events are
internally redirected to different pmu. Currently such pmus needs to
be treated specially and thus requires some gruesome hacks.

An approach, suggested by Peter Zijlstra, to get rid of these hacks
was to overwrite event attributes with new pmu's attribute values
within the kernel and let perf_event_init() retry opening the event
with overwritten values. This patch series implements it.

v3: https://lore.kernel.org/r/20230425142205.762-1-ravi.bangoria@amd.com
v3->v4:
- Split pmu linear searching changes into a separate patch with few
additional changes.
- Use special pointer value (void *)(~0) instead of introducing new
variable to skip creating sysfs/dev files.
- Move AMD IBS unit test under tools/perf/arch/x86/tests/

Patches are prepared on v6.3.

Ravi Bangoria (4):
perf/core: Rework forwarding of {task|cpu}-clock events
perf/ibs: Fix interface via core pmu events
perf/core: Remove pmu linear searching code
perf test: Add selftest to test IBS invocation via core pmu events

arch/x86/events/amd/core.c | 2 +-
arch/x86/events/amd/ibs.c | 53 ++++----
arch/x86/include/asm/perf_event.h | 2 +
include/linux/perf_event.h | 10 ++
kernel/events/core.c | 114 +++++++++---------
tools/perf/arch/x86/include/arch-tests.h | 1 +
tools/perf/arch/x86/tests/Build | 1 +
.../arch/x86/tests/amd-ibs-via-core-pmu.c | 71 +++++++++++
tools/perf/arch/x86/tests/arch-tests.c | 2 +
9 files changed, 168 insertions(+), 88 deletions(-)
create mode 100644 tools/perf/arch/x86/tests/amd-ibs-via-core-pmu.c

--
2.40.0

\
 
 \ /
  Last update: 2023-05-04 13:01    [W:0.604 / U:0.016 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site