Re: [PATCH] perf stat: Fail on extra comma while parsing events

From: Arnaldo Carvalho de Melo
Date: Wed May 20 2020 - 09:32:39 EST


Em Wed, May 20, 2020 at 12:51:24AM -0700, Ian Rogers escreveu:
> On Wed, May 20, 2020 at 12:41 AM Jiri Olsa <jolsa@xxxxxxxxxx> wrote:
> >
> > Ian reported that we allow to parse following:
> >
> > $ perf stat -e ,cycles true
> >
> > which is wrong and we should fail, like we do with this fix:
> >
> > $ perf stat -e ,cycles true
> > event syntax error: ',cycles'
> > \___ parser error
> >
> > The reason is that we don't have rule for ',' in 'event'
> > start condition and it's matched and accepted by default
> > rule.
> >
> > Adding scanner debug support (that Ian already added for
> > expr code), which was really useful for finding this. It's
> > enabled together with bison debug via 'make PARSER_DEBUG=1'.
> >
> > Reported-by: Ian Rogers <irogers@xxxxxxxxxx>
> > Signed-off-by: Jiri Olsa <jolsa@xxxxxxxxxx>
>
> Acked-by: Ian Rogers <irogers@xxxxxxxxxx>

Thanks, applied.

- Arnaldo