linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] perf stat: Capitalize topdown metrics' names
@ 2022-08-25  1:54 zhengjun.xing
  2022-08-26 20:54 ` Ian Rogers
  0 siblings, 1 reply; 3+ messages in thread
From: zhengjun.xing @ 2022-08-25  1:54 UTC (permalink / raw)
  To: acme, peterz, mingo, alexander.shishkin, jolsa, namhyung
  Cc: linux-kernel, linux-perf-users, irogers, ak, kan.liang,
	zhengjun.xing

From: Zhengjun Xing <zhengjun.xing@linux.intel.com>

Capitalize topdown metrics' names to follow the intel SDM.

Before:

 # ./perf stat -a  sleep 1

 Performance counter stats for 'system wide':

        228,094.05 msec cpu-clock                        #  225.026 CPUs utilized
               842      context-switches                 #    3.691 /sec
               224      cpu-migrations                   #    0.982 /sec
                70      page-faults                      #    0.307 /sec
        23,164,105      cycles                           #    0.000 GHz
        29,403,446      instructions                     #    1.27  insn per cycle
         5,268,185      branches                         #   23.097 K/sec
            33,239      branch-misses                    #    0.63% of all branches
       136,248,990      slots                            #  597.337 K/sec
        32,976,450      topdown-retiring                 #     24.2% retiring
         4,651,918      topdown-bad-spec                 #      3.4% bad speculation
        26,148,695      topdown-fe-bound                 #     19.2% frontend bound
        72,515,776      topdown-be-bound                 #     53.2% backend bound
         6,008,540      topdown-heavy-ops                #      4.4% heavy operations       #     19.8% light operations
         3,934,049      topdown-br-mispredict            #      2.9% branch mispredict      #      0.5% machine clears
        16,655,439      topdown-fetch-lat                #     12.2% fetch latency          #      7.0% fetch bandwidth
        41,635,972      topdown-mem-bound                #     30.5% memory bound           #     22.7% Core bound

       1.013634593 seconds time elapsed

After:

 # ./perf stat -a  sleep 1

 Performance counter stats for 'system wide':

        228,081.94 msec cpu-clock                        #  225.003 CPUs utilized
               824      context-switches                 #    3.613 /sec
               224      cpu-migrations                   #    0.982 /sec
                67      page-faults                      #    0.294 /sec
        22,647,423      cycles                           #    0.000 GHz
        28,870,551      instructions                     #    1.27  insn per cycle
         5,167,099      branches                         #   22.655 K/sec
            32,383      branch-misses                    #    0.63% of all branches
       133,411,074      slots                            #  584.926 K/sec
        32,352,607      topdown-retiring                 #     24.3% Retiring
         4,456,977      topdown-bad-spec                 #      3.3% Bad Speculation
        25,626,487      topdown-fe-bound                 #     19.2% Frontend Bound
        70,955,316      topdown-be-bound                 #     53.2% Backend Bound
         5,834,844      topdown-heavy-ops                #      4.4% Heavy Operations       #     19.9% Light Operations
         3,738,781      topdown-br-mispredict            #      2.8% Branch Mispredict      #      0.5% Machine Clears
        16,286,803      topdown-fetch-lat                #     12.2% Fetch Latency          #      7.0% Fetch Bandwidth
        40,802,069      topdown-mem-bound                #     30.6% Memory Bound           #     22.6% Core Bound

       1.013683125 seconds time elapsed

Signed-off-by: Zhengjun Xing <zhengjun.xing@linux.intel.com>
Reviewed-by: Kan Liang <kan.liang@linux.intel.com>
---
 tools/perf/util/stat-shadow.c | 24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/tools/perf/util/stat-shadow.c b/tools/perf/util/stat-shadow.c
index 979c8cb918f7..788ce5e46470 100644
--- a/tools/perf/util/stat-shadow.c
+++ b/tools/perf/util/stat-shadow.c
@@ -1193,7 +1193,7 @@ void perf_stat__print_shadow_stats(struct perf_stat_config *config,
 						  &rsd);
 		if (retiring > 0.7)
 			color = PERF_COLOR_GREEN;
-		print_metric(config, ctxp, color, "%8.1f%%", "retiring",
+		print_metric(config, ctxp, color, "%8.1f%%", "Retiring",
 				retiring * 100.);
 	} else if (perf_stat_evsel__is(evsel, TOPDOWN_FE_BOUND) &&
 		   full_td(cpu_map_idx, st, &rsd)) {
@@ -1202,7 +1202,7 @@ void perf_stat__print_shadow_stats(struct perf_stat_config *config,
 						  &rsd);
 		if (fe_bound > 0.2)
 			color = PERF_COLOR_RED;
-		print_metric(config, ctxp, color, "%8.1f%%", "frontend bound",
+		print_metric(config, ctxp, color, "%8.1f%%", "Frontend Bound",
 				fe_bound * 100.);
 	} else if (perf_stat_evsel__is(evsel, TOPDOWN_BE_BOUND) &&
 		   full_td(cpu_map_idx, st, &rsd)) {
@@ -1211,7 +1211,7 @@ void perf_stat__print_shadow_stats(struct perf_stat_config *config,
 						  &rsd);
 		if (be_bound > 0.2)
 			color = PERF_COLOR_RED;
-		print_metric(config, ctxp, color, "%8.1f%%", "backend bound",
+		print_metric(config, ctxp, color, "%8.1f%%", "Backend Bound",
 				be_bound * 100.);
 	} else if (perf_stat_evsel__is(evsel, TOPDOWN_BAD_SPEC) &&
 		   full_td(cpu_map_idx, st, &rsd)) {
@@ -1220,7 +1220,7 @@ void perf_stat__print_shadow_stats(struct perf_stat_config *config,
 						  &rsd);
 		if (bad_spec > 0.1)
 			color = PERF_COLOR_RED;
-		print_metric(config, ctxp, color, "%8.1f%%", "bad speculation",
+		print_metric(config, ctxp, color, "%8.1f%%", "Bad Speculation",
 				bad_spec * 100.);
 	} else if (perf_stat_evsel__is(evsel, TOPDOWN_HEAVY_OPS) &&
 			full_td(cpu_map_idx, st, &rsd) && (config->topdown_level > 1)) {
@@ -1234,13 +1234,13 @@ void perf_stat__print_shadow_stats(struct perf_stat_config *config,
 
 		if (retiring > 0.7 && heavy_ops > 0.1)
 			color = PERF_COLOR_GREEN;
-		print_metric(config, ctxp, color, "%8.1f%%", "heavy operations",
+		print_metric(config, ctxp, color, "%8.1f%%", "Heavy Operations",
 				heavy_ops * 100.);
 		if (retiring > 0.7 && light_ops > 0.6)
 			color = PERF_COLOR_GREEN;
 		else
 			color = NULL;
-		print_metric(config, ctxp, color, "%8.1f%%", "light operations",
+		print_metric(config, ctxp, color, "%8.1f%%", "Light Operations",
 				light_ops * 100.);
 	} else if (perf_stat_evsel__is(evsel, TOPDOWN_BR_MISPREDICT) &&
 			full_td(cpu_map_idx, st, &rsd) && (config->topdown_level > 1)) {
@@ -1254,13 +1254,13 @@ void perf_stat__print_shadow_stats(struct perf_stat_config *config,
 
 		if (bad_spec > 0.1 && br_mis > 0.05)
 			color = PERF_COLOR_RED;
-		print_metric(config, ctxp, color, "%8.1f%%", "branch mispredict",
+		print_metric(config, ctxp, color, "%8.1f%%", "Branch Mispredict",
 				br_mis * 100.);
 		if (bad_spec > 0.1 && m_clears > 0.05)
 			color = PERF_COLOR_RED;
 		else
 			color = NULL;
-		print_metric(config, ctxp, color, "%8.1f%%", "machine clears",
+		print_metric(config, ctxp, color, "%8.1f%%", "Machine Clears",
 				m_clears * 100.);
 	} else if (perf_stat_evsel__is(evsel, TOPDOWN_FETCH_LAT) &&
 			full_td(cpu_map_idx, st, &rsd) && (config->topdown_level > 1)) {
@@ -1274,13 +1274,13 @@ void perf_stat__print_shadow_stats(struct perf_stat_config *config,
 
 		if (fe_bound > 0.2 && fetch_lat > 0.15)
 			color = PERF_COLOR_RED;
-		print_metric(config, ctxp, color, "%8.1f%%", "fetch latency",
+		print_metric(config, ctxp, color, "%8.1f%%", "Fetch Latency",
 				fetch_lat * 100.);
 		if (fe_bound > 0.2 && fetch_bw > 0.1)
 			color = PERF_COLOR_RED;
 		else
 			color = NULL;
-		print_metric(config, ctxp, color, "%8.1f%%", "fetch bandwidth",
+		print_metric(config, ctxp, color, "%8.1f%%", "Fetch Bandwidth",
 				fetch_bw * 100.);
 	} else if (perf_stat_evsel__is(evsel, TOPDOWN_MEM_BOUND) &&
 			full_td(cpu_map_idx, st, &rsd) && (config->topdown_level > 1)) {
@@ -1294,13 +1294,13 @@ void perf_stat__print_shadow_stats(struct perf_stat_config *config,
 
 		if (be_bound > 0.2 && mem_bound > 0.2)
 			color = PERF_COLOR_RED;
-		print_metric(config, ctxp, color, "%8.1f%%", "memory bound",
+		print_metric(config, ctxp, color, "%8.1f%%", "Memory Bound",
 				mem_bound * 100.);
 		if (be_bound > 0.2 && core_bound > 0.1)
 			color = PERF_COLOR_RED;
 		else
 			color = NULL;
-		print_metric(config, ctxp, color, "%8.1f%%", "Core bound",
+		print_metric(config, ctxp, color, "%8.1f%%", "Core Bound",
 				core_bound * 100.);
 	} else if (evsel->metric_expr) {
 		generic_metric(config, evsel->metric_expr, evsel->metric_events, NULL,
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] perf stat: Capitalize topdown metrics' names
  2022-08-25  1:54 [PATCH] perf stat: Capitalize topdown metrics' names zhengjun.xing
@ 2022-08-26 20:54 ` Ian Rogers
  2022-08-27 14:39   ` Arnaldo Carvalho de Melo
  0 siblings, 1 reply; 3+ messages in thread
From: Ian Rogers @ 2022-08-26 20:54 UTC (permalink / raw)
  To: zhengjun.xing
  Cc: acme, peterz, mingo, alexander.shishkin, jolsa, namhyung,
	linux-kernel, linux-perf-users, ak, kan.liang

On Wed, Aug 24, 2022 at 6:53 PM <zhengjun.xing@linux.intel.com> wrote:
>
> From: Zhengjun Xing <zhengjun.xing@linux.intel.com>
>
> Capitalize topdown metrics' names to follow the intel SDM.
>
> Before:
>
>  # ./perf stat -a  sleep 1
>
>  Performance counter stats for 'system wide':
>
>         228,094.05 msec cpu-clock                        #  225.026 CPUs utilized
>                842      context-switches                 #    3.691 /sec
>                224      cpu-migrations                   #    0.982 /sec
>                 70      page-faults                      #    0.307 /sec
>         23,164,105      cycles                           #    0.000 GHz
>         29,403,446      instructions                     #    1.27  insn per cycle
>          5,268,185      branches                         #   23.097 K/sec
>             33,239      branch-misses                    #    0.63% of all branches
>        136,248,990      slots                            #  597.337 K/sec
>         32,976,450      topdown-retiring                 #     24.2% retiring
>          4,651,918      topdown-bad-spec                 #      3.4% bad speculation
>         26,148,695      topdown-fe-bound                 #     19.2% frontend bound
>         72,515,776      topdown-be-bound                 #     53.2% backend bound
>          6,008,540      topdown-heavy-ops                #      4.4% heavy operations       #     19.8% light operations
>          3,934,049      topdown-br-mispredict            #      2.9% branch mispredict      #      0.5% machine clears
>         16,655,439      topdown-fetch-lat                #     12.2% fetch latency          #      7.0% fetch bandwidth
>         41,635,972      topdown-mem-bound                #     30.5% memory bound           #     22.7% Core bound
>
>        1.013634593 seconds time elapsed
>
> After:
>
>  # ./perf stat -a  sleep 1
>
>  Performance counter stats for 'system wide':
>
>         228,081.94 msec cpu-clock                        #  225.003 CPUs utilized
>                824      context-switches                 #    3.613 /sec
>                224      cpu-migrations                   #    0.982 /sec
>                 67      page-faults                      #    0.294 /sec
>         22,647,423      cycles                           #    0.000 GHz
>         28,870,551      instructions                     #    1.27  insn per cycle
>          5,167,099      branches                         #   22.655 K/sec
>             32,383      branch-misses                    #    0.63% of all branches
>        133,411,074      slots                            #  584.926 K/sec
>         32,352,607      topdown-retiring                 #     24.3% Retiring
>          4,456,977      topdown-bad-spec                 #      3.3% Bad Speculation
>         25,626,487      topdown-fe-bound                 #     19.2% Frontend Bound
>         70,955,316      topdown-be-bound                 #     53.2% Backend Bound
>          5,834,844      topdown-heavy-ops                #      4.4% Heavy Operations       #     19.9% Light Operations
>          3,738,781      topdown-br-mispredict            #      2.8% Branch Mispredict      #      0.5% Machine Clears
>         16,286,803      topdown-fetch-lat                #     12.2% Fetch Latency          #      7.0% Fetch Bandwidth
>         40,802,069      topdown-mem-bound                #     30.6% Memory Bound           #     22.6% Core Bound
>
>        1.013683125 seconds time elapsed
>
> Signed-off-by: Zhengjun Xing <zhengjun.xing@linux.intel.com>
> Reviewed-by: Kan Liang <kan.liang@linux.intel.com>

Acked-by: Ian Rogers <irogers@google.com>

Thanks,
Ian

> ---
>  tools/perf/util/stat-shadow.c | 24 ++++++++++++------------
>  1 file changed, 12 insertions(+), 12 deletions(-)
>
> diff --git a/tools/perf/util/stat-shadow.c b/tools/perf/util/stat-shadow.c
> index 979c8cb918f7..788ce5e46470 100644
> --- a/tools/perf/util/stat-shadow.c
> +++ b/tools/perf/util/stat-shadow.c
> @@ -1193,7 +1193,7 @@ void perf_stat__print_shadow_stats(struct perf_stat_config *config,
>                                                   &rsd);
>                 if (retiring > 0.7)
>                         color = PERF_COLOR_GREEN;
> -               print_metric(config, ctxp, color, "%8.1f%%", "retiring",
> +               print_metric(config, ctxp, color, "%8.1f%%", "Retiring",
>                                 retiring * 100.);
>         } else if (perf_stat_evsel__is(evsel, TOPDOWN_FE_BOUND) &&
>                    full_td(cpu_map_idx, st, &rsd)) {
> @@ -1202,7 +1202,7 @@ void perf_stat__print_shadow_stats(struct perf_stat_config *config,
>                                                   &rsd);
>                 if (fe_bound > 0.2)
>                         color = PERF_COLOR_RED;
> -               print_metric(config, ctxp, color, "%8.1f%%", "frontend bound",
> +               print_metric(config, ctxp, color, "%8.1f%%", "Frontend Bound",
>                                 fe_bound * 100.);
>         } else if (perf_stat_evsel__is(evsel, TOPDOWN_BE_BOUND) &&
>                    full_td(cpu_map_idx, st, &rsd)) {
> @@ -1211,7 +1211,7 @@ void perf_stat__print_shadow_stats(struct perf_stat_config *config,
>                                                   &rsd);
>                 if (be_bound > 0.2)
>                         color = PERF_COLOR_RED;
> -               print_metric(config, ctxp, color, "%8.1f%%", "backend bound",
> +               print_metric(config, ctxp, color, "%8.1f%%", "Backend Bound",
>                                 be_bound * 100.);
>         } else if (perf_stat_evsel__is(evsel, TOPDOWN_BAD_SPEC) &&
>                    full_td(cpu_map_idx, st, &rsd)) {
> @@ -1220,7 +1220,7 @@ void perf_stat__print_shadow_stats(struct perf_stat_config *config,
>                                                   &rsd);
>                 if (bad_spec > 0.1)
>                         color = PERF_COLOR_RED;
> -               print_metric(config, ctxp, color, "%8.1f%%", "bad speculation",
> +               print_metric(config, ctxp, color, "%8.1f%%", "Bad Speculation",
>                                 bad_spec * 100.);
>         } else if (perf_stat_evsel__is(evsel, TOPDOWN_HEAVY_OPS) &&
>                         full_td(cpu_map_idx, st, &rsd) && (config->topdown_level > 1)) {
> @@ -1234,13 +1234,13 @@ void perf_stat__print_shadow_stats(struct perf_stat_config *config,
>
>                 if (retiring > 0.7 && heavy_ops > 0.1)
>                         color = PERF_COLOR_GREEN;
> -               print_metric(config, ctxp, color, "%8.1f%%", "heavy operations",
> +               print_metric(config, ctxp, color, "%8.1f%%", "Heavy Operations",
>                                 heavy_ops * 100.);
>                 if (retiring > 0.7 && light_ops > 0.6)
>                         color = PERF_COLOR_GREEN;
>                 else
>                         color = NULL;
> -               print_metric(config, ctxp, color, "%8.1f%%", "light operations",
> +               print_metric(config, ctxp, color, "%8.1f%%", "Light Operations",
>                                 light_ops * 100.);
>         } else if (perf_stat_evsel__is(evsel, TOPDOWN_BR_MISPREDICT) &&
>                         full_td(cpu_map_idx, st, &rsd) && (config->topdown_level > 1)) {
> @@ -1254,13 +1254,13 @@ void perf_stat__print_shadow_stats(struct perf_stat_config *config,
>
>                 if (bad_spec > 0.1 && br_mis > 0.05)
>                         color = PERF_COLOR_RED;
> -               print_metric(config, ctxp, color, "%8.1f%%", "branch mispredict",
> +               print_metric(config, ctxp, color, "%8.1f%%", "Branch Mispredict",
>                                 br_mis * 100.);
>                 if (bad_spec > 0.1 && m_clears > 0.05)
>                         color = PERF_COLOR_RED;
>                 else
>                         color = NULL;
> -               print_metric(config, ctxp, color, "%8.1f%%", "machine clears",
> +               print_metric(config, ctxp, color, "%8.1f%%", "Machine Clears",
>                                 m_clears * 100.);
>         } else if (perf_stat_evsel__is(evsel, TOPDOWN_FETCH_LAT) &&
>                         full_td(cpu_map_idx, st, &rsd) && (config->topdown_level > 1)) {
> @@ -1274,13 +1274,13 @@ void perf_stat__print_shadow_stats(struct perf_stat_config *config,
>
>                 if (fe_bound > 0.2 && fetch_lat > 0.15)
>                         color = PERF_COLOR_RED;
> -               print_metric(config, ctxp, color, "%8.1f%%", "fetch latency",
> +               print_metric(config, ctxp, color, "%8.1f%%", "Fetch Latency",
>                                 fetch_lat * 100.);
>                 if (fe_bound > 0.2 && fetch_bw > 0.1)
>                         color = PERF_COLOR_RED;
>                 else
>                         color = NULL;
> -               print_metric(config, ctxp, color, "%8.1f%%", "fetch bandwidth",
> +               print_metric(config, ctxp, color, "%8.1f%%", "Fetch Bandwidth",
>                                 fetch_bw * 100.);
>         } else if (perf_stat_evsel__is(evsel, TOPDOWN_MEM_BOUND) &&
>                         full_td(cpu_map_idx, st, &rsd) && (config->topdown_level > 1)) {
> @@ -1294,13 +1294,13 @@ void perf_stat__print_shadow_stats(struct perf_stat_config *config,
>
>                 if (be_bound > 0.2 && mem_bound > 0.2)
>                         color = PERF_COLOR_RED;
> -               print_metric(config, ctxp, color, "%8.1f%%", "memory bound",
> +               print_metric(config, ctxp, color, "%8.1f%%", "Memory Bound",
>                                 mem_bound * 100.);
>                 if (be_bound > 0.2 && core_bound > 0.1)
>                         color = PERF_COLOR_RED;
>                 else
>                         color = NULL;
> -               print_metric(config, ctxp, color, "%8.1f%%", "Core bound",
> +               print_metric(config, ctxp, color, "%8.1f%%", "Core Bound",
>                                 core_bound * 100.);
>         } else if (evsel->metric_expr) {
>                 generic_metric(config, evsel->metric_expr, evsel->metric_events, NULL,
> --
> 2.25.1
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] perf stat: Capitalize topdown metrics' names
  2022-08-26 20:54 ` Ian Rogers
@ 2022-08-27 14:39   ` Arnaldo Carvalho de Melo
  0 siblings, 0 replies; 3+ messages in thread
From: Arnaldo Carvalho de Melo @ 2022-08-27 14:39 UTC (permalink / raw)
  To: Ian Rogers
  Cc: zhengjun.xing, peterz, mingo, alexander.shishkin, jolsa, namhyung,
	linux-kernel, linux-perf-users, ak, kan.liang

Em Fri, Aug 26, 2022 at 01:54:09PM -0700, Ian Rogers escreveu:
> On Wed, Aug 24, 2022 at 6:53 PM <zhengjun.xing@linux.intel.com> wrote:
> > Signed-off-by: Zhengjun Xing <zhengjun.xing@linux.intel.com>
> > Reviewed-by: Kan Liang <kan.liang@linux.intel.com>
 
> Acked-by: Ian Rogers <irogers@google.com>

Thanks, applied.

- Arnaldo


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-08-27 14:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-08-25  1:54 [PATCH] perf stat: Capitalize topdown metrics' names zhengjun.xing
2022-08-26 20:54 ` Ian Rogers
2022-08-27 14:39   ` Arnaldo Carvalho de Melo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).