Received: by 10.192.165.148 with SMTP id m20csp1674592imm; Thu, 3 May 2018 03:37:57 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpWYnCvmERILxFp9cZLnRsGktFgN1xSmswPPVVb+if7sbXX5oSoCCNdDthNiUnzXpSXdBtj X-Received: by 2002:a17:902:b60a:: with SMTP id b10-v6mr23028910pls.221.1525343877769; Thu, 03 May 2018 03:37:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525343877; cv=none; d=google.com; s=arc-20160816; b=hoNrwxGrbo1zbgrytR4ZnaM4ns6C3u6d0qHc3vQ2I129voGVBUm5x9cPjsro2bStDL cXWyc55iSb257q2qe5rdVtHOpVuxigHB3pwW9PzeLlUCTuFMr9PWU3Rdinfws+i3Wtl4 x+RxTuyhT4KlSRxvDfG+G7HFFDN3UmIzpW2pbSCvEO6WtGVoj9pYgrNUDS7ttJIp0JAU pD4Unl1YPmga4KAJlNwLW4P5edFlRpb+fnT+C+8dJ1JY5YSc058wdLP5dERLbWSFU1r4 C682XqeFw3ufIxbTLjwwoSebtgWtSlhNTMSK8Vb2rbwOyRIXOmvaLWWGNE5mMz1uyEPV Y7wA== 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=Rhm8iuhaMADoYZVVWfk7n8zgcd2mZjcFwBS1GFiEkBo=; b=tmshCZGWJd0q1u2UDzkjdvxqIy+XqINC02cuhrJFgpFmZAKutq85j+QUe42JPZE5Nf JCEj0LsqiT65DbDX/0h0UkYLLKpE2dUYtXT7Wfa5XZGhXnMZBQv/jJNEPeb6AwZeVz/M SQsuFypNvvOj0121tu0IRf6Y8QkuWpv/mhRkFcMacV6vqLn6BBZW7CIQdV1s/LBDq503 jJCM+lAQ9mRquH2FSurVfG9cpvN1NOyh5F8lCN4amxmwUtdXTP4IfcYtomI0wH5rmMii hk5/9gr+72Uc3vCTg7+gLfXrnktCyB3pVgBcrW6oBbYuswJFxo1h7ouuw+rZIe1VtxYV hRtA== 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 l6-v6si2863822pgs.419.2018.05.03.03.37.43; Thu, 03 May 2018 03:37:57 -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 S1752147AbeECKhZ (ORCPT + 99 others); Thu, 3 May 2018 06:37:25 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:50722 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751737AbeECKhV (ORCPT ); Thu, 3 May 2018 06:37:21 -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 5373B4023BAD; Thu, 3 May 2018 10:37:20 +0000 (UTC) Received: from krava (unknown [10.43.17.176]) by smtp.corp.redhat.com (Postfix) with SMTP id 51830111765B; Thu, 3 May 2018 10:37:18 +0000 (UTC) Date: Thu, 3 May 2018 12:37:17 +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: <20180503103717.GA14776@krava> References: <20180425160008.3407-1-acme@kernel.org> <20180425160008.3407-6-acme@kernel.org> <448c4e21-8232-3d04-cac4-49b95c8bca3a@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <448c4e21-8232-3d04-cac4-49b95c8bca3a@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.7]); Thu, 03 May 2018 10:37:20 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Thu, 03 May 2018 10:37:20 +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 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 jirka --- diff --git a/tools/perf/util/parse-events.y b/tools/perf/util/parse-events.y index d14464c42714..1ed2befeca8a 100644 --- a/tools/perf/util/parse-events.y +++ b/tools/perf/util/parse-events.y @@ -523,6 +523,10 @@ event_term list_add_tail(&term->list, head); $$ = head; } +| +{ + $$ = NULL; +} event_term: PE_NAME '=' PE_NAME