summaryrefslogtreecommitdiff
path: root/tools/perf/util/pmu.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/util/pmu.c')
-rw-r--r--tools/perf/util/pmu.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/tools/perf/util/pmu.c b/tools/perf/util/pmu.c
index 5a7bfbf621d0..65daa0cc71d6 100644
--- a/tools/perf/util/pmu.c
+++ b/tools/perf/util/pmu.c
@@ -1660,6 +1660,23 @@ bool perf_pmu__auto_merge_stats(const struct perf_pmu *pmu)
return !is_pmu_hybrid(pmu->name);
}
+static bool perf_pmu__is_mem_pmu(const struct perf_pmu *pmu)
+{
+ return pmu->is_core;
+}
+
+int perf_pmu__num_mem_pmus(void)
+{
+ struct perf_pmu *pmu = NULL;
+ int count = 0;
+
+ while ((pmu = perf_pmu__scan(pmu)) != NULL) {
+ if (perf_pmu__is_mem_pmu(pmu))
+ count++;
+ }
+ return count;
+}
+
static bool pmu_alias_is_duplicate(struct sevent *alias_a,
struct sevent *alias_b)
{