perf/x86: Add new event for AUX output counter index
authorAdrian Hunter <adrian.hunter@intel.com>
Tue, 7 Sep 2021 16:39:01 +0000 (19:39 +0300)
committerPeter Zijlstra <peterz@infradead.org>
Fri, 15 Oct 2021 09:25:31 +0000 (11:25 +0200)
commit8b8ff8cc3b8155c18162e8b1f70e1230db176862
tree7fa6284dbe477808c4a93170cfb6ea7ac5463980
parent41100833cdd8b1bef363b81a6482d74711c116ad
perf/x86: Add new event for AUX output counter index

PEBS-via-PT records contain a mask of applicable counters. To identify
which event belongs to which counter, a side-band event is needed. Until
now, there has been no side-band event, and consequently users were limited
to using a single event.

Add such a side-band event. Note the event is optimised to output only
when the counter index changes for an event. That works only so long as
all PEBS-via-PT events are scheduled together, which they are for a
recording session because they are in a single group.

Also no attribute bit is used to select the new event, so a new
kernel is not compatible with older perf tools.  The assumption
being that PEBS-via-PT is sufficiently esoteric that users will not
be troubled by this.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lkml.kernel.org/r/20210907163903.11820-2-adrian.hunter@intel.com
arch/x86/events/core.c
arch/x86/events/intel/core.c
arch/x86/events/perf_event.h
include/linux/perf_event.h
include/uapi/linux/perf_event.h
kernel/events/core.c