From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933834AbcJQLkm (ORCPT ); Mon, 17 Oct 2016 07:40:42 -0400 Received: from mx1.redhat.com ([209.132.183.28]:54232 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932477AbcJQLkl (ORCPT ); Mon, 17 Oct 2016 07:40:41 -0400 Date: Mon, 17 Oct 2016 13:40:38 +0200 From: Jiri Olsa To: Andi Kleen Cc: acme@kernel.org, jolsa@kernel.org, sukadev@linux.vnet.ibm.com, eranian@google.com, linux-kernel@vger.kernel.org, Andi Kleen Subject: Re: [PATCH 08/10] perf, tools: Expand PMU events by prefix match Message-ID: <20161017114038.GD24552@krava> References: <1476393332-20732-1-git-send-email-andi@firstfloor.org> <1476393332-20732-9-git-send-email-andi@firstfloor.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1476393332-20732-9-git-send-email-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]); Mon, 17 Oct 2016 11:40:41 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Oct 13, 2016 at 02:15:30PM -0700, Andi Kleen wrote: SNIP > diff --git a/tools/perf/util/parse-events.y b/tools/perf/util/parse-events.y > index 3a5196380609..790f0dd598b9 100644 > --- a/tools/perf/util/parse-events.y > +++ b/tools/perf/util/parse-events.y > @@ -224,11 +224,34 @@ 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)) > + name += 7; so there's a special treatment for uncore events, what if user says 'uncore_box/..' then? > + 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++; so we're ok if some of the events is not added? do we warn at least? thanks, jirka