Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1147125imm; Wed, 1 Aug 2018 10:58:54 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdIOixozNdGhBnzosJTGbS8rqev8kEMwtynIHggnluPFVyM0xnvNzpvTAfg33fiwrW5CU5D X-Received: by 2002:a62:5ec3:: with SMTP id s186-v6mr28043023pfb.129.1533146334099; Wed, 01 Aug 2018 10:58:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533146334; cv=none; d=google.com; s=arc-20160816; b=Vfv9JlOrgEdB9axU+UBy7ScPPob4hXJZzw+syFl9DECGlZ+oXhC2Z6OUpuzpQZE2Uj CDs8GzK3TD+ATSBybt4LqL9WgB2IxsAe+rLOTk/Jva0Sl4hB6gW7znpcsAhcTM2UmPPL HxYn4Syc+dNLmxg63t60A+AqA/2uboS4q7vVEjDbOyQDCt5ITIh0H55GFtub7z5ZEbAC hor/nWeowPSr4dTdEwZrzuqN8Ka+PJr4jdUli+KSbHjcjj0YVqlUxCf8iQ+C774xXrJ6 uGJLPOw5LZsXmH70IGZyE9kLOGGBmIM+6OLndyyOIGCT/PPUxHsWZJmeW+cuOZowaRbj wStg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=6eg5yDfv8jFj72nLigI3mMM9MZYjPVwIP01ZSkDpmVQ=; b=ois97vXlAIMHwwEvm2MYoEaChRTYsEngIZN6mITmz8FfPQQPU+lTpD5JtNGbahQ5xh 9Q2X7FWbGHfivTSzY0H7LtHBMRDOgJ+fFw7uevQBxTJopxokSQ0WiWPSew+kKKpinqyT 8y8ehu6Tj5HXLPI3CE95BnhevBZJ95jCP7kpg+Dbm9yl/xsxUZVZUEYLNsPpxgg2yljZ s+ocjiWH6BJdvqUhsllEAd2ZUqrmtxZ9jmCnLvLadsH3A601z967Li/MtCZEg4RWrUcj 88zA2uv72H8ZjLKHnnpefJacW91NZMh5E/SneMqb1oBHJkmPzPdzvClFBo+VjApyE5rk Gosw== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x66-v6si6573036pfx.129.2018.08.01.10.58.39; Wed, 01 Aug 2018 10:58:54 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730841AbeHAToh (ORCPT + 99 others); Wed, 1 Aug 2018 15:44:37 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:49800 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2405944AbeHATIk (ORCPT ); Wed, 1 Aug 2018 15:08:40 -0400 Received: from localhost (D57E6652.static.ziggozakelijk.nl [213.126.102.82]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 820F2135E; Wed, 1 Aug 2018 17:13:16 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Adrian Hunter , Jiri Olsa , Arnaldo Carvalho de Melo , Alexander Shishkin , David Ahern , Namhyung Kim , Peter Zijlstra , Sasha Levin Subject: [PATCH 4.14 036/246] perf tools: Fix pmu events parsing rule Date: Wed, 1 Aug 2018 18:49:06 +0200 Message-Id: <20180801165013.410163673@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180801165011.700991984@linuxfoundation.org> References: <20180801165011.700991984@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Jiri Olsa [ Upstream commit ceac7b79df7bd67ef9aaf464b0179a2686aff4ee ] 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 ... Suggested-by: Adrian Hunter Signed-off-by: Jiri Olsa Tested-by: Arnaldo Carvalho de Melo Cc: Adrian Hunter Cc: Alexander Shishkin Cc: David Ahern Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lkml.kernel.org/r/20180605121416.31645-1-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- tools/perf/util/parse-events.y | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) --- a/tools/perf/util/parse-events.y +++ b/tools/perf/util/parse-events.y @@ -72,6 +72,7 @@ static void inc_group_count(struct list_ %type value_sym %type event_config %type opt_event_config +%type opt_pmu_config %type event_term %type event_pmu %type event_legacy_symbol @@ -223,7 +224,7 @@ event_def: event_pmu | event_bpf_file event_pmu: -PE_NAME opt_event_config +PE_NAME opt_pmu_config { struct list_head *list, *orig_terms, *terms; @@ -485,6 +486,17 @@ opt_event_config: { $$ = NULL; } + +opt_pmu_config: +'/' event_config '/' +{ + $$ = $2; +} +| +'/' '/' +{ + $$ = NULL; +} start_terms: event_config {