linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Qi Liu <liuqi115@huawei.com>
Cc: ak@linux.intel.com, mingo@redhat.com,
	linux-kernel@vger.kernel.org, linuxarm@huawei.com
Subject: Re: [PATCH V2 RESEND] perf stat: Fix the ratio comments of miss-events
Date: Wed, 16 Sep 2020 10:54:45 -0300	[thread overview]
Message-ID: <20200916135445.GP720847@kernel.org> (raw)
In-Reply-To: <1600253331-10535-1-git-send-email-liuqi115@huawei.com>

Em Wed, Sep 16, 2020 at 06:48:51PM +0800, Qi Liu escreveu:
> Perf stat displays miss ratio of L1-dcache, L1-icache, dTLB cache,
> iTLB cache and LL-cache. Take L1-dcache for example, miss ratio is
> caculated as "L1-dcache-load-misses/L1-dcache-loads". So
> "of all L1-dcache hits" is unsuitable to describe it, and
> "of all L1-dcache accesses" seems better.
> 
> The comments of L1-icache, dTLB cache, iTLB cache and LL-cache are
> fixed in the same way.
> 
> Signed-off-by: Qi Liu <liuqi115@huawei.com>
> Reviewed-by: Andi Kleen <ak@linux.intel.com>

Thanks, applied.

- Arnaldo

> ---
>  tools/perf/util/stat-shadow.c | 20 ++++++++++----------
>  1 file changed, 10 insertions(+), 10 deletions(-)
> 
> diff --git a/tools/perf/util/stat-shadow.c b/tools/perf/util/stat-shadow.c
> index e1ba6c1..ee3c404 100644
> --- a/tools/perf/util/stat-shadow.c
> +++ b/tools/perf/util/stat-shadow.c
> @@ -517,7 +517,7 @@ static void print_l1_dcache_misses(struct perf_stat_config *config,
> 
>  	color = get_ratio_color(GRC_CACHE_MISSES, ratio);
> 
> -	out->print_metric(config, out->ctx, color, "%7.2f%%", "of all L1-dcache hits", ratio);
> +	out->print_metric(config, out->ctx, color, "%7.2f%%", "of all L1-dcache accesses", ratio);
>  }
> 
>  static void print_l1_icache_misses(struct perf_stat_config *config,
> @@ -538,7 +538,7 @@ static void print_l1_icache_misses(struct perf_stat_config *config,
>  		ratio = avg / total * 100.0;
> 
>  	color = get_ratio_color(GRC_CACHE_MISSES, ratio);
> -	out->print_metric(config, out->ctx, color, "%7.2f%%", "of all L1-icache hits", ratio);
> +	out->print_metric(config, out->ctx, color, "%7.2f%%", "of all L1-icache accesses", ratio);
>  }
> 
>  static void print_dtlb_cache_misses(struct perf_stat_config *config,
> @@ -558,7 +558,7 @@ static void print_dtlb_cache_misses(struct perf_stat_config *config,
>  		ratio = avg / total * 100.0;
> 
>  	color = get_ratio_color(GRC_CACHE_MISSES, ratio);
> -	out->print_metric(config, out->ctx, color, "%7.2f%%", "of all dTLB cache hits", ratio);
> +	out->print_metric(config, out->ctx, color, "%7.2f%%", "of all dTLB cache accesses", ratio);
>  }
> 
>  static void print_itlb_cache_misses(struct perf_stat_config *config,
> @@ -578,7 +578,7 @@ static void print_itlb_cache_misses(struct perf_stat_config *config,
>  		ratio = avg / total * 100.0;
> 
>  	color = get_ratio_color(GRC_CACHE_MISSES, ratio);
> -	out->print_metric(config, out->ctx, color, "%7.2f%%", "of all iTLB cache hits", ratio);
> +	out->print_metric(config, out->ctx, color, "%7.2f%%", "of all iTLB cache accesses", ratio);
>  }
> 
>  static void print_ll_cache_misses(struct perf_stat_config *config,
> @@ -598,7 +598,7 @@ static void print_ll_cache_misses(struct perf_stat_config *config,
>  		ratio = avg / total * 100.0;
> 
>  	color = get_ratio_color(GRC_CACHE_MISSES, ratio);
> -	out->print_metric(config, out->ctx, color, "%7.2f%%", "of all LL-cache hits", ratio);
> +	out->print_metric(config, out->ctx, color, "%7.2f%%", "of all LL-cache accesses", ratio);
>  }
> 
>  /*
> @@ -918,7 +918,7 @@ void perf_stat__print_shadow_stats(struct perf_stat_config *config,
>  		if (runtime_stat_n(st, STAT_L1_DCACHE, ctx, cpu) != 0)
>  			print_l1_dcache_misses(config, cpu, evsel, avg, out, st);
>  		else
> -			print_metric(config, ctxp, NULL, NULL, "of all L1-dcache hits", 0);
> +			print_metric(config, ctxp, NULL, NULL, "of all L1-dcache accesses", 0);
>  	} else if (
>  		evsel->core.attr.type == PERF_TYPE_HW_CACHE &&
>  		evsel->core.attr.config ==  ( PERF_COUNT_HW_CACHE_L1I |
> @@ -928,7 +928,7 @@ void perf_stat__print_shadow_stats(struct perf_stat_config *config,
>  		if (runtime_stat_n(st, STAT_L1_ICACHE, ctx, cpu) != 0)
>  			print_l1_icache_misses(config, cpu, evsel, avg, out, st);
>  		else
> -			print_metric(config, ctxp, NULL, NULL, "of all L1-icache hits", 0);
> +			print_metric(config, ctxp, NULL, NULL, "of all L1-icache accesses", 0);
>  	} else if (
>  		evsel->core.attr.type == PERF_TYPE_HW_CACHE &&
>  		evsel->core.attr.config ==  ( PERF_COUNT_HW_CACHE_DTLB |
> @@ -938,7 +938,7 @@ void perf_stat__print_shadow_stats(struct perf_stat_config *config,
>  		if (runtime_stat_n(st, STAT_DTLB_CACHE, ctx, cpu) != 0)
>  			print_dtlb_cache_misses(config, cpu, evsel, avg, out, st);
>  		else
> -			print_metric(config, ctxp, NULL, NULL, "of all dTLB cache hits", 0);
> +			print_metric(config, ctxp, NULL, NULL, "of all dTLB cache accesses", 0);
>  	} else if (
>  		evsel->core.attr.type == PERF_TYPE_HW_CACHE &&
>  		evsel->core.attr.config ==  ( PERF_COUNT_HW_CACHE_ITLB |
> @@ -948,7 +948,7 @@ void perf_stat__print_shadow_stats(struct perf_stat_config *config,
>  		if (runtime_stat_n(st, STAT_ITLB_CACHE, ctx, cpu) != 0)
>  			print_itlb_cache_misses(config, cpu, evsel, avg, out, st);
>  		else
> -			print_metric(config, ctxp, NULL, NULL, "of all iTLB cache hits", 0);
> +			print_metric(config, ctxp, NULL, NULL, "of all iTLB cache accesses", 0);
>  	} else if (
>  		evsel->core.attr.type == PERF_TYPE_HW_CACHE &&
>  		evsel->core.attr.config ==  ( PERF_COUNT_HW_CACHE_LL |
> @@ -958,7 +958,7 @@ void perf_stat__print_shadow_stats(struct perf_stat_config *config,
>  		if (runtime_stat_n(st, STAT_LL_CACHE, ctx, cpu) != 0)
>  			print_ll_cache_misses(config, cpu, evsel, avg, out, st);
>  		else
> -			print_metric(config, ctxp, NULL, NULL, "of all LL-cache hits", 0);
> +			print_metric(config, ctxp, NULL, NULL, "of all LL-cache accesses", 0);
>  	} else if (evsel__match(evsel, HARDWARE, HW_CACHE_MISSES)) {
>  		total = runtime_stat_avg(st, STAT_CACHEREFS, ctx, cpu);
> 
> --
> 2.8.1
> 

-- 

- Arnaldo

      reply	other threads:[~2020-09-16 17:47 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-16 10:48 [PATCH V2 RESEND] perf stat: Fix the ratio comments of miss-events Qi Liu
2020-09-16 13:54 ` Arnaldo Carvalho de Melo [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200916135445.GP720847@kernel.org \
    --to=acme@kernel.org \
    --cc=ak@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxarm@huawei.com \
    --cc=liuqi115@huawei.com \
    --cc=mingo@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).