1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef __PMU_HYBRID_H
3 #define __PMU_HYBRID_H
4 
5 #include <linux/perf_event.h>
6 #include <linux/compiler.h>
7 #include <linux/list.h>
8 #include <stdbool.h>
9 #include "pmu.h"
10 
11 extern struct list_head perf_pmu__hybrid_pmus;
12 
13 #define perf_pmu__for_each_hybrid_pmu(pmu)	\
14 	list_for_each_entry(pmu, &perf_pmu__hybrid_pmus, hybrid_list)
15 
16 bool perf_pmu__hybrid_mounted(const char *name);
17 
18 struct perf_pmu *perf_pmu__find_hybrid_pmu(const char *name);
19 bool perf_pmu__is_hybrid(const char *name);
20 char *perf_pmu__hybrid_type_to_pmu(const char *type);
21 
perf_pmu__hybrid_pmu_num(void)22 static inline int perf_pmu__hybrid_pmu_num(void)
23 {
24 	struct perf_pmu *pmu;
25 	int num = 0;
26 
27 	perf_pmu__for_each_hybrid_pmu(pmu)
28 		num++;
29 
30 	return num;
31 }
32 
33 #endif /* __PMU_HYBRID_H */
34