[PATCH v3 0/1] perf: Sharing PMU counters across compatible events

From: Song Liu
Date: Mon Sep 24 2018 - 18:25:27 EST


Chnages v2 -> v3:
1. Simplified event_pmu_add() as Jiri Olsa suggested

Changes v1 -> v2:
1. Fixed a bug reported by 0day kernel testing robot

This is to follow up earlier discussion on sharing hardware PMU counters
across compatible events:

https://marc.info/?t=151213803600016
https://marc.info/?t=152547569200001

This version limits PMU sharing to events within same ctx. As a result,
compatible events are not evaluated during task schedule. This vesion also
limits PMU sharing to hardware counting events. From our discussion with
internal users, this is sufficient for most cases.

This version introduces virtual master event. The virtual master event
does require careful handling. But it is makes the logic of event add/del
cleaner.

Cc: Tejun Heo <tj@xxxxxxxxxx>
Cc: Peter Zijlstra <peterz@xxxxxxxxxxxxx>
Cc: Jiri Olsa <jolsa@xxxxxxxxxx>
Cc: Alexey Budankov <alexey.budankov@xxxxxxxxxxxxxxx>

Song Liu (1):
perf: Sharing PMU counters across compatible events

include/linux/perf_event.h | 61 ++++++++
kernel/events/core.c | 281 +++++++++++++++++++++++++++++++++++--
2 files changed, 332 insertions(+), 10 deletions(-)

--
2.17.1