summaryrefslogtreecommitdiff
path: root/arch/x86/events/probe.h
diff options
context:
space:
mode:
authorZhang Rui <rui.zhang@intel.com>2021-02-05 00:18:14 +0800
committerPeter Zijlstra <peterz@infradead.org>2021-02-10 14:44:54 +0100
commitffb20c2e52e8709b5fc9951e8863e31efb1f2cba (patch)
tree8da4a35fc2d46bfe819dabd2688b39b90caeff48 /arch/x86/events/probe.h
parentb3c3361fe325074d4144c29d46daae4fc5a268d5 (diff)
perf/x86/rapl: Add msr mask support
In some cases, when probing a perf MSR, we're probing certain bits of the MSR instead of the whole register, thus only these bits should be checked. For example, for RAPL ENERGY_STATUS MSR, only the lower 32 bits represents the energy counter, and the higher 32bits are reserved. Introduce a new mask field in struct perf_msr to allow probing certain bits of a MSR. This change is transparent to the current perf_msr_probe() users. Signed-off-by: Zhang Rui <rui.zhang@intel.com> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Reviewed-by: Andi Kleen <ak@linux.intel.com> Link: https://lkml.kernel.org/r/20210204161816.12649-1-rui.zhang@intel.com
Diffstat (limited to 'arch/x86/events/probe.h')
-rw-r--r--arch/x86/events/probe.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/arch/x86/events/probe.h b/arch/x86/events/probe.h
index 4c8e0afc5fb5..261b9bda24e3 100644
--- a/arch/x86/events/probe.h
+++ b/arch/x86/events/probe.h
@@ -4,10 +4,11 @@
#include <linux/sysfs.h>
struct perf_msr {
- u64 msr;
- struct attribute_group *grp;
+ u64 msr;
+ struct attribute_group *grp;
bool (*test)(int idx, void *data);
- bool no_check;
+ bool no_check;
+ u64 mask;
};
unsigned long