perf/x86/intel: Set PERF_ATTACH_SCHED_CB for large PEBS and LBR
authorKan Liang <kan.liang@linux.intel.com>
Mon, 30 Nov 2020 19:38:41 +0000 (11:38 -0800)
committerIngo Molnar <mingo@kernel.org>
Sat, 6 Mar 2021 11:52:44 +0000 (12:52 +0100)
commitafbef30149587ad46f4780b1e0cc5e219745ce90
tree8ce1c9c814944c1d19a8bd10b19108ab2540822a
parenta5398bffc01fe044848c5024e5e867e407f239b8
perf/x86/intel: Set PERF_ATTACH_SCHED_CB for large PEBS and LBR

To supply a PID/TID for large PEBS, it requires flushing the PEBS buffer
in a context switch.

For normal LBRs, a context switch can flip the address space and LBR
entries are not tagged with an identifier, we need to wipe the LBR, even
for per-cpu events.

For LBR callstack, save/restore the stack is required during a context
switch.

Set PERF_ATTACH_SCHED_CB for the event with large PEBS & LBR.

Fixes: 9c964efa4330 ("perf/x86/intel: Drain the PEBS buffer during context switches")
Signed-off-by: Kan Liang <kan.liang@linux.intel.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Link: https://lkml.kernel.org/r/20201130193842.10569-2-kan.liang@linux.intel.com
arch/x86/events/intel/core.c