powerpc/perf: Add json file support for hv_24x7 core level events
v4 cover powerpc/perf: Add json file support for hv_24x7 core level events
Patchset enhance current runtime parameter support. It introduces new fields like "PerChip" and "PerCore" similar to the field "PerPkg" which is used to specify perpkg events.
The "PerCore" and "PerChip" specifies whether its core or chip events. Based on which we can decide which runtime parameter user want to access. Now character '?' can refers different parameter based on user requirement.
Initially, every time we want to add new terms like chip, core, thread etc, we need to create corrsponding fields in pmu_events and event struct.
This patchset adds an enum called 'aggr_mode_class' which store all these aggregation like perpkg/percore. It also adds new field 'AggregationMode' to capture these terms.
Now, if user wants to add any new term, they just need to add it in the enum defined. I try to test it with my current setup.
I also need to replace PerPkg field to AggregationMode in all the x86 uncore json files. It will great if Andi and team can test it and let me know if they have any concerns.
Changelog:
v3 -> v4:
- Include pmu-events.h header file in jevents.c and remove redecalaration of enum aggr_mode_class as Suggested by Jiri.
- Add Acked-by tag.
v2 -> v3:
- Did some nits changes suggested by Jiri include correction of indentation, and making PerCore/PerChip values forward after PerPkg as 1 in the enum.
- Rebase the patchset on Arnaldo's tmp.perf/core branch.
- Change RFC tag
v1 -> v2:
- Rather then adding new field as PerCore/PerChip, created a new enum to get these fields. And new field as "AggregationMode" which can be used to capture these fields from json file.
- Suggested By Ian Rogers
Kajol Jain (5):
perf/pmu-events/jevents: Add enum to store aggregation like PerPkg pmu-events/x86/uncore: Replace PerPkg field to AggregationMode in x86
json files
perf jevents: Add support for parsing perchip/percore events perf/tools: Pass pmu_event structure as a parameter for
arch_get_runtimeparam
perf/tools/pmu_events/powerpc: Add hv_24x7 core level metric events
tools/perf/arch/powerpc/util/header.c | 7 +- .../arch/powerpc/power9/nest_metrics.json | 27 +- .../arch/x86/broadwellde/uncore-cache.json | 62 ++-- .../arch/x86/broadwellde/uncore-memory.json | 18 +- .../arch/x86/broadwellde/uncore-power.json | 18 +- .../arch/x86/broadwellx/uncore-cache.json | 62 ++-- .../x86/broadwellx/uncore-interconnect.json | 6 +- .../arch/x86/broadwellx/uncore-memory.json | 18 +- .../arch/x86/broadwellx/uncore-power.json | 18 +- .../arch/x86/cascadelakex/uncore-memory.json | 64 ++-- .../arch/x86/cascadelakex/uncore-other.json | 332 +++++++++--------- .../arch/x86/haswellx/uncore-cache.json | 62 ++-- .../x86/haswellx/uncore-interconnect.json | 6 +- .../arch/x86/haswellx/uncore-memory.json | 18 +- .../arch/x86/haswellx/uncore-power.json | 18 +- .../arch/x86/ivytown/uncore-cache.json | 62 ++-- .../arch/x86/ivytown/uncore-interconnect.json | 10 +- .../arch/x86/ivytown/uncore-memory.json | 16 +- .../arch/x86/ivytown/uncore-power.json | 52 +-- .../arch/x86/jaketown/uncore-cache.json | 40 +-- .../x86/jaketown/uncore-interconnect.json | 10 +- .../arch/x86/jaketown/uncore-memory.json | 18 +- .../arch/x86/jaketown/uncore-power.json | 52 +-- .../x86/knightslanding/uncore-memory.json | 8 +- .../arch/x86/skylakex/uncore-memory.json | 36 +- .../arch/x86/skylakex/uncore-other.json | 220 ++++++------ .../arch/x86/tremontx/uncore-memory.json | 14 +- .../arch/x86/tremontx/uncore-other.json | 70 ++-- .../arch/x86/tremontx/uncore-power.json | 2 +- tools/perf/pmu-events/jevents.c | 40 ++- tools/perf/pmu-events/jevents.h | 2 +- tools/perf/pmu-events/pmu-events.h | 8 +- tools/perf/tests/pmu-events.c | 8 +- tools/perf/util/metricgroup.c | 5 +- tools/perf/util/metricgroup.h | 3 +- tools/perf/util/pmu.c | 6 +- 36 files changed, 724 insertions(+), 694 deletions(-)
Signature · 1 line
2.26.2
PATCH v4 1/5 perf/pmu-events/jevents: Add enum to store aggregation like PerPkg
Initially, every time we want to add new terms like chip, core thread etc, we need to create corrsponding fields in pmu_events and event struct. This patch adds an enum called 'aggr_mode_class' which store all these aggregation like perpkg/percore. It also adds new field 'aggr_mode' to capture these terms.
Now, if user wants to add any new term, they just need to add it in the enum defined.
--- tools/perf/pmu-events/jevents.c | 36 ++++++++++++++++++------------ tools/perf/pmu-events/jevents.h | 2 +- tools/perf/pmu-events/pmu-events.h | 6 ++++- tools/perf/tests/pmu-events.c | 8 +++---- tools/perf/util/pmu.c | 6 ++--- 5 files changed, 35 insertions(+), 23 deletions(-)
tools/perf/pmu-events/jevents.c +22 -14
@@ -49,10 +49,18 @@#include "jsmn.h" #include "json.h" #include "jevents.h" +#include "pmu-events.h" int verbose;char *prog; +enum aggr_mode_class convert (const char *aggr_mode) +{ +if (!strcmp (aggr_mode,"PerPkg" )) +return PerPkg; +return -1 ; +} +int eprintf (int level,int var,const char *fmt, ...) {
@@ -320,7 +328,7 @@ static void print_events_table_prefix(FILE *fp, const char *tblname)static int print_events_table_entry (void *data,char *name,char *event,char *desc,char *long_desc, -char *pmu,char *unit,char *perpkg, +char *pmu,char *unit,char *aggr_mode,char *metric_expr,char *metric_name,char *metric_group,char *deprecated,char *metric_constraint)
@@ -345,10 +353,10 @@ static int print_events_table_entry(void *data, char *name, char *event,fprintf (outfp,"\t.long_desc = \"%s\",\n" , long_desc);if (pmu)fprintf (outfp,"\t.pmu = \"%s\",\n" , pmu); +if (aggr_mode) +fprintf (outfp,"\t.aggr_mode = \"%d\",\n" ,convert (aggr_mode));if (unit)fprintf (outfp,"\t.unit = \"%s\",\n" , unit); -if (perpkg) -fprintf (outfp,"\t.perpkg = \"%s\",\n" , perpkg);if (metric_expr)fprintf (outfp,"\t.metric_expr = \"%s\",\n" , metric_expr);if (metric_name)
@@ -372,7 +380,7 @@ struct event_struct {char *long_desc;char *pmu;char *unit; -char *perpkg; +char *aggr_mode;char *metric_expr;char *metric_name;char *metric_group;
@@ -401,7 +409,7 @@ struct event_struct {op (long_desc); \op (pmu); \op (unit); \ -op (perpkg); \ +op (aggr_mode); \op (metric_expr); \op (metric_name); \op (metric_group); \
@@ -423,7 +431,7 @@ static void free_arch_std_events(void)static int save_arch_std_events (void *data,char *name,char *event,char *desc,char *long_desc,char *pmu, -char *unit,char *perpkg,char *metric_expr, +char *unit,char *aggr_mode,char *metric_expr,char *metric_name,char *metric_group,char *deprecated,char *metric_constraint) {
@@ -487,7 +495,7 @@ static char *real_event(const char *name, char *event)static int try_fixup (const char *fn,char *arch_std,char **event,char **desc,char **name,char **long_desc,char **pmu,char **filter, -char **perpkg,char **unit,char **metric_expr,char **metric_name, +char **aggr_mode,char **unit,char **metric_expr,char **metric_name,char **metric_group,unsigned long long eventcode,char **deprecated,char **metric_constraint) {
@@ -515,7 +523,7 @@ try_fixup(const char *fn, char *arch_std, char **event, char **desc, int json_events(const char *fn, int (*func)(void *data, char *name, char *event, char *desc, char *long_desc, - char *pmu, char *unit, char *perpkg, + char *pmu, char *unit, char *aggr_mode, char *metric_expr, char *metric_name, char *metric_group, char *deprecated, char *metric_constraint),
@@ -542,7 +550,7 @@ int json_events(const char *fn,char *extra_desc =NULL ;char *pmu =NULL ;char *filter =NULL ; -char *perpkg =NULL ; +char *aggr_mode =NULL ;char *unit =NULL ;char *metric_expr =NULL ;char *metric_name =NULL ;
@@ -625,8 +633,8 @@ int json_events(const char *fn,addfield (map, &filter,"" ,"" , val); }else if (json_streq (map, field,"ScaleUnit" )) {addfield (map, &unit,"" ,"" , val); - }else if (json_streq (map, field,"PerPkg" )) { -addfield (map, &perpkg,"" ,"" , val); + }else if (json_streq (map, field,"AggregationMode" )) { +addfield (map, &aggr_mode,"" ,"" , val); }else if (json_streq (map, field,"Deprecated" )) {addfield (map, &deprecated,"" ,"" , val); }else if (json_streq (map, field,"MetricName" )) {
@@ -673,7 +681,7 @@ int json_events(const char *fn,* fixup any unassigned values. */ err =try_fixup (fn, arch_std, &event, &desc, &name, - &long_desc, &pmu, &filter, &perpkg, + &long_desc, &pmu, &filter, &aggr_mode, &unit, &metric_expr, &metric_name, &metric_group, eventcode, &deprecated, &metric_constraint);
@@ -681,7 +689,7 @@ int json_events(const char *fn, goto free_strings; } err =func (data, name,real_event (name, event), desc, long_desc, - pmu, unit, perpkg, metric_expr, metric_name, + pmu, unit, aggr_mode, metric_expr, metric_name, metric_group, deprecated, metric_constraint); free_strings:free (event);
@@ -691,7 +699,7 @@ int json_events(const char *fn,free (extra_desc);free (pmu);free (filter); -free (perpkg); +free (aggr_mode);free (deprecated);free (unit);free (metric_expr);
tools/perf/pmu-events/jevents.h +1 -1
@@ -6,7 +6,7 @@ int json_events(const char *fn,int (*func)(void *data,char *name,char *event,char *desc,char *long_desc,char *pmu, -char *unit,char *perpkg,char *metric_expr, +char *unit,char *aggr_mode,char *metric_expr,char *metric_name,char *metric_group,char *deprecated,char *metric_constraint), void *data);
tools/perf/pmu-events/pmu-events.h +5 -1
@@ -2,6 +2,10 @@#ifndef PMU_EVENTS_H #define PMU_EVENTS_H +enum aggr_mode_class { + PerPkg =1 +}; +/* * Describe each PMU event. Each CPU has a table of PMU events. */
@@ -13,7 +17,7 @@ struct pmu_event {const char *long_desc;const char *pmu;const char *unit; -const char *perpkg; +const char *aggr_mode;const char *metric_expr;const char *metric_name;const char *metric_group;
tools/perf/tests/pmu-events.c +4 -4
@@ -206,10 +206,10 @@ static int test_pmu_event_table(void)return -1 ; } -if (!is_same (table->perpkg, te->perpkg)) { -pr_debug2 ("testing event table %s: mismatched perpkg, %s vs %s\n" , - table->name, table->perpkg, - te->perpkg); +if (!is_same (table->aggr_mode, te->aggr_mode)) { +pr_debug2 ("testing event table %s: mismatched aggr_mode, %s vs %s\n" , + table->name, table->aggr_mode, + te->aggr_mode);return -1 ; }
tools/perf/util/pmu.c +3 -3
@@ -308,7 +308,7 @@ static bool perf_pmu_merge_alias(struct perf_pmu_alias *newalias,static int __perf_pmu__new_alias (struct list_head *list,char *dir,char *name,char *desc,char *val,char *long_desc,char *topic, -char *unit,char *perpkg, +char *unit,char *aggr_mode,char *metric_expr,char *metric_name,char *deprecated)
@@ -380,7 +380,7 @@ static int __perf_pmu__new_alias(struct list_head *list, char *dir, char *name,return -1 ;snprintf (alias->unit,sizeof (alias->unit),"%s" , unit); } - alias->per_pkg = perpkg &&sscanf (perpkg,"%d" , &num) ==1 && num ==1 ; + alias->per_pkg = aggr_mode &&sscanf (aggr_mode,"%d" , &num) ==1 && num == PerPkg; alias->str =strdup (newval);if (deprecated)
@@ -778,7 +778,7 @@ void pmu_add_cpu_aliases_map(struct list_head *head, struct perf_pmu *pmu,__perf_pmu__new_alias (head,NULL , (char *)pe->name, (char *)pe->desc, (char *)pe->event, (char *)pe->long_desc, (char *)pe->topic, - (char *)pe->unit, (char *)pe->perpkg, + (char *)pe->unit, (char *)pe->aggr_mode, (char *)pe->metric_expr, (char *)pe->metric_name, (char *)pe->deprecated);
Signature · 1 line
2.26.2
PATCH v4 2/5 pmu-events/x86/uncore: Replace PerPkg field to AggregationMode in x86 json files
In reply to Kajol JainThis patch replace PerPkg field to AggregationMode for all the x86 uncore json files.
--- .../arch/x86/broadwellde/uncore-cache.json | 62 ++-- .../arch/x86/broadwellde/uncore-memory.json | 18 +- .../arch/x86/broadwellde/uncore-power.json | 18 +- .../arch/x86/broadwellx/uncore-cache.json | 62 ++-- .../x86/broadwellx/uncore-interconnect.json | 6 +- .../arch/x86/broadwellx/uncore-memory.json | 18 +- .../arch/x86/broadwellx/uncore-power.json | 18 +- .../arch/x86/cascadelakex/uncore-memory.json | 64 ++-- .../arch/x86/cascadelakex/uncore-other.json | 332 +++++++++--------- .../arch/x86/haswellx/uncore-cache.json | 62 ++-- .../x86/haswellx/uncore-interconnect.json | 6 +- .../arch/x86/haswellx/uncore-memory.json | 18 +- .../arch/x86/haswellx/uncore-power.json | 18 +- .../arch/x86/ivytown/uncore-cache.json | 62 ++-- .../arch/x86/ivytown/uncore-interconnect.json | 10 +- .../arch/x86/ivytown/uncore-memory.json | 16 +- .../arch/x86/ivytown/uncore-power.json | 52 +-- .../arch/x86/jaketown/uncore-cache.json | 40 +-- .../x86/jaketown/uncore-interconnect.json | 10 +- .../arch/x86/jaketown/uncore-memory.json | 18 +- .../arch/x86/jaketown/uncore-power.json | 52 +-- .../x86/knightslanding/uncore-memory.json | 8 +- .../arch/x86/skylakex/uncore-memory.json | 36 +- .../arch/x86/skylakex/uncore-other.json | 220 ++++++------ .../arch/x86/tremontx/uncore-memory.json | 14 +- .../arch/x86/tremontx/uncore-other.json | 70 ++-- .../arch/x86/tremontx/uncore-power.json | 2 +- 27 files changed, 656 insertions(+), 656 deletions(-)
tools/perf/pmu-events/arch/x86/broadwellde/uncore-cache.json +31 -31
@@ -3,7 +3,7 @@ "BriefDescription": "Uncore cache clock ticks", "Counter": "0,1,2,3", "EventName": "UNC_C_CLOCKTICKS", - "PerPkg": "1", + "AggregationMode": "PerPkg", "Unit": "CBO" }, {
@@ -12,7 +12,7 @@ "EventCode": "0x34", "EventName": "UNC_C_LLC_LOOKUP.ANY", "Filter": "filter_state=0x1", - "PerPkg": "1", + "AggregationMode": "PerPkg", "ScaleUnit": "64Bytes", "UMask": "0x11", "Unit": "CBO"
@@ -22,7 +22,7 @@ "Counter": "0,1,2,3", "EventCode": "0x37", "EventName": "UNC_C_LLC_VICTIMS.M_STATE", - "PerPkg": "1", + "AggregationMode": "PerPkg", "ScaleUnit": "64Bytes", "UMask": "0x1", "Unit": "CBO"
@@ -33,7 +33,7 @@ "EventCode": "0x35", "EventName": "LLC_MISSES.DATA_READ", "Filter": "filter_opc=0x182", - "PerPkg": "1", + "AggregationMode": "PerPkg", "ScaleUnit": "64Bytes", "UMask": "0x3", "Unit": "CBO"
@@ -44,7 +44,7 @@ "EventCode": "0x35", "EventName": "LLC_MISSES.UNCACHEABLE", "Filter": "filter_opc=0x187", - "PerPkg": "1", + "AggregationMode": "PerPkg", "ScaleUnit": "64Bytes", "UMask": "0x3", "Unit": "CBO"
@@ -55,7 +55,7 @@ "EventCode": "0x35", "EventName": "LLC_MISSES.MMIO_READ", "Filter": "filter_opc=0x187,filter_nc=1", - "PerPkg": "1", + "AggregationMode": "PerPkg", "ScaleUnit": "64Bytes", "UMask": "0x3", "Unit": "CBO"
@@ -66,7 +66,7 @@ "EventCode": "0x35", "EventName": "LLC_MISSES.MMIO_WRITE", "Filter": "filter_opc=0x18f,filter_nc=1", - "PerPkg": "1", + "AggregationMode": "PerPkg", "ScaleUnit": "64Bytes", "UMask": "0x3", "Unit": "CBO"
@@ -77,7 +77,7 @@ "EventCode": "0x35", "EventName": "LLC_MISSES.RFO_LLC_PREFETCH", "Filter": "filter_opc=0x190", - "PerPkg": "1", + "AggregationMode": "PerPkg", "ScaleUnit": "64Bytes", "UMask": "0x3", "Unit": "CBO"
@@ -88,7 +88,7 @@ "EventCode": "0x35", "EventName": "LLC_MISSES.CODE_LLC_PREFETCH", "Filter": "filter_opc=0x191", - "PerPkg": "1", + "AggregationMode": "PerPkg", "ScaleUnit": "64Bytes", "UMask": "0x3", "Unit": "CBO"
@@ -99,7 +99,7 @@ "EventCode": "0x35", "EventName": "LLC_MISSES.DATA_LLC_PREFETCH", "Filter": "filter_opc=0x192", - "PerPkg": "1", + "AggregationMode": "PerPkg", "ScaleUnit": "64Bytes", "UMask": "0x3", "Unit": "CBO"
@@ -110,7 +110,7 @@ "EventCode": "0x35", "EventName": "LLC_MISSES.PCIE_READ", "Filter": "filter_opc=0x19e", - "PerPkg": "1", + "AggregationMode": "PerPkg", "ScaleUnit": "64Bytes", "UMask": "0x3", "Unit": "CBO"
@@ -121,7 +121,7 @@ "EventCode": "0x35", "EventName": "LLC_MISSES.PCIE_WRITE", "Filter": "filter_opc=0x1c8", - "PerPkg": "1", + "AggregationMode": "PerPkg", "ScaleUnit": "64Bytes", "UMask": "0x3", "Unit": "CBO"
@@ -132,7 +132,7 @@ "EventCode": "0x35", "EventName": "LLC_MISSES.PCIE_NON_SNOOP_WRITE", "Filter": "filter_opc=0x1c8,filter_tid=0x3e", - "PerPkg": "1", + "AggregationMode": "PerPkg", "ScaleUnit": "64Bytes", "UMask": "0x3", "Unit": "CBO"
@@ -143,7 +143,7 @@ "EventCode": "0x35", "EventName": "LLC_REFERENCES.PCIE_NS_PARTIAL_WRITE", "Filter": "filter_opc=0x180,filter_tid=0x3e", - "PerPkg": "1", + "AggregationMode": "PerPkg", "UMask": "0x1", "Unit": "CBO" },
@@ -153,7 +153,7 @@ "EventCode": "0x35", "EventName": "LLC_REFERENCES.CODE_LLC_PREFETCH", "Filter": "filter_opc=0x181", - "PerPkg": "1", + "AggregationMode": "PerPkg", "ScaleUnit": "64Bytes", "UMask": "0x1", "Unit": "CBO"
@@ -164,7 +164,7 @@ "EventCode": "0x35", "EventName": "LLC_REFERENCES.STREAMING_FULL", "Filter": "filter_opc=0x18c", - "PerPkg": "1", + "AggregationMode": "PerPkg", "ScaleUnit": "64Bytes", "UMask": "0x1", "Unit": "CBO"
@@ -175,7 +175,7 @@ "EventCode": "0x35", "EventName": "LLC_REFERENCES.STREAMING_PARTIAL", "Filter": "filter_opc=0x18d", - "PerPkg": "1", + "AggregationMode": "PerPkg", "ScaleUnit": "64Bytes", "UMask": "0x1", "Unit": "CBO"
@@ -186,7 +186,7 @@ "EventCode": "0x35", "EventName": "LLC_REFERENCES.PCIE_READ", "Filter": "filter_opc=0x19e", - "PerPkg": "1", + "AggregationMode": "PerPkg", "ScaleUnit": "64Bytes", "UMask": "0x1", "Unit": "CBO"
@@ -197,7 +197,7 @@ "EventCode": "0x35", "EventName": "LLC_REFERENCES.PCIE_WRITE", "Filter": "filter_opc=0x1c8,filter_tid=0x3e", - "PerPkg": "1", + "AggregationMode": "PerPkg", "ScaleUnit": "64Bytes", "UMask": "0x1", "Unit": "CBO"
@@ -207,7 +207,7 @@ "EventCode": "0x36", "EventName": "UNC_C_TOR_OCCUPANCY.LLC_DATA_READ", "Filter": "filter_opc=0x182", - "PerPkg": "1", + "AggregationMode": "PerPkg", "UMask": "0x3", "Unit": "CBO" },
@@ -216,7 +216,7 @@ "Counter": "0,1,2,3", "EventCode": "0x1", "EventName": "UNC_H_REQUESTS.READS", - "PerPkg": "1", + "AggregationMode": "PerPkg", "UMask": "0x3", "Unit": "HA" },
@@ -225,7 +225,7 @@ "Counter": "0,1,2,3", "EventCode": "0x1", "EventName": "UNC_H_REQUESTS.READS_LOCAL", - "PerPkg": "1", + "AggregationMode": "PerPkg", "UMask": "0x1", "Unit": "HA" },
@@ -234,7 +234,7 @@ "Counter": "0,1,2,3", "EventCode": "0x1", "EventName": "UNC_H_REQUESTS.READS_REMOTE", - "PerPkg": "1", + "AggregationMode": "PerPkg", "UMask": "0x2", "Unit": "HA" },
@@ -243,7 +243,7 @@ "Counter": "0,1,2,3", "EventCode": "0x1", "EventName": "UNC_H_REQUESTS.WRITES", - "PerPkg": "1", + "AggregationMode": "PerPkg", "UMask": "0xC", "Unit": "HA" },
@@ -252,7 +252,7 @@ "Counter": "0,1,2,3", "EventCode": "0x1", "EventName": "UNC_H_REQUESTS.WRITES_LOCAL", - "PerPkg": "1", + "AggregationMode": "PerPkg", "UMask": "0x4", "Unit": "HA" },
@@ -261,7 +261,7 @@ "Counter": "0,1,2,3", "EventCode": "0x1", "EventName": "UNC_H_REQUESTS.WRITES_REMOTE", - "PerPkg": "1", + "AggregationMode": "PerPkg", "UMask": "0x8", "Unit": "HA" },
@@ -270,7 +270,7 @@ "Counter": "0,1,2,3", "EventCode": "0x21", "EventName": "UNC_H_SNOOP_RESP.RSPCNFLCT", - "PerPkg": "1", + "AggregationMode": "PerPkg", "UMask": "0x40", "Unit": "HA" },
@@ -279,7 +279,7 @@ "Counter": "0,1,2,3", "EventCode": "0x21", "EventName": "UNC_H_SNOOP_RESP.RSP_FWD_WB", - "PerPkg": "1", + "AggregationMode": "PerPkg", "ScaleUnit": "64Bytes", "UMask": "0x20", "Unit": "HA"
@@ -289,7 +289,7 @@ "Counter": "0,1,2,3", "EventCode": "0x21", "EventName": "UNC_H_SNOOP_RESP.RSPIFWD", - "PerPkg": "1", + "AggregationMode": "PerPkg", "ScaleUnit": "64Bytes", "UMask": "0x4", "Unit": "HA"
@@ -299,7 +299,7 @@ "Counter": "0,1,2,3", "EventCode": "0x21", "EventName": "UNC_H_SNOOP_RESP.RSPS", - "PerPkg": "1", + "AggregationMode": "PerPkg", "ScaleUnit": "64Bytes", "UMask": "0x2", "Unit": "HA"
@@ -309,7 +309,7 @@ "Counter": "0,1,2,3", "EventCode": "0x21", "EventName": "UNC_H_SNOOP_RESP.RSPSFWD", - "PerPkg": "1", + "AggregationMode": "PerPkg", "ScaleUnit": "64Bytes", "UMask": "0x8", "Unit": "HA"
tools/perf/pmu-events/arch/x86/broadwellde/uncore-memory.json +9 -9
@@ -4,7 +4,7 @@ "Counter": "0,1,2,3", "EventCode": "0x4", "EventName": "LLC_MISSES.MEM_READ", - "PerPkg": "1", + "AggregationMode": "PerPkg", "ScaleUnit": "64Bytes", "UMask": "0x3", "Unit": "iMC"
@@ -14,7 +14,7 @@ "Counter": "0,1,2,3", "EventCode": "0x4", "EventName": "LLC_MISSES.MEM_WRITE", - "PerPkg": "1", + "AggregationMode": "PerPkg", "ScaleUnit": "64Bytes", "UMask": "0xC", "Unit": "iMC"
@@ -23,7 +23,7 @@ "BriefDescription": "Memory controller clock ticks", "Counter": "0,1,2,3", "EventName": "UNC_M_DCLOCKTICKS", - "PerPkg": "1", + "AggregationMode": "PerPkg", "Unit": "iMC" }, {
@@ -33,7 +33,7 @@ "EventName": "UNC_M_POWER_CHANNEL_PPD", "MetricExpr": "(UNC_M_POWER_CHANNEL_PPD / UNC_M_DCLOCKTICKS) * 100.", "MetricName": "power_channel_ppd %", - "PerPkg": "1", + "AggregationMode": "PerPkg", "Unit": "iMC" }, {
@@ -43,7 +43,7 @@ "EventName": "UNC_M_POWER_CRITICAL_THROTTLE_CYCLES", "MetricExpr": "(UNC_M_POWER_CRITICAL_THROTTLE_CYCLES / UNC_M_DCLOCKTICKS) * 100.", "MetricName": "power_critical_throttle_cycles %", - "PerPkg": "1", + "AggregationMode": "PerPkg", "Unit": "iMC" }, {
@@ -53,7 +53,7 @@ "EventName": "UNC_M_POWER_SELF_REFRESH", "MetricExpr": "(UNC_M_POWER_SELF_REFRESH / UNC_M_DCLOCKTICKS) * 100.", "MetricName": "power_self_refresh %", - "PerPkg": "1", + "AggregationMode": "PerPkg", "Unit": "iMC" }, {
@@ -61,7 +61,7 @@ "Counter": "0,1,2,3", "EventCode": "0x2", "EventName": "UNC_M_PRE_COUNT.PAGE_MISS", - "PerPkg": "1", + "AggregationMode": "PerPkg", "UMask": "0x1", "Unit": "iMC" },
@@ -70,7 +70,7 @@ "Counter": "0,1,2,3", "EventCode": "0x2", "EventName": "UNC_M_PRE_COUNT.RD", - "PerPkg": "1", + "AggregationMode": "PerPkg", "UMask": "0x4", "Unit": "iMC" },
@@ -79,7 +79,7 @@ "Counter": "0,1,2,3", "EventCode": "0x2", "EventName": "UNC_M_PRE_COUNT.WR", - "PerPkg": "1", + "AggregationMode": "PerPkg", "UMask": "0x8", "Unit": "iMC" }
tools/perf/pmu-events/arch/x86/broadwellde/uncore-power.json +9 -9
@@ -3,7 +3,7 @@ "BriefDescription": "PCU clock ticks. Use to get percentages of PCU cycles events", "Counter": "0,1,2,3", "EventName": "UNC_P_CLOCKTICKS", - "PerPkg": "1", + "AggregationMode": "PerPkg", "Unit": "PCU" }, {
@@ -14,7 +14,7 @@ "Filter": "occ_sel=1", "MetricExpr": "(UNC_P_POWER_STATE_OCCUPANCY.CORES_C0 / UNC_P_CLOCKTICKS) * 100.", "MetricName": "power_state_occupancy.cores_c0 %", - "PerPkg": "1", + "AggregationMode": "PerPkg", "Unit": "PCU" }, {
@@ -25,7 +25,7 @@ "Filter": "occ_sel=2", "MetricExpr": "(UNC_P_POWER_STATE_OCCUPANCY.CORES_C3 / UNC_P_CLOCKTICKS) * 100.", "MetricName": "power_state_occupancy.cores_c3 %", - "PerPkg": "1", + "AggregationMode": "PerPkg", "Unit": "PCU" }, {
@@ -36,7 +36,7 @@ "Filter": "occ_sel=3", "MetricExpr": "(UNC_P_POWER_STATE_OCCUPANCY.CORES_C6 / UNC_P_CLOCKTICKS) * 100.", "MetricName": "power_state_occupancy.cores_c6 %", - "PerPkg": "1", + "AggregationMode": "PerPkg", "Unit": "PCU" }, {
@@ -46,7 +46,7 @@ "EventName": "UNC_P_PROCHOT_EXTERNAL_CYCLES", "MetricExpr": "(UNC_P_PROCHOT_EXTERNAL_CYCLES / UNC_P_CLOCKTICKS) * 100.", "MetricName": "prochot_external_cycles %", - "PerPkg": "1", + "AggregationMode": "PerPkg", "Unit": "PCU" }, {
@@ -56,7 +56,7 @@ "EventName": "UNC_P_FREQ_MAX_LIMIT_THERMAL_CYCLES", "MetricExpr": "(UNC_P_FREQ_MAX_LIMIT_THERMAL_CYCLES / UNC_P_CLOCKTICKS) * 100.", "MetricName": "freq_max_limit_thermal_cycles %", - "PerPkg": "1", + "AggregationMode": "PerPkg", "Unit": "PCU" }, {
@@ -66,7 +66,7 @@ "EventName": "UNC_P_FREQ_MAX_OS_CYCLES", "MetricExpr": "(UNC_P_FREQ_MAX_OS_CYCLES / UNC_P_CLOCKTICKS) * 100.", "MetricName": "freq_max_os_cycles %", - "PerPkg": "1", + "AggregationMode": "PerPkg", "Unit": "PCU" }, {
@@ -76,7 +76,7 @@ "EventName": "UNC_P_FREQ_MAX_POWER_CYCLES", "MetricExpr": "(UNC_P_FREQ_MAX_POWER_CYCLES / UNC_P_CLOCKTICKS) * 100.", "MetricName": "freq_max_power_cycles %", - "PerPkg": "1", + "AggregationMode": "PerPkg", "Unit": "PCU" }, {
@@ -86,7 +86,7 @@ "EventName": "UNC_P_FREQ_TRANS_CYCLES", "MetricExpr": "(UNC_P_FREQ_TRANS_CYCLES / UNC_P_CLOCKTICKS) * 100.", "MetricName": "freq_trans_cycles %", - "PerPkg": "1", + "AggregationMode": "PerPkg", "Unit": "PCU" } ]
tools/perf/pmu-events/arch/x86/broadwellx/uncore-cache.json +31 -31
248 lines not on this page · raw message
tools/perf/pmu-events/arch/x86/broadwellx/uncore-interconnect.json +3 -3
@@ -4,14 +4,14 @@ "Counter": "0,1,2,3", "EventCode": "0x14", "EventName": "UNC_Q_CLOCKTICKS", - "PerPkg": "1", + "AggregationMode": "PerPkg", "Unit": "QPI LL" }, { "BriefDescription": "Number of data flits transmitted . Derived from unc_q_txl_flits_g0.data", "Counter": "0,1,2,3", "EventName": "QPI_DATA_BANDWIDTH_TX", - "PerPkg": "1", + "AggregationMode": "PerPkg", "ScaleUnit": "8Bytes", "UMask": "0x2", "Unit": "QPI LL"
@@ -20,7 +20,7 @@ "BriefDescription": "Number of non data (control) flits transmitted . Derived from unc_q_txl_flits_g0.non_data", "Counter": "0,1,2,3", "EventName": "QPI_CTL_BANDWIDTH_TX", - "PerPkg": "1", + "AggregationMode": "PerPkg", "ScaleUnit": "8Bytes", "UMask": "0x4", "Unit": "QPI LL"
tools/perf/pmu-events/arch/x86/broadwellx/uncore-memory.json +9 -9
@@ -4,7 +4,7 @@ "Counter": "0,1,2,3", "EventCode": "0x4", "EventName": "LLC_MISSES.MEM_READ", - "PerPkg": "1", + "AggregationMode": "PerPkg", "ScaleUnit": "64Bytes", "UMask": "0x3", "Unit": "iMC"
@@ -14,7 +14,7 @@ "Counter": "0,1,2,3", "EventCode": "0x4", "EventName": "LLC_MISSES.MEM_WRITE", - "PerPkg": "1", + "AggregationMode": "PerPkg", "ScaleUnit": "64Bytes", "UMask": "0xC", "Unit": "iMC"
@@ -23,7 +23,7 @@ "BriefDescription": "Memory controller clock ticks", "Counter": "0,1,2,3", "EventName": "UNC_M_CLOCKTICKS", - "PerPkg": "1", + "AggregationMode": "PerPkg", "Unit": "iMC" }, {
@@ -33,7 +33,7 @@ "EventName": "UNC_M_POWER_CHANNEL_PPD", "MetricExpr": "(UNC_M_POWER_CHANNEL_PPD / UNC_M_CLOCKTICKS) * 100.", "MetricName": "power_channel_ppd %", - "PerPkg": "1", + "AggregationMode": "PerPkg", "Unit": "iMC" }, {
@@ -43,7 +43,7 @@ "EventName": "UNC_M_POWER_CRITICAL_THROTTLE_CYCLES", "MetricExpr": "(UNC_M_POWER_CRITICAL_THROTTLE_CYCLES / UNC_M_CLOCKTICKS) * 100.", "MetricName": "power_critical_throttle_cycles %", - "PerPkg": "1", + "AggregationMode": "PerPkg", "Unit": "iMC" }, {
@@ -53,7 +53,7 @@ "EventName": "UNC_M_POWER_SELF_REFRESH", "MetricExpr": "(UNC_M_POWER_SELF_REFRESH / UNC_M_CLOCKTICKS) * 100.", "MetricName": "power_self_refresh %", - "PerPkg": "1", + "AggregationMode": "PerPkg", "Unit": "iMC" }, {
@@ -61,7 +61,7 @@ "Counter": "0,1,2,3", "EventCode": "0x2", "EventName": "UNC_M_PRE_COUNT.PAGE_MISS", - "PerPkg": "1", + "AggregationMode": "PerPkg", "UMask": "0x1", "Unit": "iMC" },
@@ -70,7 +70,7 @@ "Counter": "0,1,2,3", "EventCode": "0x2", "EventName": "UNC_M_PRE_COUNT.RD", - "PerPkg": "1", + "AggregationMode": "PerPkg", "UMask": "0x4", "Unit": "iMC" },
@@ -79,7 +79,7 @@ "Counter": "0,1,2,3", "EventCode": "0x2", "EventName": "UNC_M_PRE_COUNT.WR", - "PerPkg": "1", + "AggregationMode": "PerPkg", "UMask": "0x8", "Unit": "iMC" }
tools/perf/pmu-events/arch/x86/broadwellx/uncore-power.json +9 -9
@@ -3,7 +3,7 @@ "BriefDescription": "PCU clock ticks. Use to get percentages of PCU cycles events", "Counter": "0,1,2,3", "EventName": "UNC_P_CLOCKTICKS", - "PerPkg": "1", + "AggregationMode": "PerPkg", "Unit": "PCU" }, {
@@ -14,7 +14,7 @@ "Filter": "occ_sel=1", "MetricExpr": "(UNC_P_POWER_STATE_OCCUPANCY.CORES_C0 / UNC_P_CLOCKTICKS) * 100.", "MetricName": "power_state_occupancy.cores_c0 %", - "PerPkg": "1", + "AggregationMode": "PerPkg", "Unit": "PCU" }, {
@@ -25,7 +25,7 @@ "Filter": "occ_sel=2", "MetricExpr": "(UNC_P_POWER_STATE_OCCUPANCY.CORES_C3 / UNC_P_CLOCKTICKS) * 100.", "MetricName": "power_state_occupancy.cores_c3 %", - "PerPkg": "1", + "AggregationMode": "PerPkg", "Unit": "PCU" }, {
@@ -36,7 +36,7 @@ "Filter": "occ_sel=3", "MetricExpr": "(UNC_P_POWER_STATE_OCCUPANCY.CORES_C6 / UNC_P_CLOCKTICKS) * 100.", "MetricName": "power_state_occupancy.cores_c6 %", - "PerPkg": "1", + "AggregationMode": "PerPkg", "Unit": "PCU" }, {
@@ -46,7 +46,7 @@ "EventName": "UNC_P_PROCHOT_EXTERNAL_CYCLES", "MetricExpr": "(UNC_P_PROCHOT_EXTERNAL_CYCLES / UNC_P_CLOCKTICKS) * 100.", "MetricName": "prochot_external_cycles %", - "PerPkg": "1", + "AggregationMode": "PerPkg", "Unit": "PCU" }, {
@@ -56,7 +56,7 @@ "EventName": "UNC_P_FREQ_MAX_LIMIT_THERMAL_CYCLES", "MetricExpr": "(UNC_P_FREQ_MAX_LIMIT_THERMAL_CYCLES / UNC_P_CLOCKTICKS) * 100.", "MetricName": "freq_max_limit_thermal_cycles %", - "PerPkg": "1", + "AggregationMode": "PerPkg", "Unit": "PCU" }, {
@@ -66,7 +66,7 @@ "EventName": "UNC_P_FREQ_MAX_OS_CYCLES", "MetricExpr": "(UNC_P_FREQ_MAX_OS_CYCLES / UNC_P_CLOCKTICKS) * 100.", "MetricName": "freq_max_os_cycles %", - "PerPkg": "1", + "AggregationMode": "PerPkg", "Unit": "PCU" }, {
@@ -76,7 +76,7 @@ "EventName": "UNC_P_FREQ_MAX_POWER_CYCLES", "MetricExpr": "(UNC_P_FREQ_MAX_POWER_CYCLES / UNC_P_CLOCKTICKS) * 100.", "MetricName": "freq_max_power_cycles %", - "PerPkg": "1", + "AggregationMode": "PerPkg", "Unit": "PCU" }, {
@@ -86,7 +86,7 @@ "EventName": "UNC_P_FREQ_TRANS_CYCLES", "MetricExpr": "(UNC_P_FREQ_TRANS_CYCLES / UNC_P_CLOCKTICKS) * 100.", "MetricName": "freq_trans_cycles %", - "PerPkg": "1", + "AggregationMode": "PerPkg", "Unit": "PCU" } ]
tools/perf/pmu-events/arch/x86/cascadelakex/uncore-memory.json +32 -32
256 lines not on this page · raw message
tools/perf/pmu-events/arch/x86/cascadelakex/uncore-other.json +166 -166
1,328 lines not on this page · raw message
tools/perf/pmu-events/arch/x86/haswellx/uncore-cache.json +31 -31
248 lines not on this page · raw message
tools/perf/pmu-events/arch/x86/haswellx/uncore-interconnect.json +3 -3
@@ -4,14 +4,14 @@ "Counter": "0,1,2,3", "EventCode": "0x14", "EventName": "UNC_Q_CLOCKTICKS", - "PerPkg": "1", + "AggregationMode": "PerPkg", "Unit": "QPI LL" }, { "BriefDescription": "Number of data flits transmitted . Derived from unc_q_txl_flits_g0.data", "Counter": "0,1,2,3", "EventName": "QPI_DATA_BANDWIDTH_TX", - "PerPkg": "1", + "AggregationMode": "PerPkg", "ScaleUnit": "8Bytes", "UMask": "0x2", "Unit": "QPI LL"
@@ -20,7 +20,7 @@ "BriefDescription": "Number of non data (control) flits transmitted . Derived from unc_q_txl_flits_g0.non_data", "Counter": "0,1,2,3", "EventName": "QPI_CTL_BANDWIDTH_TX", - "PerPkg": "1", + "AggregationMode": "PerPkg", "ScaleUnit": "8Bytes", "UMask": "0x4", "Unit": "QPI LL"
tools/perf/pmu-events/arch/x86/haswellx/uncore-memory.json +9 -9
@@ -4,7 +4,7 @@ "Counter": "0,1,2,3", "EventCode": "0x4", "EventName": "LLC_MISSES.MEM_READ", - "PerPkg": "1", + "AggregationMode": "PerPkg", "ScaleUnit": "64Bytes", "UMask": "0x3", "Unit": "iMC"
@@ -14,7 +14,7 @@ "Counter": "0,1,2,3", "EventCode": "0x4", "EventName": "LLC_MISSES.MEM_WRITE", - "PerPkg": "1", + "AggregationMode": "PerPkg", "ScaleUnit": "64Bytes", "UMask": "0xC", "Unit": "iMC"
@@ -23,7 +23,7 @@ "BriefDescription": "Memory controller clock ticks", "Counter": "0,1,2,3", "EventName": "UNC_M_CLOCKTICKS", - "PerPkg": "1", + "AggregationMode": "PerPkg", "Unit": "iMC" }, {
@@ -33,7 +33,7 @@ "EventName": "UNC_M_POWER_CHANNEL_PPD", "MetricExpr": "(UNC_M_POWER_CHANNEL_PPD / UNC_M_CLOCKTICKS) * 100.", "MetricName": "power_channel_ppd %", - "PerPkg": "1", + "AggregationMode": "PerPkg", "Unit": "iMC" }, {
@@ -43,7 +43,7 @@ "EventName": "UNC_M_POWER_CRITICAL_THROTTLE_CYCLES", "MetricExpr": "(UNC_M_POWER_CRITICAL_THROTTLE_CYCLES / UNC_M_CLOCKTICKS) * 100.", "MetricName": "power_critical_throttle_cycles %", - "PerPkg": "1", + "AggregationMode": "PerPkg", "Unit": "iMC" }, {
@@ -53,7 +53,7 @@ "EventName": "UNC_M_POWER_SELF_REFRESH", "MetricExpr": "(UNC_M_POWER_SELF_REFRESH / UNC_M_CLOCKTICKS) * 100.", "MetricName": "power_self_refresh %", - "PerPkg": "1", + "AggregationMode": "PerPkg", "Unit": "iMC" }, {
@@ -61,7 +61,7 @@ "Counter": "0,1,2,3", "EventCode": "0x2", "EventName": "UNC_M_PRE_COUNT.PAGE_MISS", - "PerPkg": "1", + "AggregationMode": "PerPkg", "UMask": "0x1", "Unit": "iMC" },
@@ -70,7 +70,7 @@ "Counter": "0,1,2,3", "EventCode": "0x2", "EventName": "UNC_M_PRE_COUNT.RD", - "PerPkg": "1", + "AggregationMode": "PerPkg", "UMask": "0x4", "Unit": "iMC" },
@@ -79,7 +79,7 @@ "Counter": "0,1,2,3", "EventCode": "0x2", "EventName": "UNC_M_PRE_COUNT.WR", - "PerPkg": "1", + "AggregationMode": "PerPkg", "UMask": "0x8", "Unit": "iMC" }
tools/perf/pmu-events/arch/x86/haswellx/uncore-power.json +9 -9
@@ -3,7 +3,7 @@ "BriefDescription": "PCU clock ticks. Use to get percentages of PCU cycles events", "Counter": "0,1,2,3", "EventName": "UNC_P_CLOCKTICKS", - "PerPkg": "1", + "AggregationMode": "PerPkg", "Unit": "PCU" }, {
@@ -14,7 +14,7 @@ "Filter": "occ_sel=1", "MetricExpr": "(UNC_P_POWER_STATE_OCCUPANCY.CORES_C0 / UNC_P_CLOCKTICKS) * 100.", "MetricName": "power_state_occupancy.cores_c0 %", - "PerPkg": "1", + "AggregationMode": "PerPkg", "Unit": "PCU" }, {
@@ -25,7 +25,7 @@ "Filter": "occ_sel=2", "MetricExpr": "(UNC_P_POWER_STATE_OCCUPANCY.CORES_C3 / UNC_P_CLOCKTICKS) * 100.", "MetricName": "power_state_occupancy.cores_c3 %", - "PerPkg": "1", + "AggregationMode": "PerPkg", "Unit": "PCU" }, {
@@ -36,7 +36,7 @@ "Filter": "occ_sel=3", "MetricExpr": "(UNC_P_POWER_STATE_OCCUPANCY.CORES_C6 / UNC_P_CLOCKTICKS) * 100.", "MetricName": "power_state_occupancy.cores_c6 %", - "PerPkg": "1", + "AggregationMode": "PerPkg", "Unit": "PCU" }, {
@@ -46,7 +46,7 @@ "EventName": "UNC_P_PROCHOT_EXTERNAL_CYCLES", "MetricExpr": "(UNC_P_PROCHOT_EXTERNAL_CYCLES / UNC_P_CLOCKTICKS) * 100.", "MetricName": "prochot_external_cycles %", - "PerPkg": "1", + "AggregationMode": "PerPkg", "Unit": "PCU" }, {
@@ -56,7 +56,7 @@ "EventName": "UNC_P_FREQ_MAX_LIMIT_THERMAL_CYCLES", "MetricExpr": "(UNC_P_FREQ_MAX_LIMIT_THERMAL_CYCLES / UNC_P_CLOCKTICKS) * 100.", "MetricName": "freq_max_limit_thermal_cycles %", - "PerPkg": "1", + "AggregationMode": "PerPkg", "Unit": "PCU" }, {
@@ -66,7 +66,7 @@ "EventName": "UNC_P_FREQ_MAX_OS_CYCLES", "MetricExpr": "(UNC_P_FREQ_MAX_OS_CYCLES / UNC_P_CLOCKTICKS) * 100.", "MetricName": "freq_max_os_cycles %", - "PerPkg": "1", + "AggregationMode": "PerPkg", "Unit": "PCU" }, {
@@ -76,7 +76,7 @@ "EventName": "UNC_P_FREQ_MAX_POWER_CYCLES", "MetricExpr": "(UNC_P_FREQ_MAX_POWER_CYCLES / UNC_P_CLOCKTICKS) * 100.", "MetricName": "freq_max_power_cycles %", - "PerPkg": "1", + "AggregationMode": "PerPkg", "Unit": "PCU" }, {
@@ -86,7 +86,7 @@ "EventName": "UNC_P_FREQ_TRANS_CYCLES", "MetricExpr": "(UNC_P_FREQ_TRANS_CYCLES / UNC_P_CLOCKTICKS) * 100.", "MetricName": "freq_trans_cycles %", - "PerPkg": "1", + "AggregationMode": "PerPkg", "Unit": "PCU" } ]
tools/perf/pmu-events/arch/x86/ivytown/uncore-cache.json +31 -31
192 lines not on this page · raw message
tools/perf/pmu-events/arch/x86/ivytown/uncore-interconnect.json +5 -5
Lines of this file are not shown. View the raw message.
tools/perf/pmu-events/arch/x86/ivytown/uncore-memory.json +8 -8
Lines of this file are not shown. View the raw message.
tools/perf/pmu-events/arch/x86/ivytown/uncore-power.json +26 -26
52 lines not on this page · raw message
tools/perf/pmu-events/arch/x86/jaketown/uncore-cache.json +20 -20
Lines of this file are not shown. View the raw message.
tools/perf/pmu-events/arch/x86/jaketown/uncore-interconnect.json +5 -5
Lines of this file are not shown. View the raw message.
tools/perf/pmu-events/arch/x86/jaketown/uncore-memory.json +9 -9
Lines of this file are not shown. View the raw message.
tools/perf/pmu-events/arch/x86/jaketown/uncore-power.json +26 -26
52 lines not on this page · raw message
tools/perf/pmu-events/arch/x86/knightslanding/uncore-memory.json +4 -4
Lines of this file are not shown. View the raw message.
tools/perf/pmu-events/arch/x86/skylakex/uncore-memory.json +18 -18
Lines of this file are not shown. View the raw message.
tools/perf/pmu-events/arch/x86/skylakex/uncore-other.json +110 -110
220 lines not on this page · raw message
tools/perf/pmu-events/arch/x86/tremontx/uncore-memory.json +7 -7
Lines of this file are not shown. View the raw message.
tools/perf/pmu-events/arch/x86/tremontx/uncore-other.json +35 -35
70 lines not on this page · raw message
tools/perf/pmu-events/arch/x86/tremontx/uncore-power.json +1 -1
Lines of this file are not shown. View the raw message.
The rest of this diff is not shown. View the raw message.
Signature · 1 line
2.26.2
Part of the diff is not shown here. View the raw message.
PATCH v4 3/5 perf jevents: Add support for parsing perchip/percore events
In reply to Kajol JainAdded 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.
--- tools/perf/pmu-events/jevents.c | 4 ++++ tools/perf/pmu-events/pmu-events.h | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-)
tools/perf/pmu-events/jevents.c +4 -0
@@ -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 ; }
tools/perf/pmu-events/pmu-events.h +3 -1
@@ -3,7 +3,9 @@#define PMU_EVENTS_H enum aggr_mode_class { - PerPkg =1 + PerPkg =1 , + PerChip, + PerCore };/*
Signature · 1 line
2.26.2
PATCH v4 4/5 perf/tools: Pass pmu_event structure as a parameter for arch_get_runtimeparam
In reply to Kajol JainThis patch adds passing of pmu_event as a parameter in function 'arch_get_runtimeparam' which can be used to get details like if the event is percore/perchip.
--- tools/perf/arch/powerpc/util/header.c | 7 +++++-- tools/perf/util/metricgroup.c | 5 ++--- tools/perf/util/metricgroup.h | 3 ++- 3 files changed, 9 insertions(+), 6 deletions(-)
tools/perf/arch/powerpc/util/header.c +5 -2
@@ -47,8 +47,11 @@ get_cpuid_str(struct perf_pmu *pmu __maybe_unused)return bufp; } -int arch_get_runtimeparam (void ) +int arch_get_runtimeparam (struct pmu_event *pe) {int count; -return sysfs__read_int ("/devices/hv_24x7/interface/sockets" , &count) <0 ?1 : count; +char path[PATH_MAX ] ="/devices/hv_24x7/interface/" ; + +atoi (pe->aggr_mode) == PerChip ?strcat (path,"sockets" ) :strcat (path,"coresperchip" ); +return sysfs__read_int (path, &count) <0 ?1 : count; }
tools/perf/util/metricgroup.c +2 -3
@@ -15,7 +15,6 @@#include "rblist.h" #include <string.h> #include <errno.h> -#include "pmu-events/pmu-events.h" #include "strlist.h" #include <assert.h> #include <linux/ctype.h>
@@ -566,7 +565,7 @@ static bool metricgroup__has_constraint(struct pmu_event *pe)return false; } -int __weak arch_get_runtimeparam (void ) +int __weak arch_get_runtimeparam (struct pmu_event *pe__maybe_unused ) {return 1 ; }
@@ -650,7 +649,7 @@ static int metricgroup__add_metric(const char *metric, bool metric_no_group, }else {int j, count; - count =arch_get_runtimeparam (); + count =arch_get_runtimeparam (pe);/* This loop is added to create multiple * events depend on count value and add
tools/perf/util/metricgroup.h +2 -1
@@ -5,6 +5,7 @@#include <linux/list.h> #include <linux/rbtree.h> #include <stdbool.h> +#include "pmu-events/pmu-events.h" struct evsel ;struct evlist ;
@@ -46,6 +47,6 @@ int metricgroup__parse_groups_test(struct evlist *evlist,void metricgroup__print (bool metrics,bool groups,char *filter,bool raw,bool details);bool metricgroup__has_metric (const char *metric); -int arch_get_runtimeparam (void ); +int arch_get_runtimeparam (struct pmu_event *pe__maybe_unused );void metricgroup__rblist_exit (struct rblist *metric_events);#endif
Signature · 1 line
2.26.2
PATCH v4 5/5 perf/tools/pmu_events/powerpc: Add hv_24x7 core level metric events
In reply to Kajol JainThis patch adds hv_24x7 core level events in nest_metric.json file and also add PerChip/PerCore field in metric events.
Result:
power9 platform:
command:# ./perf stat --metric-only -M PowerBUS_Frequency -C 0 -I 1000
1.000070601 1.9 2.0
2.000253881 2.0 1.9
3.000364810 2.0 2.0--- .../arch/powerpc/power9/nest_metrics.json | 27 ++++++++++++------- 1 file changed, 18 insertions(+), 9 deletions(-)
tools/perf/pmu-events/arch/powerpc/power9/nest_metrics.json +18 -9
@@ -1,20 +1,29 @@ [ { - "MetricExpr": "(hv_24x7@PM_MCS01_128B_RD_DISP_PORT01\\,chip\\=?@ + hv_24x7@PM_MCS01_128B_RD_DISP_PORT23\\,chip\\=?@ + hv_24x7@PM_MCS23_128B_RD_DISP_PORT01\\,chip\\=?@ + hv_24x7@PM_MCS23_128B_RD_DISP_PORT23\\,chip\\=?@)", - "MetricName": "Memory_RD_BW_Chip", - "MetricGroup": "Memory_BW", - "ScaleUnit": "1.6e-2MB" + "MetricExpr": "(hv_24x7@PM_MCS01_128B_RD_DISP_PORT01\\,chip\\=?@ + hv_24x7@PM_MCS01_128B_RD_DISP_PORT23\\,chip\\=?@ + hv_24x7@PM_MCS23_128B_RD_DISP_PORT01\\,chip\\=?@ + hv_24x7@PM_MCS23_128B_RD_DISP_PORT23\\,chip\\=?@)", + "MetricName": "Memory_RD_BW_Chip", + "MetricGroup": "Memory_BW", + "ScaleUnit": "1.6e-2MB", + "AggregationMode": "PerChip" }, { "MetricExpr": "(hv_24x7@PM_MCS01_128B_WR_DISP_PORT01\\,chip\\=?@ + hv_24x7@PM_MCS01_128B_WR_DISP_PORT23\\,chip\\=?@ + hv_24x7@PM_MCS23_128B_WR_DISP_PORT01\\,chip\\=?@ + hv_24x7@PM_MCS23_128B_WR_DISP_PORT23\\,chip\\=?@ )", - "MetricName": "Memory_WR_BW_Chip", - "MetricGroup": "Memory_BW", - "ScaleUnit": "1.6e-2MB" + "MetricName": "Memory_WR_BW_Chip", + "MetricGroup": "Memory_BW", + "ScaleUnit": "1.6e-2MB", + "AggregationMode": "PerChip" }, { "MetricExpr": "(hv_24x7@PM_PB_CYC\\,chip\\=?@ )", - "MetricName": "PowerBUS_Frequency", - "ScaleUnit": "2.5e-7GHz" + "MetricName": "PowerBUS_Frequency", + "ScaleUnit": "2.5e-7GHz", + "AggregationMode": "PerChip" + }, + { + "MetricExpr": "(hv_24x7@CPM_CS_32MHZ_CYC\\,domain\\=3\\,core\\=?@ )", + "MetricName": "CPM_CS_32MHZ_CYC", + "ScaleUnit": "1MHz", + "AggregationMode": "PerCore" }, { "MetricExpr" : "nest_mcs01_imc@PM_MCS01_128B_RD_DISP_PORT01@ + nest_mcs01_imc@PM_MCS01_128B_RD_DISP_PORT23@",
Signature · 1 line
2.26.2
Quoted 22 lines · Kajol Jain
Patchset enhance current runtime parameter support. It introduces new fields like "PerChip" and "PerCore" similar to the field "PerPkg" which is used to specify perpkg events.
The "PerCore" and "PerChip" specifies whether its core or chip events. Based on which we can decide which runtime parameter user want to access. Now character '?' can refers different parameter based on user requirement.
Initially, every time we want to add new terms like chip, core, thread etc, we need to create corrsponding fields in
pmu_eventsand event struct.
This patchset adds an enum called 'aggr_mode_class' which store all these aggregation like perpkg/percore. It also adds new field 'AggregationMode' to capture these terms.
Now, if user wants to add any new term, they just need to add it in the enum defined. I try to test it with my current setup.I also need to replace PerPkg field to AggregationMode in all the x86 uncore json files. It will great if Andi and team can test it and let me know if they have any concerns.
Quoted 5 lines
Changelog:
v3 -> v4:
- Includepmu-events.hheader file injevents.cand remove redecalaration of enumaggr_mode_classas Suggested by Jiri.
- Add Acked-by tag.
looks good to me, but still missing reaction from people maintaining intel's jsons
jirka
Arnaldo Carvalho de Melo
maintainerEm Mon, Jul 20, 2020 at 09:21:33PM +0200, Jiri Olsa escreveu:
Quoted 23 lines · Kajol Jain
Quoted 22 lines
Patchset enhance current runtime parameter support. It introduces new fields like "PerChip" and "PerCore" similar to the field "PerPkg" which is used to specify perpkg events.
The "PerCore" and "PerChip" specifies whether its core or chip events. Based on which we can decide which runtime parameter user want to access. Now character '?' can refers different parameter based on user requirement.
Initially, every time we want to add new terms like chip, core, thread etc, we need to create corrsponding fields in
pmu_eventsand event struct.
This patchset adds an enum called 'aggr_mode_class' which store all these aggregation like perpkg/percore. It also adds new field 'AggregationMode' to capture these terms.
Now, if user wants to add any new term, they just need to add it in the enum defined. I try to test it with my current setup.I also need to replace PerPkg field to AggregationMode in all the x86 uncore json files. It will great if Andi and team can test it and let me know if they have any concerns.
Quoted 8 lines
Quoted 5 lines
Changelog:
v3 -> v4:
- Includepmu-events.hheader file injevents.cand remove redecalaration of enumaggr_mode_classas Suggested by Jiri.
- Add Acked-by tag.looks good to me, but still missing reaction from people maintaining intel's jsons
Yeah, since this is something trying to be generic enough to describe events from different arches, we should not double-fail into generalizing this :-\
- Arnaldo
Quoted 30 lines · Arnaldo Carvalho de Melo
Em Mon, Jul 20, 2020 at 09:21:33PM +0200, Jiri Olsa escreveu:
Quoted 29 lines · Kajol Jain
Quoted 27 lines
Patchset enhance current runtime parameter support. It introduces new fields like "PerChip" and "PerCore" similar to the field "PerPkg" which is used to specify perpkg events.
The "PerCore" and "PerChip" specifies whether its core or chip events. Based on which we can decide which runtime parameter user want to access. Now character '?' can refers different parameter based on user requirement.
Initially, every time we want to add new terms like chip, core, thread etc, we need to create corrsponding fields in
pmu_eventsand event struct.
This patchset adds an enum called 'aggr_mode_class' which store all these aggregation like perpkg/percore. It also adds new field 'AggregationMode' to capture these terms.
Now, if user wants to add any new term, they just need to add it in the enum defined. I try to test it with my current setup.I also need to replace PerPkg field to AggregationMode in all the x86 uncore json files. It will great if Andi and team can test it and let me know if they have any concerns.
Changelog:
v3 -> v4:
- Includepmu-events.hheader file injevents.cand remove redecalaration of enumaggr_mode_classas Suggested by Jiri.
- Add Acked-by tag.
Quoted 6 lines
Quoted 2 lines
looks good to me, but still missing reaction from people maintaining intel's jsons
Yeah, since this is something trying to be generic enough to describe events from different arches, we should not double-fail into generalizing this :-\
Hi,
Yes that make sense. In this patchset we are not doing any logical change from intel side,
as in all the json file "PerPkg" value map to '1', we are using same value in the enum to not break that use case. And just replacing 'PerPkg' to new added field `AggregationMode'.
But you are right, it will be good to have Ack from intel people. Any comments how we can push these changes?
Thanks,
Kajol Jain
Quoted 3 lines
- Arnaldo