summaryrefslogtreecommitdiffstats
path: root/tools/perf/util/pmu.c
diff options
context:
space:
mode:
authorAdrian Hunter <adrian.hunter@intel.com>2014-10-23 13:45:10 +0300
committerArnaldo Carvalho de Melo <acme@redhat.com>2014-10-29 10:32:48 -0200
commit42634bc7a02ead59cf2d50e60d8b8f825de8a3b0 (patch)
treee48293944290aa9388885a0a1990c8df439f72b2 /tools/perf/util/pmu.c
parented3077585f2f041e0db0fc41060b69673e98963b (diff)
downloadtalos-obmc-linux-42634bc7a02ead59cf2d50e60d8b8f825de8a3b0.tar.gz
talos-obmc-linux-42634bc7a02ead59cf2d50e60d8b8f825de8a3b0.zip
perf pmu: Let pmu's with no events show up on perf list
perf list only lists PMUs with events. Add a flag to cause a PMU to be also listed separately. Signed-off-by: Adrian Hunter <adrian.hunter@intel.com> Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Namhyung Kim <namhyung@gmail.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/r/1414061124-26830-3-git-send-email-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/pmu.c')
-rw-r--r--tools/perf/util/pmu.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/tools/perf/util/pmu.c b/tools/perf/util/pmu.c
index e243ad962a4d..91dca604c422 100644
--- a/tools/perf/util/pmu.c
+++ b/tools/perf/util/pmu.c
@@ -747,15 +747,18 @@ void print_pmu_events(const char *event_glob, bool name_only)
pmu = NULL;
len = 0;
- while ((pmu = perf_pmu__scan(pmu)) != NULL)
+ while ((pmu = perf_pmu__scan(pmu)) != NULL) {
list_for_each_entry(alias, &pmu->aliases, list)
len++;
+ if (pmu->selectable)
+ len++;
+ }
aliases = malloc(sizeof(char *) * len);
if (!aliases)
return;
pmu = NULL;
j = 0;
- while ((pmu = perf_pmu__scan(pmu)) != NULL)
+ while ((pmu = perf_pmu__scan(pmu)) != NULL) {
list_for_each_entry(alias, &pmu->aliases, list) {
char *name = format_alias(buf, sizeof(buf), pmu, alias);
bool is_cpu = !strcmp(pmu->name, "cpu");
@@ -772,6 +775,12 @@ void print_pmu_events(const char *event_glob, bool name_only)
aliases[j] = strdup(aliases[j]);
j++;
}
+ if (pmu->selectable) {
+ scnprintf(buf, sizeof(buf), "%s//", pmu->name);
+ aliases[j] = strdup(buf);
+ j++;
+ }
+ }
len = j;
qsort(aliases, len, sizeof(char *), cmp_string);
for (j = 0; j < len; j++) {
OpenPOWER on IntegriCloud