Re: perf: POWER-event translation questions

From: Robert Richter
Date: Tue Nov 20 2012 - 11:50:17 EST


On 09.11.12 11:26:26, Stephane Eranian wrote:
> On Thu, Nov 8, 2012 at 2:10 AM, Sukadev Bhattiprolu
> <sukadev@xxxxxxxxxxxxxxxxxx> wrote:

> > 2. Can we allow hyphens in the {name} token (please see my change to
> > util/parse-events.l below). With this change, I can run:
> >
> The current code does not support this but Andi fixed that in his HSW patch
> and I use it for the PEBS-LL patch series as well.
>
> > perf stat -e cpu/cmplu-stall-bru /tmp/nop
> >
> > without any changes to the user level tool (parse-events.l) I have
> > tested some common cases, not sure if it will break something :-)

But ...

> > diff --git a/tools/perf/util/parse-events.l b/tools/perf/util/parse-events.l
> > index c87efc1..1967bb2 100644
> > --- a/tools/perf/util/parse-events.l
> > +++ b/tools/perf/util/parse-events.l
> > @@ -80,7 +80,7 @@ event [^,{}/]+
> > num_dec [0-9]+
> > num_hex 0x[a-fA-F0-9]+
> > num_raw_hex [a-fA-F0-9]+
> > -name [a-zA-Z_*?][a-zA-Z0-9_*?]*
> > +name [-a-zA-Z_*?][-a-zA-Z0-9_*?]*
^

... I wouldn't allow hyphens at the beginning of a name.

And, I am wondering if parsing reserved names like 'cpu-cycles' works
too, e.g. cpu/cpu-cycles-foobar/. There are many reserved words in the
lexer with hyphens in it. This might cause unexpected problems.

-Robert
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/