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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAP-5=fXhpx7O-BRLaaCpiXaG+vdcD+s8jpBJwzk3qptFRXsZEg@mail.gmail.com>
Date: Wed, 2 Apr 2025 11:15:13 -0700
From: Ian Rogers <irogers@...gle.com>
To: "Liang, Kan" <kan.liang@...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>, 
	Mark Rutland <mark.rutland@....com>, 
	Alexander Shishkin <alexander.shishkin@...ux.intel.com>, Jiri Olsa <jolsa@...nel.org>, 
	Adrian Hunter <adrian.hunter@...el.com>, Howard Chu <howardchu95@...il.com>, 
	Dominique Martinet <asmadeus@...ewreck.org>, Levi Yun <yeoreum.yun@....com>, 
	"Dr. David Alan Gilbert" <linux@...blig.org>, Andi Kleen <ak@...ux.intel.com>, 
	James Clark <james.clark@...aro.org>, Weilin Wang <weilin.wang@...el.com>, 
	linux-perf-users@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 5/5] perf parse-events: Add debug dump of evlist if reordered

On Wed, Apr 2, 2025 at 10:52 AM Liang, Kan <kan.liang@...ux.intel.com> wrote:
>
>
>
> On 2025-04-02 12:47 p.m., Ian Rogers wrote:
> > Add debug verbose output to show how evsels were reordered by
> > parse_events__sort_events_and_fix_groups. For example:
> > ```
> > $ perf record -v -e '{instructions,cycles}' true
> > Using CPUID GenuineIntel-6-B7-1
> > WARNING: events were regrouped to match PMUs
> > evlist after sorting/fixing: '{cpu_atom/instructions/,cpu_atom/cycles/},{cpu_core/instructions/,cpu_core/cycles/}'
> > ```
> >
> > Signed-off-by: Ian Rogers <irogers@...gle.com>
> > ---
> >  tools/perf/util/parse-events.c | 16 +++++++++++++---
> >  1 file changed, 13 insertions(+), 3 deletions(-)
> >
> > diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c
> > index 5152fd5a6ead..0f8fd5bee3a7 100644
> > --- a/tools/perf/util/parse-events.c
> > +++ b/tools/perf/util/parse-events.c
> > @@ -28,6 +28,7 @@
> >  #include "util/evsel_config.h"
> >  #include "util/event.h"
> >  #include "util/bpf-filter.h"
> > +#include "util/stat.h"
> >  #include "util/util.h"
> >  #include "tracepoint.h"
> >
> > @@ -2196,14 +2197,23 @@ int __parse_events(struct evlist *evlist, const char *str, const char *pmu_filte
> >       if (ret2 < 0)
> >               return ret;
> >
> > -     if (ret2 && warn_if_reordered && !parse_state.wild_card_pmus)
> > -             pr_warning("WARNING: events were regrouped to match PMUs\n");
> > -
> >       /*
> >        * Add list to the evlist even with errors to allow callers to clean up.
> >        */
> >       evlist__splice_list_tail(evlist, &parse_state.list);
> >
> > +     if (ret2 && warn_if_reordered && !parse_state.wild_card_pmus) {
> > +             pr_warning("WARNING: events were regrouped to match PMUs\n");
> > +
> > +             if (verbose > 0) {
> > +                     struct strbuf sb = STRBUF_INIT;
> > +
> > +                     evlist__uniquify_name(evlist);
> > +                     evlist__format_evsels(evlist, &sb, 1024);
>
> Why is the size even less than the one in pr_err?
>
> The user probably prefer to get the complete list in the debug.

I thought the previous 2048 excessive but kept it for the previous
case to not change anything. If you are happier with 2048 here I don't
particularly mind, it is a lot to display in verbose output.

Thanks,
Ian

> Thanks,
> Kan> +                  pr_debug("evlist after sorting/fixing: '%s'\n", sb.buf);
> > +                     strbuf_release(&sb);
> > +             }
> > +     }
> >       if (!ret) {
> >               struct evsel *last;
> >
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ