Re: [PATCH v3 06/10] perf list: Simplify cache event printing

From: Arnaldo Carvalho de Melo
Date: Tue Nov 15 2022 - 08:34:47 EST


Em Mon, Nov 14, 2022 at 01:07:19PM -0800, Ian Rogers escreveu:
> The current code computes an array of cache names then sorts and
> prints them. Use a strlist to create a list of names that is
> sorted. Keep the hybrid names, it is unclear how to generalize it, but
> drop the computation of evt_pmus that is never used.

> +++ b/tools/perf/util/print-events.c
> @@ -206,137 +206,59 @@ void print_sdt_events(const char *subsys_glob, const char *event_glob,
>
> int print_hwcache_events(const char *event_glob, bool name_only)
> {
> -
> - if ((hybrid_supported == 0) ||
> - (hybrid_supported == npmus)) {
> - evt_list[evt_i] = strdup(name);
> - if (npmus > 0) {
> - for (j = 0; j < npmus; j++)
> - zfree(&evt_pmus[j]);
> - }

Fixed up clash with cf9f67b36303de65 ("perf print-events: Remove redundant comparison with zero").

- Arnaldo