perf/x86/intel: Support PEBS output to PT
authorAlexander Shishkin <alexander.shishkin@linux.intel.com>
Tue, 6 Aug 2019 08:46:01 +0000 (11:46 +0300)
committerPeter Zijlstra <peterz@infradead.org>
Wed, 28 Aug 2019 09:29:39 +0000 (11:29 +0200)
commit42880f726c66f13ae1d9ac9ce4c43abe64ecac84
tree24a24d94033bc9c19e1e9356467d04b47f8e668e
parentab43762ef010967e4ccd53627f70a2eecbeafefb
perf/x86/intel: Support PEBS output to PT

If PEBS declares ability to output its data to Intel PT stream, use the
aux_output attribute bit to enable PEBS data output to PT. This requires
a PT event to be present and scheduled in the same context. Unlike the
DS area, the kernel does not extract PEBS records from the PT stream to
generate corresponding records in the perf stream, because that would
require real time in-kernel PT decoding, which is not feasible. The PMI,
however, can still be used.

The output setting is per-CPU, so all PEBS events must be either writing
to PT or to the DS area, therefore, in case of conflict, the conflicting
event will fail to schedule, allowing the rotation logic to alternate
between the PEBS->PT and PEBS->DS events.

Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: kan.liang@linux.intel.com
Link: https://lkml.kernel.org/r/20190806084606.4021-3-alexander.shishkin@linux.intel.com
arch/x86/events/core.c
arch/x86/events/intel/core.c
arch/x86/events/intel/ds.c
arch/x86/events/intel/pt.c
arch/x86/events/perf_event.h
arch/x86/include/asm/intel_pt.h
arch/x86/include/asm/msr-index.h