perf list: Honour 'event_glob' whem printing selectable PMUs
tip-bot for Arnaldo Carvalho de Melo
merge botCommit-ID: fa52ceabc2a3e70431a82bca2bc547a15eaf19df Gitweb: http://git.kernel.org/tip/fa52ceabc2a3e70431a82bca2bc547a15eaf19df Author: Arnaldo Carvalho de Melo <[email protected]> AuthorDate: Fri, 2 Oct 2015 15:28:16 -0300 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitDate: Fri, 2 Oct 2015 15:28:16 -0300
perf list: Honour 'event_glob' whem printing selectable PMUs
Some PMUs, like the 'intel_bts' one can be used as an event name, i.e.:
$ perf record -e intel_bts:// usleep 1
Is a valid event name.
But the code printing such PMUs was not honouring the 'event_glob' parameter, so the following line was always appearing:
$ intel_bts// [Kernel PMU event]
Fix it:
$ [acme@felicio linux]$ perf list data
List of pre-defined events (to be used in -e):
uncore_imc/data_reads/ [Kernel PMU event]
uncore_imc/data_writes/ [Kernel PMU event]
$
Cc Adrian Hunter <[email protected]>
Cc Borislav Petkov <[email protected]>
Cc David Ahern <[email protected]>
Cc Frederic Weisbecker <[email protected]>
Cc Jiri Olsa <[email protected]>
Cc Namhyung Kim <[email protected]>
Cc Stephane Eranian <[email protected]>
Signed-off-by Arnaldo Carvalho de Melo <[email protected]>
--- tools/perf/util/pmu.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
tools/perf/util/pmu.c +2 -1
@@ -1008,7 +1008,8 @@ void print_pmu_events(const char *event_glob, bool name_only) goto out_enomem; j++; } -if (pmu->selectable) { +if (pmu->selectable && + (event_glob ==NULL ||strglobmatch (pmu->name, event_glob))) {char *s;if (asprintf (&s,"%s//" , pmu->name) <0 ) goto out_enomem;