[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20161017114038.GD24552@krava>
Date: Mon, 17 Oct 2016 13:40:38 +0200
From: Jiri Olsa <jolsa@...hat.com>
To: Andi Kleen <andi@...stfloor.org>
Cc: acme@...nel.org, jolsa@...nel.org, sukadev@...ux.vnet.ibm.com,
eranian@...gle.com, linux-kernel@...r.kernel.org,
Andi Kleen <ak@...ux.intel.com>
Subject: Re: [PATCH 08/10] perf, tools: Expand PMU events by prefix match
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
Powered by blists - more mailing lists