From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754028AbdBHLbB (ORCPT ); Wed, 8 Feb 2017 06:31:01 -0500 Received: from mx1.redhat.com ([209.132.183.28]:43884 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753153AbdBHLbA (ORCPT ); Wed, 8 Feb 2017 06:31:00 -0500 Date: Wed, 8 Feb 2017 12:30:57 +0100 From: Jiri Olsa To: Andi Kleen Cc: acme@kernel.org, jolsa@kernel.org, linux-kernel@vger.kernel.org, Andi Kleen Subject: Re: [PATCH 07/10] perf, tools: Expand PMU events by prefix match Message-ID: <20170208113057.GA10639@krava> References: <20170128020345.19007-1-andi@firstfloor.org> <20170128020345.19007-8-andi@firstfloor.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170128020345.19007-8-andi@firstfloor.org> User-Agent: Mutt/1.7.1 (2016-10-04) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Wed, 08 Feb 2017 11:31:00 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jan 27, 2017 at 06:03:42PM -0800, Andi Kleen wrote: SNIP > enum perf_pmu_event_symbol_type > perf_pmu__parse_check(const char *name); > void parse_events__set_leader(char *name, struct list_head *list); > diff --git a/tools/perf/util/parse-events.y b/tools/perf/util/parse-events.y > index 3a5196380609..1c2788f69bf1 100644 > --- a/tools/perf/util/parse-events.y > +++ b/tools/perf/util/parse-events.y > @@ -224,68 +224,55 @@ event_pmu: > PE_NAME opt_event_config > { > struct parse_events_evlist *data = _data; > - struct list_head *list; > + struct list_head *list, *orig_terms, *terms; > + > + if (parse_events_copy_term_list($2, &orig_terms)) > + YYABORT; > > ALLOC_LIST(list); > - ABORT_ON(parse_events_add_pmu(data, list, $1, $2)); > + if (parse_events_add_pmu(data, list, $1, $2)) { > + struct perf_pmu *pmu = NULL; > + int ok = 0; > + > + while ((pmu = perf_pmu__scan(pmu)) != NULL) { > + char *name = pmu->name; > + > + if (!strncmp(name, "uncore_", 7) && > + strncmp($1, "uncore_", 7)) > + name += 7; > + if (!strncmp($1, name, strlen($1))) { > + if (parse_events_copy_term_list(orig_terms, &terms)) > + YYABORT; > + if (!parse_events_add_pmu(data, list, pmu->name, terms)) > + ok++; > + parse_events_terms__delete(terms); could you please split this into 2 changes: - adding parse_events_multi_pmu_add with no functional changes - uncore box related matching thanks, jirka