summaryrefslogtreecommitdiffstats
path: root/src/plugins/perfmon/intel
diff options
context:
space:
mode:
authorRay Kinsella <mdr@ashroe.eu>2021-11-26 14:57:35 +0000
committerDamjan Marion <dmarion@me.com>2022-01-27 20:01:45 +0000
commit0024e53ad048ff0a3cb34bd95679606c11a7154b (patch)
tree704f03a531a5742dce054bc8254c206deaa510cb /src/plugins/perfmon/intel
parentae0e3e748f04a1fb9ad2393533a164611c417103 (diff)
perfmon: prune bundles by available pmu counters
Prune perfmon bundles that exceed the number of available pmu counters. Type: improvement Signed-off-by: Ray Kinsella <mdr@ashroe.eu> Change-Id: I70fec26bb8ca915f4b980963e06c2e43dfde5a23
Diffstat (limited to 'src/plugins/perfmon/intel')
-rw-r--r--src/plugins/perfmon/intel/core.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/plugins/perfmon/intel/core.c b/src/plugins/perfmon/intel/core.c
index c59fce81735..d985d049712 100644
--- a/src/plugins/perfmon/intel/core.c
+++ b/src/plugins/perfmon/intel/core.c
@@ -77,11 +77,21 @@ intel_core_init (vlib_main_t *vm, perfmon_source_t *src)
return 0;
}
+u8
+intel_core_is_fixed (u32 event)
+{
+ u64 config = events[event].config;
+ u8 eventcode = (config & 0xFF);
+
+ return !eventcode ? 1 : 0;
+}
+
PERFMON_REGISTER_SOURCE (intel_core) = {
.name = "intel-core",
.description = "intel arch core events",
.events = events,
.n_events = ARRAY_LEN (events),
.init_fn = intel_core_init,
+ .is_fixed = intel_core_is_fixed,
.format_config = format_intel_core_config,
};