Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1576479

Re: [PATCH 07/10] perf, tools: Expand PMU events by prefix match

From Jiri Olsa <jolsa@redhat.com>
Newsgroups linux.kernel
Subject Re: [PATCH 07/10] perf, tools: Expand PMU events by prefix match
Date 2017-02-08 12:40 +0100
Message-ID <t8yLo-8bT-13@gated-at.bofh.it> (permalink)
References <t4qCK-3Iy-5@gated-at.bofh.it> <t4qMp-3LQ-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Fri, Jan 27, 2017 at 06:03:42PM -0800, Andi Kleen wrote:

SNIP

>  enum perf_pmu_event_symbol_type
>  perf_pmu__parse_check(const char *name);
>  void parse_events__set_leader(char *name, struct list_head *list);
> diff --git a/tools/perf/util/parse-events.y b/tools/perf/util/parse-events.y
> index 3a5196380609..1c2788f69bf1 100644
> --- a/tools/perf/util/parse-events.y
> +++ b/tools/perf/util/parse-events.y
> @@ -224,68 +224,55 @@ 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) &&
> +			    strncmp($1, "uncore_", 7))
> +				name += 7;
> +			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++;
> +				parse_events_terms__delete(terms);

could you please split this into 2 changes:
  - adding parse_events_multi_pmu_add with no functional changes
  - uncore box related matching

thanks,
jirka

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

Re: [PATCH 07/10] perf, tools: Expand PMU events by prefix match Jiri Olsa <jolsa@redhat.com> - 2017-02-08 12:40 +0100

csiph-web