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]
Date:   Fri, 15 Nov 2019 23:53:46 -0800
From:   Ian Rogers <irogers@...gle.com>
To:     Jiri Olsa <jolsa@...hat.com>
Cc:     Peter Zijlstra <peterz@...radead.org>,
        Ingo Molnar <mingo@...hat.com>,
        Arnaldo Carvalho de Melo <acme@...nel.org>,
        Mark Rutland <mark.rutland@....com>,
        Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
        Namhyung Kim <namhyung@...nel.org>,
        Ravi Bangoria <ravi.bangoria@...ux.ibm.com>,
        Anju T Sudhakar <anju@...ux.vnet.ibm.com>,
        Christian Borntraeger <borntraeger@...ibm.com>,
        Thomas Richter <tmricht@...ux.ibm.com>,
        Andi Kleen <ak@...ux.intel.com>,
        Jin Yao <yao.jin@...ux.intel.com>,
        Allison Randal <allison@...utok.net>,
        Davidlohr Bueso <dave@...olabs.net>,
        Thomas Gleixner <tglx@...utronix.de>,
        Adrian Hunter <adrian.hunter@...el.com>,
        LKML <linux-kernel@...r.kernel.org>,
        Stephane Eranian <eranian@...gle.com>
Subject: Re: [PATCH] perf tools: report initial event parsing error

On Mon, Nov 11, 2019 at 4:03 AM Jiri Olsa <jolsa@...hat.com> wrote:
>
> On Fri, Nov 08, 2019 at 10:15:33AM -0800, Ian Rogers wrote:
> > Record the first event parsing error and report. Implementing feedback
> > from Jiri Olsa:
> > https://lkml.org/lkml/2019/10/28/680
> >
> > An example error is:
> >
> > $ tools/perf/perf stat -e c/c/
> > WARNING: multiple event parsing errors
> > event syntax error: 'c/c/'
> >                        \___ unknown term
> >
> > valid terms: event,filter_rem,filter_opc0,edge,filter_isoc,filter_tid,filter_loc,filter_nc,inv,umask,filter_opc1,tid_en,thresh,filter_all_op,filter_not_nm,filter_state,filter_nm,config,config1,config2,name,period,percore
> >
> > Initial error:
> > event syntax error: 'c/c/'
> >                     \___ Cannot find PMU `c'. Missing kernel support?
> > Run 'perf list' for a list of valid events
> >
> >  Usage: perf stat [<options>] [<command>]
> >
> >     -e, --event <event>   event selector. use 'perf list' to list available events
> >
> > Signed-off-by: Ian Rogers <irogers@...gle.com>
> > ---
> >  tools/perf/arch/powerpc/util/kvm-stat.c |  9 ++-
> >  tools/perf/builtin-stat.c               |  2 +
> >  tools/perf/builtin-trace.c              | 16 ++++--
> >  tools/perf/tests/parse-events.c         |  3 +-
> >  tools/perf/util/metricgroup.c           |  2 +-
> >  tools/perf/util/parse-events.c          | 76 ++++++++++++++++++-------
> >  tools/perf/util/parse-events.h          |  4 ++
> >  7 files changed, 84 insertions(+), 28 deletions(-)
> >
> > diff --git a/tools/perf/arch/powerpc/util/kvm-stat.c b/tools/perf/arch/powerpc/util/kvm-stat.c
> > index 9cc1c4a9dec4..30f5310373ca 100644
> > --- a/tools/perf/arch/powerpc/util/kvm-stat.c
> > +++ b/tools/perf/arch/powerpc/util/kvm-stat.c
> > @@ -113,10 +113,15 @@ static int is_tracepoint_available(const char *str, struct evlist *evlist)
> >       struct parse_events_error err;
> >       int ret;
> >
> > -     err.str = NULL;
> > +     bzero(&err, sizeof(err));
> >       ret = parse_events(evlist, str, &err);
> > -     if (err.str)
> > +     if (err.str) {
> >               pr_err("%s : %s\n", str, err.str);
> > +             free(&err->str);
> > +             free(&err->help);
> > +             free(&err->first_str);
> > +             free(&err->first_help);
>
> it's used in other places, so it's better to put it in
> parse_events_error__exit or such..

Done, using parse_events_print_error like other callers. This may
affect the output on error.

Thanks,
Ian

> jirka
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ