Received: by 10.192.165.148 with SMTP id m20csp1740303imm; Thu, 3 May 2018 04:48:19 -0700 (PDT) X-Google-Smtp-Source: AB8JxZolclhOk5/zGBhBVvVfKsQXXQs49MRvpjqbIhxhJwdBUExrcw4Do/yv6jDrK67ktiNGLxkm X-Received: by 10.98.26.78 with SMTP id a75mr22647560pfa.84.1525348099611; Thu, 03 May 2018 04:48:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525348099; cv=none; d=google.com; s=arc-20160816; b=oGTf+DUYj2bqJNrq8lvLsyYaCaJpWy5mkZiKkmUOEq4wKhVc7cLIXolMTdzQpRyxv7 MjfzfX1jGkBO7IQw3QFfNrGS35Py862n+LAskdZxwPDrvYQiOa3gnQb+YMI/V0pUyVky R1GmVNrkvcx4MU0LGrdEAOW0TZXSRlOlqnyMrN25FGDOwpHHVrBu6KR18e/T1WCikgUx xrczBaHmY9IBq9OiNiZvcWMd1/o97iCnX0576wfkQBzG19uPG7g44CLVueXug+GqhsXu NiaHY/ZgbvqyG3BJWDAJ/6C90/4SkKfgDuQ+BStmVY8VRcHngrqN7Is7XvbFnGMNx2OT 735Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=Ru/Nb5R69aWtDYtTH4ybBTjkgrnOohlrLPBzyjzENMk=; b=E57NpZzXzqT5nFl/pw//HmHbS5KGE3cKpoVEPSozChCtAvxBtEsotJ8ExOSJTB0DA4 1tTmA2T6LSqB5dkaexQGaLBHQ3VgwLY3DT/Q9yTjtelKP3MmzFGCgD3OZdoBbZ1s6bg7 kGKYvM06mg97YewHGM+GMy7ua3FPX5z7lYbxhad+xh0o9+TGQUY6/LAotjsQmy9sdMZC 3xeN01kgZrGNPXX1Ffdddz6Ul3nvq3+AUQAyOG4tMCMx3inRi2bQr41Sq1cLmewOnMw4 5T4er9xX/LoDF8ikK6+2Q00YmzNEGDHB4iJXQu8YWhHul/+tD377JAz3Psqwej4jFUqW YL8A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 202si13996507pfx.61.2018.05.03.04.48.05; Thu, 03 May 2018 04:48:19 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751145AbeECLrp (ORCPT + 99 others); Thu, 3 May 2018 07:47:45 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:35388 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751004AbeECLrl (ORCPT ); Thu, 3 May 2018 07:47:41 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id BF656416F7AE; Thu, 3 May 2018 11:47:40 +0000 (UTC) Received: from krava (unknown [10.43.17.176]) by smtp.corp.redhat.com (Postfix) with SMTP id E650911166E0; Thu, 3 May 2018 11:47:38 +0000 (UTC) Date: Thu, 3 May 2018 13:47:38 +0200 From: Jiri Olsa To: Adrian Hunter Cc: Arnaldo Carvalho de Melo , Ingo Molnar , Clark Williams , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, Jiri Olsa , Alexander Shishkin , David Ahern , Namhyung Kim , Peter Zijlstra , Arnaldo Carvalho de Melo Subject: Re: [PATCH 05/12] perf pmu: Fix pmu events parsing rule Message-ID: <20180503114738.GB14776@krava> References: <20180425160008.3407-1-acme@kernel.org> <20180425160008.3407-6-acme@kernel.org> <448c4e21-8232-3d04-cac4-49b95c8bca3a@intel.com> <20180503103717.GA14776@krava> <0c33d3f9-4b76-c94c-7306-e93e8cd8d4aa@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <0c33d3f9-4b76-c94c-7306-e93e8cd8d4aa@intel.com> User-Agent: Mutt/1.9.1 (2017-09-22) X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Thu, 03 May 2018 11:47:40 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Thu, 03 May 2018 11:47:40 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'jolsa@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, May 03, 2018 at 02:38:15PM +0300, Adrian Hunter wrote: > On 03/05/18 13:37, Jiri Olsa wrote: > > On Thu, May 03, 2018 at 11:25:16AM +0300, Adrian Hunter wrote: > >> Hi > >> > >> This breaks Intel PT i.e. > >> > >> $ perf record -e intel_pt//u uname > >> event syntax error: 'intel_pt//u' > >> \___ parser error > >> Run 'perf list' for a list of valid events > >> > >> Usage: perf record [] [] > >> or: perf record [] -- [] > >> > >> -e, --event event selector. use 'perf list' to list available events > >> > >> See below for cause. > >> > >> On 25/04/18 19:00, Arnaldo Carvalho de Melo wrote: > >>> From: Jiri Olsa > >>> > >>> Currently all the event parsing fails end up in the event_pmu rule, and > >>> display misleading help like: > >>> > >>> $ perf stat -e inst kill > >>> event syntax error: 'inst' > >>> \___ Cannot find PMU `inst'. Missing kernel support? > >>> ... > >>> > >>> The reason is that the event_pmu is too strong and match also single > >>> string. Changing it to force the '/' separators to be part of the rule, > >>> and getting the proper error now: > >>> > >>> $ perf stat -e inst kill > >>> event syntax error: 'inst' > >>> \___ parser error > >>> Run 'perf list' for a list of valid events > >>> ... > >>> > >>> Signed-off-by: Jiri Olsa > >>> Reported-by: Ingo Molnar > >>> Tested-by: Arnaldo Carvalho de Melo > >>> Cc: Alexander Shishkin > >>> Cc: David Ahern > >>> Cc: Namhyung Kim > >>> Cc: Peter Zijlstra > >>> Link: http://lkml.kernel.org/r/20180423090823.32309-5-jolsa@kernel.org > >>> Signed-off-by: Arnaldo Carvalho de Melo > >>> --- > >>> tools/perf/util/parse-events.y | 8 ++++---- > >>> 1 file changed, 4 insertions(+), 4 deletions(-) > >>> > >>> diff --git a/tools/perf/util/parse-events.y b/tools/perf/util/parse-events.y > >>> index 7afeb80cc39e..d14464c42714 100644 > >>> --- a/tools/perf/util/parse-events.y > >>> +++ b/tools/perf/util/parse-events.y > >>> @@ -224,15 +224,15 @@ event_def: event_pmu | > >>> event_bpf_file > >>> > >>> event_pmu: > >>> -PE_NAME opt_event_config > >>> +PE_NAME '/' event_config '/' > >> > >> These are not equivalent because opt_event_config allows '//' > >> but event_config cannot be an empty string. > > > > yep, overlooked this one, how about patch below > > Seems to work but gives build warnings: > > util/parse-events.y: warning: 1 shift/reduce conflict [-Wconflicts-sr] > util/parse-events.y: warning: 1 reduce/reduce conflict [-Wconflicts-rr] hm, I wonder why my bison was silent.. there's conflict with opt_event_config reduction to empty, I'll resend thanks, jirka