lkml.org 
[lkml]   [2016]   [Oct]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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

\
 
 \ /
  Last update: 2016-10-17 13:41    [W:0.188 / U:0.216 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site