[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAP-5=fX+cW3az37t43GAAvWuMj_FevcArA1-Pij4024Qi9z3oQ@mail.gmail.com>
Date: Wed, 16 Oct 2024 10:56:14 -0700
From: Ian Rogers <irogers@...gle.com>
To: Dapeng Mi <dapeng1.mi@...ux.intel.com>
Cc: Peter Zijlstra <peterz@...radead.org>, Ingo Molnar <mingo@...hat.com>,
Arnaldo Carvalho de Melo <acme@...nel.org>, Namhyung Kim <namhyung@...nel.org>,
Adrian Hunter <adrian.hunter@...el.com>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>, Kan Liang <kan.liang@...ux.intel.com>,
linux-perf-users@...r.kernel.org, linux-kernel@...r.kernel.org,
Dapeng Mi <dapeng1.mi@...el.com>
Subject: Re: [PATCH 1/2] perf x86/topdown: Make topdown metrics comparators be symmetric
On Fri, Oct 11, 2024 at 1:04 AM Dapeng Mi <dapeng1.mi@...ux.intel.com> wrote:
>
> The commit "3b5edc0421e2 (perf x86/topdown: Don't move topdown metric
> events in group)" modifies topdown metrics comparator to move topdown
> metrics events which are not in same group with previous event. But it
> just modifies the 2nd comparator and causes the comparators become
> asymmetric.
>
> Thus modify the 1st topdown metrics comparator and make the two
> comparators be symmetric, and refine the comments as well.
>
> Suggested-by: Ian Rogers <irogers@...gle.com>
> Signed-off-by: Dapeng Mi <dapeng1.mi@...ux.intel.com>
Reviewed-by: Ian Rogers <irogers@...gle.com>
Thanks,
Ian
> ---
> tools/perf/arch/x86/util/evlist.c | 15 +++++++++------
> 1 file changed, 9 insertions(+), 6 deletions(-)
>
> diff --git a/tools/perf/arch/x86/util/evlist.c b/tools/perf/arch/x86/util/evlist.c
> index 438e4639fa89..447a734e591c 100644
> --- a/tools/perf/arch/x86/util/evlist.c
> +++ b/tools/perf/arch/x86/util/evlist.c
> @@ -52,7 +52,7 @@ int arch_evlist__cmp(const struct evsel *lhs, const struct evsel *rhs)
> * 3,015,058 cycles
> * <not supported> topdown-retiring
> *
> - * if slots event and topdown metrics events are in two groups, the group which
> + * If slots event and topdown metrics events are in two groups, the group which
> * has topdown metrics events must contain only the topdown metrics event,
> * otherwise topdown metrics event can't be regrouped correctly as well, e.g.
> *
> @@ -69,13 +69,16 @@ int arch_evlist__cmp(const struct evsel *lhs, const struct evsel *rhs)
> return -1;
> if (arch_is_topdown_slots(rhs))
> return 1;
> - /* Followed by topdown events. */
> - if (arch_is_topdown_metrics(lhs) && !arch_is_topdown_metrics(rhs))
> - return -1;
> +
> /*
> - * Move topdown events forward only when topdown events
> - * are not in same group with previous event.
> + * Move topdown metrics events forward only when topdown metrics
> + * events are not in same group with previous slots event. If
> + * topdown metrics events are already in same group with slots
> + * event, do nothing.
> */
> + if (arch_is_topdown_metrics(lhs) && !arch_is_topdown_metrics(rhs) &&
> + lhs->core.leader != rhs->core.leader)
> + return -1;
> if (!arch_is_topdown_metrics(lhs) && arch_is_topdown_metrics(rhs) &&
> lhs->core.leader != rhs->core.leader)
> return 1;
>
> base-commit: 57fb40d40f9543213ffadb04d07cfb2ba46edc26
> --
> 2.40.1
>
Powered by blists - more mailing lists