summaryrefslogtreecommitdiffstats
path: root/src/plugins/perfmon/intel/bundle/topdown_metrics.c
diff options
context:
space:
mode:
authorRay Kinsella <mdr@ashroe.eu>2021-12-02 08:06:01 +0000
committerDamjan Marion <dmarion@me.com>2021-12-02 15:02:39 +0000
commite893beab2713a7fa1b8d5e9567b7c004e625fec6 (patch)
treeb8a2fac3a3fd8645c188279f989444982d9602f4 /src/plugins/perfmon/intel/bundle/topdown_metrics.c
parentc30f3006bde0005962edf4cf84ca022b806b5ccf (diff)
perfmon: refactor perf metric support
Refactoring perf metric support to remove branching on bundle type in the dispatch wrapper. This change includes caching the rdpmc index at perfmon_start(), so that the mmap_page.index doesn't need to be looked up each time. It also exclude the effects of mmap_page.index. This patch prepares the path for bundles that support general, fixed and metrics counters simulataneously. Type: refactor Signed-off-by: Ray Kinsella <mdr@ashroe.eu> Change-Id: I9c5b4917bd02fea960e546e8558452c4362eabc4
Diffstat (limited to 'src/plugins/perfmon/intel/bundle/topdown_metrics.c')
-rw-r--r--src/plugins/perfmon/intel/bundle/topdown_metrics.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/src/plugins/perfmon/intel/bundle/topdown_metrics.c b/src/plugins/perfmon/intel/bundle/topdown_metrics.c
index af1c108ba0b..a28c4e7ca52 100644
--- a/src/plugins/perfmon/intel/bundle/topdown_metrics.c
+++ b/src/plugins/perfmon/intel/bundle/topdown_metrics.c
@@ -122,16 +122,13 @@ PERFMON_REGISTER_BUNDLE (topdown_lvl1_metric) = {
.name = "topdown-level1",
.description = "Top-down Microarchitecture Analysis Level 1",
.source = "intel-core",
- .offset_type = PERFMON_OFFSET_TYPE_METRICS,
.events[0] = INTEL_CORE_E_TOPDOWN_SLOTS,
.events[1] = INTEL_CORE_E_TOPDOWN_L1_RETIRING_METRIC,
.events[2] = INTEL_CORE_E_TOPDOWN_L1_BAD_SPEC_METRIC,
.events[3] = INTEL_CORE_E_TOPDOWN_L1_FE_BOUND_METRIC,
.events[4] = INTEL_CORE_E_TOPDOWN_L1_BE_BOUND_METRIC,
.n_events = 5,
- .metrics[0] = RDPMC_SLOTS | FIXED_COUNTER_SLOTS,
- .metrics[1] = RDPMC_METRICS | METRIC_COUNTER_TOPDOWN_L1_L2,
- .n_metrics = 2,
+ .preserve_samples = 0x1F,
.cpu_supports = topdown_lvl1_cpu_supports,
.n_cpu_supports = ARRAY_LEN (topdown_lvl1_cpu_supports),
.format_fn = format_topdown_lvl1,
@@ -251,7 +248,6 @@ PERFMON_REGISTER_BUNDLE (topdown_lvl2_metric) = {
.name = "topdown-level2",
.description = "Top-down Microarchitecture Analysis Level 2",
.source = "intel-core",
- .offset_type = PERFMON_OFFSET_TYPE_METRICS,
.events[0] = INTEL_CORE_E_TOPDOWN_SLOTS,
.events[1] = INTEL_CORE_E_TOPDOWN_L1_RETIRING_METRIC,
.events[2] = INTEL_CORE_E_TOPDOWN_L1_BAD_SPEC_METRIC,
@@ -262,9 +258,7 @@ PERFMON_REGISTER_BUNDLE (topdown_lvl2_metric) = {
.events[7] = INTEL_CORE_E_TOPDOWN_L2_FETCHLAT_METRIC,
.events[8] = INTEL_CORE_E_TOPDOWN_L2_MEMBOUND_METRIC,
.n_events = 9,
- .metrics[0] = RDPMC_SLOTS | FIXED_COUNTER_SLOTS,
- .metrics[1] = RDPMC_METRICS | METRIC_COUNTER_TOPDOWN_L1_L2,
- .n_metrics = 2,
+ .preserve_samples = 0x1FF,
.cpu_supports = topdown_lvl2_cpu_supports,
.n_cpu_supports = ARRAY_LEN (topdown_lvl2_cpu_supports),
.format_fn = format_topdown_lvl2,