[RFC V4] perf, tools: Support wildcards on pmu name in dynamic pmu events

Arnaldo Carvalho de Melo acme at kernel.org
Thu Mar 8 05:03:58 PST 2018


Em Wed, Mar 07, 2018 at 03:35:47PM -0500, Agustin Vega-Frias escreveu:
> +++ b/tools/perf/util/parse-events.y
> @@ -8,6 +8,7 @@
> 
>  #define YYDEBUG 1
> 
> +#include <fnmatch.h>
>  #include <linux/compiler.h>
>  #include <linux/list.h>
>  #include <linux/types.h>
> @@ -234,6 +235,10 @@ PE_NAME opt_event_config
>  	if (parse_events_add_pmu(_parse_state, list, $1, $2)) {
>  		struct perf_pmu *pmu = NULL;
>  		int ok = 0;
> +		char *pattern;
> +
> +		if (asprintf(&pattern, "%s*", $1) < 0)
> +			YYABORT;

+               if (asprintf(&pattern, "?(uncore_)%s*", $1) < 0)

I completely overlook that you were using this and thus needed that
extension, duh, thanks for the patience 8-) and for the new patch.

- Arnaldo




More information about the linux-arm-kernel mailing list