Re: perf: POWER-event translation questions

From
Robert Richter <rric@kernel.org>
Date
2012-11-20 16:50:29
Also in
lkml
Reply to
Stephane Eranian, 2012-11-09
On 09.11.12 11:26:26, Stephane Eranian wrote:
On Thu, Nov 8, 2012 at 2:10 AM, Sukadev Bhattiprolu
[off-list ref] wrote:
quoted
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.
quoted
          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 ...
quoted
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
Thread (3 messages) 3 messages, 3 authors, last reply 2012-11-20
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help