From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-bk0-f42.google.com (mail-bk0-f42.google.com [209.85.214.42]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority" (not verified)) by ozlabs.org (Postfix) with ESMTPS id 06FF72C0091 for ; Wed, 21 Nov 2012 03:50:31 +1100 (EST) Received: by mail-bk0-f42.google.com with SMTP id ji2so2376727bkc.15 for ; Tue, 20 Nov 2012 08:50:27 -0800 (PST) Sender: Robert Richter Date: Tue, 20 Nov 2012 17:50:19 +0100 From: Robert Richter To: Stephane Eranian Subject: Re: perf: POWER-event translation questions Message-ID: <20121120165019.GP2504@rric.localhost> References: <20121108011035.GA20670@us.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii In-Reply-To: Cc: Peter Zijlstra , Anton Blanchard , LKML , linuxppc-dev@ozlabs.org, Ingo Molnar , Paul Mackerras , Arnaldo Carvalho de Melo , Sukadev Bhattiprolu List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On 09.11.12 11:26:26, Stephane Eranian wrote: > On Thu, Nov 8, 2012 at 2:10 AM, Sukadev Bhattiprolu > 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