perf/x86/intel/lbr: Add a function pointer for LBR read
authorKan Liang <kan.liang@linux.intel.com>
Fri, 3 Jul 2020 12:49:09 +0000 (05:49 -0700)
committerPeter Zijlstra <peterz@infradead.org>
Wed, 8 Jul 2020 09:38:51 +0000 (11:38 +0200)
commitc301b1d80ed5b806834fe0f739f028f65fb4fb16
tree5a03db4be9ad56692522d734ae2d348b223bc8e0
parent9f354a726cb1d4eb00a0784a27eaa0a3283cff71
perf/x86/intel/lbr: Add a function pointer for LBR read

The method to read Architectural LBRs is different from previous
model-specific LBR. Perf has to implement a different function.

A function pointer for LBR read is introduced. Perf should initialize
the corresponding function at boot time, and avoid checking lbr_format
at run time.

The current 64-bit LBR read function is set as default.

Signed-off-by: Kan Liang <kan.liang@linux.intel.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lkml.kernel.org/r/1593780569-62993-4-git-send-email-kan.liang@linux.intel.com
arch/x86/events/intel/core.c
arch/x86/events/intel/lbr.c
arch/x86/events/perf_event.h