linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] perf c2c: Fix sorting in percent_rmt_hitm_cmp()
@ 2022-05-30  8:42 Leo Yan
  2022-05-31 22:28 ` Namhyung Kim
  0 siblings, 1 reply; 2+ messages in thread
From: Leo Yan @ 2022-05-30  8:42 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo, Jiri Olsa, Peter Zijlstra, Ingo Molnar,
	Mark Rutland, Alexander Shishkin, Namhyung Kim, Joe Mario,
	linux-perf-users, linux-kernel
  Cc: Leo Yan

The function percent_rmt_hitm_cmp() wrongly uses local HITMs for
sorting remote HITMs.

Since this function is to sort cache lines for remote HITMs, this patch
changes to use 'rmt_hitm' field for correct sorting.

Fixes: 9cb3500afc09 ("perf c2c report: Add hitm/store percent related sort keys")
Signed-off-by: Leo Yan <leo.yan@linaro.org>
---
 tools/perf/builtin-c2c.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/perf/builtin-c2c.c b/tools/perf/builtin-c2c.c
index c8230c48125f..e8280973d7b8 100644
--- a/tools/perf/builtin-c2c.c
+++ b/tools/perf/builtin-c2c.c
@@ -928,8 +928,8 @@ percent_rmt_hitm_cmp(struct perf_hpp_fmt *fmt __maybe_unused,
 	double per_left;
 	double per_right;
 
-	per_left  = PERCENT(left, lcl_hitm);
-	per_right = PERCENT(right, lcl_hitm);
+	per_left  = PERCENT(left, rmt_hitm);
+	per_right = PERCENT(right, rmt_hitm);
 
 	return per_left - per_right;
 }
-- 
2.25.1


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

* Re: [PATCH] perf c2c: Fix sorting in percent_rmt_hitm_cmp()
  2022-05-30  8:42 [PATCH] perf c2c: Fix sorting in percent_rmt_hitm_cmp() Leo Yan
@ 2022-05-31 22:28 ` Namhyung Kim
  0 siblings, 0 replies; 2+ messages in thread
From: Namhyung Kim @ 2022-05-31 22:28 UTC (permalink / raw)
  To: Leo Yan
  Cc: Arnaldo Carvalho de Melo, Jiri Olsa, Peter Zijlstra, Ingo Molnar,
	Mark Rutland, Alexander Shishkin, Joe Mario, linux-perf-users,
	linux-kernel

On Mon, May 30, 2022 at 1:43 AM Leo Yan <leo.yan@linaro.org> wrote:
>
> The function percent_rmt_hitm_cmp() wrongly uses local HITMs for
> sorting remote HITMs.
>
> Since this function is to sort cache lines for remote HITMs, this patch
> changes to use 'rmt_hitm' field for correct sorting.
>
> Fixes: 9cb3500afc09 ("perf c2c report: Add hitm/store percent related sort keys")
> Signed-off-by: Leo Yan <leo.yan@linaro.org>

Acked-by: Namhyung Kim <namhyung@kernel.org>

Thanks,
Namhyung


> ---
>  tools/perf/builtin-c2c.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/tools/perf/builtin-c2c.c b/tools/perf/builtin-c2c.c
> index c8230c48125f..e8280973d7b8 100644
> --- a/tools/perf/builtin-c2c.c
> +++ b/tools/perf/builtin-c2c.c
> @@ -928,8 +928,8 @@ percent_rmt_hitm_cmp(struct perf_hpp_fmt *fmt __maybe_unused,
>         double per_left;
>         double per_right;
>
> -       per_left  = PERCENT(left, lcl_hitm);
> -       per_right = PERCENT(right, lcl_hitm);
> +       per_left  = PERCENT(left, rmt_hitm);
> +       per_right = PERCENT(right, rmt_hitm);
>
>         return per_left - per_right;
>  }
> --
> 2.25.1
>

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

end of thread, other threads:[~2022-05-31 22:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-30  8:42 [PATCH] perf c2c: Fix sorting in percent_rmt_hitm_cmp() Leo Yan
2022-05-31 22:28 ` Namhyung Kim

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).