lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAP-5=fXAVkp9YnC5X7HUt=jSKqjguHpC7eiThQ+f+xptvvoRVQ@mail.gmail.com>
Date: Wed, 5 Mar 2025 12:59:24 -0800
From: Ian Rogers <irogers@...gle.com>
To: James Clark <james.clark@...aro.org>
Cc: Peter Zijlstra <peterz@...radead.org>, Ingo Molnar <mingo@...hat.com>, 
	Arnaldo Carvalho de Melo <acme@...nel.org>, Namhyung Kim <namhyung@...nel.org>, 
	Mark Rutland <mark.rutland@....com>, 
	Alexander Shishkin <alexander.shishkin@...ux.intel.com>, Jiri Olsa <jolsa@...nel.org>, 
	Adrian Hunter <adrian.hunter@...el.com>, Robin Murphy <robin.murphy@....com>, 
	Leo Yan <leo.yan@....com>, linux-perf-users@...r.kernel.org, 
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/3] perf list: Order events by event name before PMU name

On Tue, Mar 4, 2025 at 5:50 AM James Clark <james.clark@...aro.org> wrote:
>
> In order to be able to show a single line for the same events on
> different PMUs, they need to be grouped by event name. This is because
> deduplication relies on similar items being adjacent in the list.
>
> Even without the following changes this would arguably be better
> grouping because it's easier to find events in a topic alphabetically
> by name, rather than in separate PMU blocks.
>
> Signed-off-by: James Clark <james.clark@...aro.org>

Tested-by: Ian Rogers <irogers@...gle.com>

Thanks,
Ian

> ---
>  tools/perf/util/pmus.c | 16 ++++++++--------
>  1 file changed, 8 insertions(+), 8 deletions(-)
>
> diff --git a/tools/perf/util/pmus.c b/tools/perf/util/pmus.c
> index dd7c2ffdab38..4d60bac2d2b9 100644
> --- a/tools/perf/util/pmus.c
> +++ b/tools/perf/util/pmus.c
> @@ -445,15 +445,15 @@ static int cmp_sevent(const void *a, const void *b)
>         if (a_iscpu != b_iscpu)
>                 return a_iscpu ? -1 : 1;
>
> -       /* Order by PMU name. */
> -       if (as->pmu != bs->pmu) {
> -               ret = strcmp(as->pmu_name ?: "", bs->pmu_name ?: "");
> -               if (ret)
> -                       return ret;
> -       }
> -
>         /* Order by event name. */
> -       return strcmp(as->name, bs->name);
> +       ret = strcmp(as->name, bs->name);
> +       if (ret)
> +               return ret;
> +
> +       /* Order by PMU name. */
> +       if (as->pmu == bs->pmu)
> +               return 0;
> +       return strcmp(as->pmu_name ?: "", bs->pmu_name ?: "");
>  }
>
>  static bool pmu_alias_is_duplicate(struct sevent *a, struct sevent *b)
>
> --
> 2.34.1
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ