mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v1] perf pmu: Correct auto_merge_stats test
@ 2023-06-26  5:30 Ian Rogers
  2023-06-26 22:15 ` Namhyung Kim
  0 siblings, 1 reply; 3+ messages in thread
From: Ian Rogers @ 2023-06-26  5:30 UTC (permalink / raw)
  To: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
	Mark Rutland, Alexander Shishkin, Jiri Olsa, Namhyung Kim,
	Ian Rogers, Adrian Hunter, Kan Liang, James Clark,
	linux-perf-users, linux-kernel, Andi Kleen

The original logic was:
https://lore.kernel.org/all/20230527072210.2900565-35-irogers@google.com/
return !is_pmu_hybrid(pmu->name)

is_pmu_hybrid was removed but with the incorrect condition which was
fixed for core PMUs but not uncore. This change fixes both.

Fixes: e23421426e13 ("perf pmu: Correct perf_pmu__auto_merge_stats() affecting hybrid")
Signed-off-by: Ian Rogers <irogers@google.com>
---
 tools/perf/util/pmu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/perf/util/pmu.c b/tools/perf/util/pmu.c
index 64fa568a5426..8d5ecd4ff1a9 100644
--- a/tools/perf/util/pmu.c
+++ b/tools/perf/util/pmu.c
@@ -1427,7 +1427,7 @@ bool perf_pmu__supports_legacy_cache(const struct perf_pmu *pmu)
 
 bool perf_pmu__auto_merge_stats(const struct perf_pmu *pmu)
 {
-	return pmu->is_core && perf_pmus__num_core_pmus() == 1;
+	return !pmu->is_core || perf_pmus__num_core_pmus() == 1;
 }
 
 bool perf_pmu__have_event(const struct perf_pmu *pmu, const char *name)
-- 
2.41.0.162.gfafddb0af9-goog


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

* Re: [PATCH v1] perf pmu: Correct auto_merge_stats test
  2023-06-26  5:30 [PATCH v1] perf pmu: Correct auto_merge_stats test Ian Rogers
@ 2023-06-26 22:15 ` Namhyung Kim
  2023-06-27 19:33   ` Namhyung Kim
  0 siblings, 1 reply; 3+ messages in thread
From: Namhyung Kim @ 2023-06-26 22:15 UTC (permalink / raw)
  To: Ian Rogers
  Cc: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
	Mark Rutland, Alexander Shishkin, Jiri Olsa, Adrian Hunter,
	Kan Liang, James Clark, linux-perf-users, linux-kernel,
	Andi Kleen

Hi Ian,

On Sun, Jun 25, 2023 at 10:31 PM Ian Rogers <irogers@google.com> wrote:
>
> The original logic was:
> https://lore.kernel.org/all/20230527072210.2900565-35-irogers@google.com/
> return !is_pmu_hybrid(pmu->name)
>
> is_pmu_hybrid was removed but with the incorrect condition which was
> fixed for core PMUs but not uncore. This change fixes both.
>
> Fixes: e23421426e13 ("perf pmu: Correct perf_pmu__auto_merge_stats() affecting hybrid")
> Signed-off-by: Ian Rogers <irogers@google.com>

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

Thanks,
Namhyung


> ---
>  tools/perf/util/pmu.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/perf/util/pmu.c b/tools/perf/util/pmu.c
> index 64fa568a5426..8d5ecd4ff1a9 100644
> --- a/tools/perf/util/pmu.c
> +++ b/tools/perf/util/pmu.c
> @@ -1427,7 +1427,7 @@ bool perf_pmu__supports_legacy_cache(const struct perf_pmu *pmu)
>
>  bool perf_pmu__auto_merge_stats(const struct perf_pmu *pmu)
>  {
> -       return pmu->is_core && perf_pmus__num_core_pmus() == 1;
> +       return !pmu->is_core || perf_pmus__num_core_pmus() == 1;
>  }
>
>  bool perf_pmu__have_event(const struct perf_pmu *pmu, const char *name)
> --
> 2.41.0.162.gfafddb0af9-goog
>

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

* Re: [PATCH v1] perf pmu: Correct auto_merge_stats test
  2023-06-26 22:15 ` Namhyung Kim
@ 2023-06-27 19:33   ` Namhyung Kim
  0 siblings, 0 replies; 3+ messages in thread
From: Namhyung Kim @ 2023-06-27 19:33 UTC (permalink / raw)
  To: Ian Rogers
  Cc: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
	Mark Rutland, Alexander Shishkin, Jiri Olsa, Adrian Hunter,
	Kan Liang, James Clark, linux-perf-users, linux-kernel,
	Andi Kleen

On Mon, Jun 26, 2023 at 3:15 PM Namhyung Kim <namhyung@kernel.org> wrote:
>
> Hi Ian,
>
> On Sun, Jun 25, 2023 at 10:31 PM Ian Rogers <irogers@google.com> wrote:
> >
> > The original logic was:
> > https://lore.kernel.org/all/20230527072210.2900565-35-irogers@google.com/
> > return !is_pmu_hybrid(pmu->name)
> >
> > is_pmu_hybrid was removed but with the incorrect condition which was
> > fixed for core PMUs but not uncore. This change fixes both.
> >
> > Fixes: e23421426e13 ("perf pmu: Correct perf_pmu__auto_merge_stats() affecting hybrid")
> > Signed-off-by: Ian Rogers <irogers@google.com>
>
> Tested-by: Namhyung Kim <namhyung@kernel.org>

Applied to perf-tools-next, thanks!

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

end of thread, other threads:[~2023-06-27 19:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-26  5:30 [PATCH v1] perf pmu: Correct auto_merge_stats test Ian Rogers
2023-06-26 22:15 ` Namhyung Kim
2023-06-27 19:33   ` Namhyung Kim

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®