From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751997AbdJDKa6 (ORCPT ); Wed, 4 Oct 2017 06:30:58 -0400 Received: from mx1.redhat.com ([209.132.183.28]:54352 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751396AbdJDKaz (ORCPT ); Wed, 4 Oct 2017 06:30:55 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com A134378EA3 Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=jolsa@redhat.com Date: Wed, 4 Oct 2017 12:30:52 +0200 From: Jiri Olsa To: Arnaldo Carvalho de Melo Cc: Jiri Olsa , Wang Nan , Andi Kleen , linux-kernel@vger.kernel.org, Andi Kleen , He Kuang , Alexei Starovoitov Subject: Re: [PATCH 2/2] perf, tools: Don't force MetricExprs to lower case Message-ID: <20171004103052.GC23759@krava> References: <20170912195643.2611-1-andi@firstfloor.org> <20170912195643.2611-2-andi@firstfloor.org> <20171003160605.GC25388@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20171003160605.GC25388@kernel.org> User-Agent: Mutt/1.9.1 (2017-09-22) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Wed, 04 Oct 2017 10:30:55 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Oct 03, 2017 at 01:06:05PM -0300, Arnaldo Carvalho de Melo wrote: > Em Tue, Sep 12, 2017 at 12:56:43PM -0700, Andi Kleen escreveu: > > From: Andi Kleen > > > > There are still problems with BPF misinterpreting some events > > that include .c. An earlier fix made it work for stand alone > > aliases, but it still fails for more complex constructs. > > Hi Wang, Jiri, > > Can you please take a look at this and see if there is something > we can do to help Andi? > > - Arnaldo > > > REJECT keeps trying and trying a shorter string until > > .c is matched and it appears like a valid BPF path. > > > > % perf stat -e cpu/uops_executed.core,cmask=1/ true > > bpf: builtin compilation failed: -95, try external compiler > > ERROR: problems with path cpu/uops_executed.c: No such file or directory > > event syntax error: 'cpu/uops_executed.core,cmask=1/' > > \___ Failed to load cpu/uops_executed.c from source: Error when compiling BPF scriptlet > > > > I tried to fix it, but it exceeds my flex knowledge, because > > REJECT does not interact well with BEGIN states. > > > > The BPF syntax in its current form really causes an ambigious > > grammar. right, it looks like we allow whole path (including / char) for BPF file, which messes up with out pmu/.../ syntax do we need that? (Cc-ed some bpf folks) if not attached patch seems to fix things.. otherwise we need to come up with another fix thanks, jirka --- diff --git a/tools/perf/util/parse-events.l b/tools/perf/util/parse-events.l index ea2426daf7e8..e3c602f4bbbf 100644 --- a/tools/perf/util/parse-events.l +++ b/tools/perf/util/parse-events.l @@ -151,8 +151,8 @@ do { \ group [^,{}/]*[{][^}]*[}][^,{}/]* event_pmu [^,{}/]+[/][^/]*[/][^,{}/]* event [^,{}/]+ -bpf_object [^,{}]+\.(o|bpf)[a-zA-Z0-9._]* -bpf_source [^,{}]+\.c[a-zA-Z0-9._]* +bpf_object [^,{}/]+\.(o|bpf)[a-zA-Z0-9._]* +bpf_source [^,{}/]+\.c[a-zA-Z0-9._]* num_dec [0-9]+ num_hex 0x[a-fA-F0-9]+