perf vendor events intel: Metric fixes for SKX/CLX
PATCH 1/3 perf vendor events intel: Metric fixes for SKX/CLX
From: Andi Kleen <[email protected]>
- Add a missing filter for the DRAM_Latency / DRAM_Parallel_Reads metrics
- Remove the useless PMM_* metrics from Skylake
--- .../arch/x86/cascadelakex/clx-metrics.json | 4 ++-- .../arch/x86/skylakex/skx-metrics.json | 22 ++----------------- 2 files changed, 4 insertions(+), 22 deletions(-)
tools/perf/pmu-events/arch/x86/cascadelakex/clx-metrics.json +2 -2
@@ -314,13 +314,13 @@ "MetricName": "DRAM_BW_Use" }, { - "MetricExpr": "1000000000 * ( cha@event\\=0x36\\\\\\,umask\\=0x21@ / cha@event\\=0x35\\\\\\,umask\\=0x21@ ) / ( cha_0@event\\=0x0@ / duration_time )", + "MetricExpr": "1000000000 * ( cha@event\\=0x36\\\\\\,umask\\=0x21\\\\\\,config\\=0x40433@ / cha@event\\=0x35\\\\\\,umask\\=0x21\\\\\\,config\\=0x40433@ ) / ( cha_0@event\\=0x0@ / duration_time )", "BriefDescription": "Average latency of data read request to external memory (in nanoseconds). Accounts for demand loads and L1/L2 prefetches", "MetricGroup": "Memory_Lat", "MetricName": "DRAM_Read_Latency" }, { - "MetricExpr": "cha@event\\=0x36\\\\\\,umask\\=0x21@ / cha@event\\=0x36\\\\\\,umask\\=0x21\\\\\\,thresh\\=1@", + "MetricExpr": "cha@event\\=0x36\\\\\\,umask\\=0x21\\\\\\,config\\=0x40433@ / cha@event\\=0x36\\\\\\,umask\\=0x21\\\\\\,thresh\\=1\\\\\\,config\\=0x40433@", "BriefDescription": "Average number of parallel data read requests to external memory. Accounts for demand loads and L1/L2 prefetches", "MetricGroup": "Memory_BW", "MetricName": "DRAM_Parallel_Reads"
tools/perf/pmu-events/arch/x86/skylakex/skx-metrics.json +2 -20
@@ -314,35 +314,17 @@ "MetricName": "DRAM_BW_Use" }, { - "MetricExpr": "1000000000 * ( cha@event\\=0x36\\\\\\,umask\\=0x21@ / cha@event\\=0x35\\\\\\,umask\\=0x21@ ) / ( cha_0@event\\=0x0@ / duration_time )", + "MetricExpr": "1000000000 * ( cha@event\\=0x36\\\\\\,umask\\=0x21\\\\\\,config\\=0x40433@ / cha@event\\=0x35\\\\\\,umask\\=0x21\\\\\\,config\\=0x40433@ ) / ( cha_0@event\\=0x0@ / duration_time )", "BriefDescription": "Average latency of data read request to external memory (in nanoseconds). Accounts for demand loads and L1/L2 prefetches", "MetricGroup": "Memory_Lat", "MetricName": "DRAM_Read_Latency" }, { - "MetricExpr": "cha@event\\=0x36\\\\\\,umask\\=0x21@ / cha@event\\=0x36\\\\\\,umask\\=0x21\\\\\\,thresh\\=1@", + "MetricExpr": "cha@event\\=0x36\\\\\\,umask\\=0x21\\\\\\,config\\=0x40433@ / cha@event\\=0x36\\\\\\,umask\\=0x21\\\\\\,thresh\\=1\\\\\\,config\\=0x40433@", "BriefDescription": "Average number of parallel data read requests to external memory. Accounts for demand loads and L1/L2 prefetches", "MetricGroup": "Memory_BW", "MetricName": "DRAM_Parallel_Reads" }, - { - "MetricExpr": "( 1000000000 * ( imc@event\\=0xe0\\\\\\,umask\\=0x1@ / imc@event\\=0xe3@ ) / imc_0@event\\=0x0@ ) if 1 if 0 == 1 else 0 else 0", - "BriefDescription": "Average latency of data read request to external 3D X-Point memory [in nanoseconds]. Accounts for demand loads and L1/L2 data-read prefetches", - "MetricGroup": "Memory_Lat", - "MetricName": "MEM_PMM_Read_Latency" - }, - { - "MetricExpr": "( ( 64 * imc@event\\=0xe3@ / 1000000000 ) / duration_time ) if 1 if 0 == 1 else 0 else 0", - "BriefDescription": "Average 3DXP Memory Bandwidth Use for reads [GB / sec]", - "MetricGroup": "Memory_BW", - "MetricName": "PMM_Read_BW" - }, - { - "MetricExpr": "( ( 64 * imc@event\\=0xe7@ / 1000000000 ) / duration_time ) if 1 if 0 == 1 else 0 else 0", - "BriefDescription": "Average 3DXP Memory Bandwidth Use for Writes [GB / sec]", - "MetricGroup": "Memory_BW", - "MetricName": "PMM_Write_BW" - }, { "MetricExpr": "cha_0@event\\=0x0@", "BriefDescription": "Socket actual clocks when any core is active on that socket",
Signature · 1 line
2.20.1
PATCH 2/3 perf list: Avoid extra : for --raw metrics
From: Andi Kleen <[email protected]>
When printing the metrics raw, don't print : after the metricgroups. This helps the command line completion to complete those too.
--- tools/perf/util/metricgroup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/util/metricgroup.c +1 -1
@@ -376,7 +376,7 @@ void metricgroup__print(bool metrics, bool metricgroups, char *filter, struct mep *me = container_of(node, struct mep, nd);if (metricgroups) -printf ("%s%s%s" , me->name, metrics ?":" :"" , raw ?" " :"\n" ); +printf ("%s%s%s" , me->name, metrics && !raw ?":" :"" , raw ?" " :"\n" );if (metrics)metricgroup__print_strlist (me->metrics, raw); next =rb_next (node);
Signature · 1 line
2.20.1
tip-bot for Andi Kleen
merge bot[tip:perf/core] perf list: Avoid extra : for --raw metrics
perf list: Avoid extra : for --raw metrics
Commit-ID: 9c344d15f5783260f57c711f3fce72dd744bebe2 Gitweb: https://git.kernel.org/tip/9c344d15f5783260f57c711f3fce72dd744bebe2 Author: Andi Kleen <[email protected]> AuthorDate: Fri, 28 Jun 2019 15:07:36 -0700 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitDate: Tue, 2 Jul 2019 16:08:16 -0300
perf list: Avoid extra : for --raw metrics
When printing the metrics raw, don't print : after the metricgroups. This helps the command line completion to complete those too.
--- tools/perf/util/metricgroup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/util/metricgroup.c +1 -1
@@ -375,7 +375,7 @@ void metricgroup__print(bool metrics, bool metricgroups, char *filter, struct mep *me = container_of(node, struct mep, nd);if (metricgroups) -printf ("%s%s%s" , me->name, metrics ?":" :"" , raw ?" " :"\n" ); +printf ("%s%s%s" , me->name, metrics && !raw ?":" :"" , raw ?" " :"\n" );if (metrics)metricgroup__print_strlist (me->metrics, raw); next =rb_next (node);
PATCH 3/3 perf tools metric: Don't include duration_time in group
In reply to Andi KleenFrom: Andi Kleen <[email protected]>
The Memory_BW metric generates groups including duration_time, which maps to a software event.
For some reason this makes the group always not count.
Always put duration_time outside a group when generating metrics. It's always the same time, so no need to group it.
--- tools/perf/util/metricgroup.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-)
tools/perf/util/metricgroup.c +17 -2
@@ -410,6 +410,7 @@ static int metricgroup__add_metric(const char *metric, struct strbuf *events,const char **ids;int idnum;struct egroup *eg; +bool no_group = false;pr_debug ("metric expr %s for %s\n" , pe->metric_expr, pe->metric_name);
@@ -420,11 +421,25 @@ static int metricgroup__add_metric(const char *metric, struct strbuf *events,strbuf_addf (events,"," );for (j =0 ; j < idnum; j++) {pr_debug ("found event %s\n" , ids[j]); +/* +* Duration time maps to a software event and can make +* groups not count. Always use it outside a +* group. +*/ +if (!strcmp (ids[j],"duration_time" )) { +if (j >0 ) +strbuf_addf (events,"}:W," ); +strbuf_addf (events,"duration_time" ); + no_group = true; +continue ; + }strbuf_addf (events,"%s%s" , - j ==0 ?"{" :"," , + j ==0 || no_group ?"{" :"," , ids[j]); + no_group = false; } -strbuf_addf (events,"}:W" ); +if (!no_group) +strbuf_addf (events,"}:W" ); eg =malloc (sizeof (struct egroup ));if (!eg) {
Signature · 1 line
2.20.1
tip-bot for Andi Kleen
merge bot[tip:perf/core] perf tools metric: Don't include duration_time in group
perf tools metric: Don't include duration_time in group
Commit-ID: 488c3bf7ece89e47887607863207021283e37828 Gitweb: https://git.kernel.org/tip/488c3bf7ece89e47887607863207021283e37828 Author: Andi Kleen <[email protected]> AuthorDate: Fri, 28 Jun 2019 15:07:37 -0700 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitDate: Tue, 2 Jul 2019 16:08:16 -0300
perf tools metric: Don't include duration_time in group
The Memory_BW metric generates groups including duration_time, which maps to a software event.
For some reason this makes the group always not count.
Always put duration_time outside a group when generating metrics. It's always the same time, so no need to group it.
--- tools/perf/util/metricgroup.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-)
tools/perf/util/metricgroup.c +17 -2
@@ -409,6 +409,7 @@ static int metricgroup__add_metric(const char *metric, struct strbuf *events,const char **ids;int idnum;struct egroup *eg; +bool no_group = false;pr_debug ("metric expr %s for %s\n" , pe->metric_expr, pe->metric_name);
@@ -419,11 +420,25 @@ static int metricgroup__add_metric(const char *metric, struct strbuf *events,strbuf_addf (events,"," );for (j =0 ; j < idnum; j++) {pr_debug ("found event %s\n" , ids[j]); +/* +* Duration time maps to a software event and can make +* groups not count. Always use it outside a +* group. +*/ +if (!strcmp (ids[j],"duration_time" )) { +if (j >0 ) +strbuf_addf (events,"}:W," ); +strbuf_addf (events,"duration_time" ); + no_group = true; +continue ; + }strbuf_addf (events,"%s%s" , - j ==0 ?"{" :"," , + j ==0 || no_group ?"{" :"," , ids[j]); + no_group = false; } -strbuf_addf (events,"}:W" ); +if (!no_group) +strbuf_addf (events,"}:W" ); eg =malloc (sizeof (struct egroup ));if (!eg) {
Arnaldo Carvalho de Melo
AppliedEm Fri, Jun 28, 2019 at 03:07:35PM -0700, Andi Kleen escreveu:
Quoted 1 line
From: Andi Kleen <[email protected]>
Thanks, applied the three patches.
- Arnaldo
Quoted 73 lines
- Add a missing filter for the
DRAM_Latency/DRAM_Parallel_Readsmetrics
- Remove the useless PMM_* metrics from SkylakeSigned-off-by Andi Kleen <[email protected]>--- .../arch/x86/cascadelakex/clx-metrics.json | 4 ++-- .../arch/x86/skylakex/skx-metrics.json | 22 ++----------------- 2 files changed, 4 insertions(+), 22 deletions(-)tools/perf/pmu-events/arch/x86/cascadelakex/clx-metrics.json +2
-2@@ -314,13 +314,13 @@ "MetricName": "DRAM_BW_Use" }, { - "MetricExpr": "1000000000 * ( cha@event\\=0x36\\\\\\,umask\\=0x21@ / cha@event\\=0x35\\\\\\,umask\\=0x21@ ) / ( cha_0@event\\=0x0@ / duration_time )", + "MetricExpr": "1000000000 * ( cha@event\\=0x36\\\\\\,umask\\=0x21\\\\\\,config\\=0x40433@ / cha@event\\=0x35\\\\\\,umask\\=0x21\\\\\\,config\\=0x40433@ ) / ( cha_0@event\\=0x0@ / duration_time )", "BriefDescription": "Average latency of data read request to external memory (in nanoseconds). Accounts for demand loads and L1/L2 prefetches", "MetricGroup": "Memory_Lat", "MetricName": "DRAM_Read_Latency" }, { - "MetricExpr": "cha@event\\=0x36\\\\\\,umask\\=0x21@ / cha@event\\=0x36\\\\\\,umask\\=0x21\\\\\\,thresh\\=1@", + "MetricExpr": "cha@event\\=0x36\\\\\\,umask\\=0x21\\\\\\,config\\=0x40433@ / cha@event\\=0x36\\\\\\,umask\\=0x21\\\\\\,thresh\\=1\\\\\\,config\\=0x40433@", "BriefDescription": "Average number of parallel data read requests to external memory. Accounts for demand loads and L1/L2 prefetches", "MetricGroup": "Memory_BW", "MetricName": "DRAM_Parallel_Reads"tools/perf/pmu-events/arch/x86/skylakex/skx-metrics.json +2
-20@@ -314,35 +314,17 @@ "MetricName": "DRAM_BW_Use" }, { - "MetricExpr": "1000000000 * ( cha@event\\=0x36\\\\\\,umask\\=0x21@ / cha@event\\=0x35\\\\\\,umask\\=0x21@ ) / ( cha_0@event\\=0x0@ / duration_time )", + "MetricExpr": "1000000000 * ( cha@event\\=0x36\\\\\\,umask\\=0x21\\\\\\,config\\=0x40433@ / cha@event\\=0x35\\\\\\,umask\\=0x21\\\\\\,config\\=0x40433@ ) / ( cha_0@event\\=0x0@ / duration_time )", "BriefDescription": "Average latency of data read request to external memory (in nanoseconds). Accounts for demand loads and L1/L2 prefetches", "MetricGroup": "Memory_Lat", "MetricName": "DRAM_Read_Latency" }, { - "MetricExpr": "cha@event\\=0x36\\\\\\,umask\\=0x21@ / cha@event\\=0x36\\\\\\,umask\\=0x21\\\\\\,thresh\\=1@", + "MetricExpr": "cha@event\\=0x36\\\\\\,umask\\=0x21\\\\\\,config\\=0x40433@ / cha@event\\=0x36\\\\\\,umask\\=0x21\\\\\\,thresh\\=1\\\\\\,config\\=0x40433@", "BriefDescription": "Average number of parallel data read requests to external memory. Accounts for demand loads and L1/L2 prefetches", "MetricGroup": "Memory_BW", "MetricName": "DRAM_Parallel_Reads" }, - { - "MetricExpr": "( 1000000000 * ( imc@event\\=0xe0\\\\\\,umask\\=0x1@ / imc@event\\=0xe3@ ) / imc_0@event\\=0x0@ ) if 1 if 0 == 1 else 0 else 0", - "BriefDescription": "Average latency of data read request to external 3D X-Point memory [in nanoseconds]. Accounts for demand loads and L1/L2 data-read prefetches", - "MetricGroup": "Memory_Lat", - "MetricName": "MEM_PMM_Read_Latency" - }, - { - "MetricExpr": "( ( 64 * imc@event\\=0xe3@ / 1000000000 ) / duration_time ) if 1 if 0 == 1 else 0 else 0", - "BriefDescription": "Average 3DXP Memory Bandwidth Use for reads [GB / sec]", - "MetricGroup": "Memory_BW", - "MetricName": "PMM_Read_BW" - }, - { - "MetricExpr": "( ( 64 * imc@event\\=0xe7@ / 1000000000 ) / duration_time ) if 1 if 0 == 1 else 0 else 0", - "BriefDescription": "Average 3DXP Memory Bandwidth Use for Writes [GB / sec]", - "MetricGroup": "Memory_BW", - "MetricName": "PMM_Write_BW" - }, { "MetricExpr": "cha_0@event\\=0x0@", "BriefDescription": "Socket actual clocks when any core is active on that socket",Signature · 1 line
2.20.1
Signature · 1 line
- Arnaldo
tip-bot for Andi Kleen
merge botperf vendor events intel: Metric fixes for SKX/CLX
Commit-ID: 4df79ba3eb1b82e2939fb984b36a0e71bbed611b Gitweb: https://git.kernel.org/tip/4df79ba3eb1b82e2939fb984b36a0e71bbed611b Author: Andi Kleen <[email protected]> AuthorDate: Fri, 28 Jun 2019 15:07:35 -0700 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitDate: Tue, 2 Jul 2019 16:08:16 -0300
perf vendor events intel: Metric fixes for SKX/CLX
- Add a missing filter for the DRAM_Latency / DRAM_Parallel_Reads metrics
- Remove the useless PMM_* metrics from Skylake
--- .../arch/x86/cascadelakex/clx-metrics.json | 4 ++-- .../pmu-events/arch/x86/skylakex/skx-metrics.json | 22 ++-------------------- 2 files changed, 4 insertions(+), 22 deletions(-)
tools/perf/pmu-events/arch/x86/cascadelakex/clx-metrics.json +2 -2
@@ -314,13 +314,13 @@ "MetricName": "DRAM_BW_Use" }, { - "MetricExpr": "1000000000 * ( cha@event\\=0x36\\\\\\,umask\\=0x21@ / cha@event\\=0x35\\\\\\,umask\\=0x21@ ) / ( cha_0@event\\=0x0@ / duration_time )", + "MetricExpr": "1000000000 * ( cha@event\\=0x36\\\\\\,umask\\=0x21\\\\\\,config\\=0x40433@ / cha@event\\=0x35\\\\\\,umask\\=0x21\\\\\\,config\\=0x40433@ ) / ( cha_0@event\\=0x0@ / duration_time )", "BriefDescription": "Average latency of data read request to external memory (in nanoseconds). Accounts for demand loads and L1/L2 prefetches", "MetricGroup": "Memory_Lat", "MetricName": "DRAM_Read_Latency" }, { - "MetricExpr": "cha@event\\=0x36\\\\\\,umask\\=0x21@ / cha@event\\=0x36\\\\\\,umask\\=0x21\\\\\\,thresh\\=1@", + "MetricExpr": "cha@event\\=0x36\\\\\\,umask\\=0x21\\\\\\,config\\=0x40433@ / cha@event\\=0x36\\\\\\,umask\\=0x21\\\\\\,thresh\\=1\\\\\\,config\\=0x40433@", "BriefDescription": "Average number of parallel data read requests to external memory. Accounts for demand loads and L1/L2 prefetches", "MetricGroup": "Memory_BW", "MetricName": "DRAM_Parallel_Reads"
tools/perf/pmu-events/arch/x86/skylakex/skx-metrics.json +2 -20
@@ -314,35 +314,17 @@ "MetricName": "DRAM_BW_Use" }, { - "MetricExpr": "1000000000 * ( cha@event\\=0x36\\\\\\,umask\\=0x21@ / cha@event\\=0x35\\\\\\,umask\\=0x21@ ) / ( cha_0@event\\=0x0@ / duration_time )", + "MetricExpr": "1000000000 * ( cha@event\\=0x36\\\\\\,umask\\=0x21\\\\\\,config\\=0x40433@ / cha@event\\=0x35\\\\\\,umask\\=0x21\\\\\\,config\\=0x40433@ ) / ( cha_0@event\\=0x0@ / duration_time )", "BriefDescription": "Average latency of data read request to external memory (in nanoseconds). Accounts for demand loads and L1/L2 prefetches", "MetricGroup": "Memory_Lat", "MetricName": "DRAM_Read_Latency" }, { - "MetricExpr": "cha@event\\=0x36\\\\\\,umask\\=0x21@ / cha@event\\=0x36\\\\\\,umask\\=0x21\\\\\\,thresh\\=1@", + "MetricExpr": "cha@event\\=0x36\\\\\\,umask\\=0x21\\\\\\,config\\=0x40433@ / cha@event\\=0x36\\\\\\,umask\\=0x21\\\\\\,thresh\\=1\\\\\\,config\\=0x40433@", "BriefDescription": "Average number of parallel data read requests to external memory. Accounts for demand loads and L1/L2 prefetches", "MetricGroup": "Memory_BW", "MetricName": "DRAM_Parallel_Reads" }, - { - "MetricExpr": "( 1000000000 * ( imc@event\\=0xe0\\\\\\,umask\\=0x1@ / imc@event\\=0xe3@ ) / imc_0@event\\=0x0@ ) if 1 if 0 == 1 else 0 else 0", - "BriefDescription": "Average latency of data read request to external 3D X-Point memory [in nanoseconds]. Accounts for demand loads and L1/L2 data-read prefetches", - "MetricGroup": "Memory_Lat", - "MetricName": "MEM_PMM_Read_Latency" - }, - { - "MetricExpr": "( ( 64 * imc@event\\=0xe3@ / 1000000000 ) / duration_time ) if 1 if 0 == 1 else 0 else 0", - "BriefDescription": "Average 3DXP Memory Bandwidth Use for reads [GB / sec]", - "MetricGroup": "Memory_BW", - "MetricName": "PMM_Read_BW" - }, - { - "MetricExpr": "( ( 64 * imc@event\\=0xe7@ / 1000000000 ) / duration_time ) if 1 if 0 == 1 else 0 else 0", - "BriefDescription": "Average 3DXP Memory Bandwidth Use for Writes [GB / sec]", - "MetricGroup": "Memory_BW", - "MetricName": "PMM_Write_BW" - }, { "MetricExpr": "cha_0@event\\=0x0@", "BriefDescription": "Socket actual clocks when any core is active on that socket",