summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRay Kinsella <mdr@ashroe.eu>2021-10-15 10:13:17 +0100
committerDamjan Marion <dmarion@me.com>2021-10-16 08:32:43 +0000
commit5bb0eb122fa1a82abe0251903a91094a3a90603f (patch)
tree8cca9b7b8f3f79e2f2484359d3f3fd76e5c597c4
parent1eb8fea95f10c2ac5fa1d16c350323d9af8e03f1 (diff)
perfmon: additional perf counters on icelake
The Intel Icelake uArch supports measuring up to 12 counters, comprised of 4 fixed and 8 general counters. Type: improvement Signed-off-by: Ray Kinsella <mdr@ashroe.eu> Change-Id: I68369ea55a0c95d6a4a280a464e69502bbf5474f
-rw-r--r--src/plugins/perfmon/dispatch_wrapper.c30
-rw-r--r--src/plugins/perfmon/perfmon.h2
2 files changed, 31 insertions, 1 deletions
diff --git a/src/plugins/perfmon/dispatch_wrapper.c b/src/plugins/perfmon/dispatch_wrapper.c
index f5972f667a2..5e53417599b 100644
--- a/src/plugins/perfmon/dispatch_wrapper.c
+++ b/src/plugins/perfmon/dispatch_wrapper.c
@@ -65,6 +65,16 @@ perfmon_mmap_read_pmcs (u64 *counters,
switch (n_counters)
{
default:
+ case 12:
+ counters[11] = perfmon_mmap_read_pmc1 (mmap_pages[11]);
+ case 11:
+ counters[10] = perfmon_mmap_read_pmc1 (mmap_pages[10]);
+ case 10:
+ counters[9] = perfmon_mmap_read_pmc1 (mmap_pages[9]);
+ case 9:
+ counters[8] = perfmon_mmap_read_pmc1 (mmap_pages[8]);
+ case 8:
+ counters[7] = perfmon_mmap_read_pmc1 (mmap_pages[7]);
case 7:
counters[6] = perfmon_mmap_read_pmc1 (mmap_pages[6]);
case 6:
@@ -123,6 +133,16 @@ perfmon_metric_read_pmcs (u64 *counters, int *pmc_index, u8 n_counters)
switch (n_counters)
{
default:
+ case 12:
+ counters[11] = _rdpmc (pmc_index[11]);
+ case 11:
+ counters[10] = _rdpmc (pmc_index[10]);
+ case 10:
+ counters[9] = _rdpmc (pmc_index[9]);
+ case 9:
+ counters[8] = _rdpmc (pmc_index[8]);
+ case 8:
+ counters[7] = _rdpmc (pmc_index[7]);
case 7:
counters[6] = _rdpmc (pmc_index[6]);
case 6:
@@ -168,6 +188,16 @@ perfmon_dispatch_wrapper_metrics (vlib_main_t *vm, vlib_node_runtime_t *node,
switch (n_events)
{
default:
+ case 12:
+ pmc_index[11] = perfmon_metric_index (rt->bundle, 11);
+ case 11:
+ pmc_index[10] = perfmon_metric_index (rt->bundle, 10);
+ case 10:
+ pmc_index[9] = perfmon_metric_index (rt->bundle, 9);
+ case 9:
+ pmc_index[8] = perfmon_metric_index (rt->bundle, 8);
+ case 8:
+ pmc_index[7] = perfmon_metric_index (rt->bundle, 7);
case 7:
pmc_index[6] = perfmon_metric_index (rt->bundle, 6);
case 6:
diff --git a/src/plugins/perfmon/perfmon.h b/src/plugins/perfmon/perfmon.h
index f9b9070d077..0b46e524369 100644
--- a/src/plugins/perfmon/perfmon.h
+++ b/src/plugins/perfmon/perfmon.h
@@ -23,7 +23,7 @@
#include <vppinfra/cpu.h>
#include <vlib/vlib.h>
-#define PERF_MAX_EVENTS 8 /* 4 fixed and 8 programmable on ICX */
+#define PERF_MAX_EVENTS 12 /* 4 fixed and 8 programable on ICX */
typedef enum
{