perf pmu: Add hybrid helper functions
[linux-2.6-microblaze.git] / tools / perf / util / pmu.c
index 6e49c7b..88c8ecd 100644 (file)
@@ -40,6 +40,7 @@ int perf_pmu_parse(struct list_head *list, char *name);
 extern FILE *perf_pmu_in;
 
 static LIST_HEAD(pmus);
+static bool hybrid_scanned;
 
 /*
  * Parse & process all the sysfs attributes located under
@@ -1861,3 +1862,13 @@ void perf_pmu__warn_invalid_config(struct perf_pmu *pmu, __u64 config,
                   "'%llx' not supported by kernel)!\n",
                   name ?: "N/A", buf, config);
 }
+
+bool perf_pmu__has_hybrid(void)
+{
+       if (!hybrid_scanned) {
+               hybrid_scanned = true;
+               perf_pmu__scan(NULL);
+       }
+
+       return !list_empty(&perf_pmu__hybrid_pmus);
+}