lkml.org 
[lkml]   [2016]   [Oct]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 05/10] perf, tools: Support event aliases for non cpu// pmus
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

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