[PATCH v4 3/5] perf jevents: Add support for parsing perchip/percore events

From: Kajol Jain
Date: Mon Jul 20 2020 - 03:19:54 EST


Added the "PerChiip" field in enum "aggr_mode_classs" so that perf
knows they are per chip events.

Added the "PerCore" field in enum "aggr_mode_class" so that perf
knows they are per core events.

Similar to the way we had "PerPkg field to specify perpkg events.

Signed-off-by: Kajol Jain <kjain@xxxxxxxxxxxxx>
Acked-by: Ian Rogers <irogers@xxxxxxxxxx>
---
tools/perf/pmu-events/jevents.c | 4 ++++
tools/perf/pmu-events/pmu-events.h | 4 +++-
2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/tools/perf/pmu-events/jevents.c b/tools/perf/pmu-events/jevents.c
index 6601f1fd2e80..2f48b783a64d 100644
--- a/tools/perf/pmu-events/jevents.c
+++ b/tools/perf/pmu-events/jevents.c
@@ -58,6 +58,10 @@ enum aggr_mode_class convert(const char *aggr_mode)
{
if (!strcmp(aggr_mode, "PerPkg"))
return PerPkg;
+ else if (!strcmp(aggr_mode, "PerCore"))
+ return PerCore;
+ else if (!strcmp(aggr_mode, "PerChip"))
+ return PerChip;
return -1;
}

diff --git a/tools/perf/pmu-events/pmu-events.h b/tools/perf/pmu-events/pmu-events.h
index 71b7aa6278d0..214ffc681b54 100644
--- a/tools/perf/pmu-events/pmu-events.h
+++ b/tools/perf/pmu-events/pmu-events.h
@@ -3,7 +3,9 @@
#define PMU_EVENTS_H

enum aggr_mode_class {
- PerPkg = 1
+ PerPkg = 1,
+ PerChip,
+ PerCore
};

/*
--
2.26.2