From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933553AbcJQJfv (ORCPT ); Mon, 17 Oct 2016 05:35:51 -0400 Received: from mx1.redhat.com ([209.132.183.28]:41512 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932727AbcJQJfo (ORCPT ); Mon, 17 Oct 2016 05:35:44 -0400 Date: Mon, 17 Oct 2016 11:35:40 +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 05/10] perf, tools: Support event aliases for non cpu// pmus Message-ID: <20161017093540.GA17938@krava> References: <1476393332-20732-1-git-send-email-andi@firstfloor.org> <1476393332-20732-6-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-6-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 09:35:43 +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:27PM -0700, Andi Kleen wrote: SNIP > @@ -236,15 +237,32 @@ PE_KERNEL_PMU_EVENT sep_dc > struct list_head *head; > struct parse_events_term *term; > struct list_head *list; > + struct perf_pmu *pmu = NULL; > + int ok = 0; > > - ALLOC_LIST(head); > - ABORT_ON(parse_events_term__num(&term, PARSE_EVENTS__TERM_TYPE_USER, > - $1, 1, &@1, NULL)); > - list_add_tail(&term->list, head); > - > + /* Add it for all PMUs that support the alias */ > ALLOC_LIST(list); > - ABORT_ON(parse_events_add_pmu(data, list, "cpu", head)); > - parse_events_terms__delete(head); > + while ((pmu = perf_pmu__scan(pmu)) != NULL) { > + struct perf_pmu_alias *alias; > + > + list_for_each_entry(alias, &pmu->aliases, list) { > + if (!strcasecmp(alias->name, $1)) { > + ALLOC_LIST(head); > + ABORT_ON(parse_events_term__num(&term, PARSE_EVENTS__TERM_TYPE_USER, > + $1, 1, &@1, NULL)); > + list_add_tail(&term->list, head); > + > + if (!parse_events_add_pmu(data, list, > + pmu->name, head)) { > + ok++; > + } > + > + parse_events_terms__delete(head); > + } > + } > + } > + if (!ok) > + YYABORT; > $$ = list; > } > | how about the next rule: PE_PMU_EVENT_PRE '-' PE_PMU_EVENT_SUF sep_dc I think that must be changed as well jirka