Commit | Line | Data |
---|---|---|
cd82a32e JO |
1 | #ifndef __PMU_H |
2 | #define __PMU_H | |
3 | ||
d944c4ee | 4 | #include <linux/bitmap.h> |
d2709c7c | 5 | #include <linux/perf_event.h> |
dc098b35 | 6 | #include <stdbool.h> |
cd82a32e JO |
7 | |
8 | enum { | |
9 | PERF_PMU_FORMAT_VALUE_CONFIG, | |
10 | PERF_PMU_FORMAT_VALUE_CONFIG1, | |
11 | PERF_PMU_FORMAT_VALUE_CONFIG2, | |
12 | }; | |
13 | ||
14 | #define PERF_PMU_FORMAT_BITS 64 | |
15 | ||
cd82a32e JO |
16 | struct perf_pmu { |
17 | char *name; | |
18 | __u32 type; | |
7ae92e74 | 19 | struct cpu_map *cpus; |
cd82a32e | 20 | struct list_head format; |
a6146d50 | 21 | struct list_head aliases; |
cd82a32e JO |
22 | struct list_head list; |
23 | }; | |
24 | ||
b6b96fb4 | 25 | struct perf_pmu *perf_pmu__find(const char *name); |
cd82a32e JO |
26 | int perf_pmu__config(struct perf_pmu *pmu, struct perf_event_attr *attr, |
27 | struct list_head *head_terms); | |
cff7f956 JO |
28 | int perf_pmu__config_terms(struct list_head *formats, |
29 | struct perf_event_attr *attr, | |
30 | struct list_head *head_terms); | |
410136f5 | 31 | int perf_pmu__check_alias(struct perf_pmu *pmu, struct list_head *head_terms, |
8a398897 | 32 | const char **unit, double *scale); |
a6146d50 | 33 | struct list_head *perf_pmu__alias(struct perf_pmu *pmu, |
5c6ccc37 | 34 | struct list_head *head_terms); |
cd82a32e JO |
35 | int perf_pmu_wrap(void); |
36 | void perf_pmu_error(struct list_head *list, char *name, char const *msg); | |
37 | ||
38 | int perf_pmu__new_format(struct list_head *list, char *name, | |
39 | int config, unsigned long *bits); | |
40 | void perf_pmu__set_format(unsigned long *bits, long from, long to); | |
cff7f956 | 41 | int perf_pmu__format_parse(char *dir, struct list_head *head); |
cd82a32e | 42 | |
50a9667c RR |
43 | struct perf_pmu *perf_pmu__scan(struct perf_pmu *pmu); |
44 | ||
dc098b35 | 45 | void print_pmu_events(const char *event_glob, bool name_only); |
4cabc3d1 | 46 | bool pmu_have_event(const char *pname, const char *name); |
dc098b35 | 47 | |
cd82a32e JO |
48 | int perf_pmu__test(void); |
49 | #endif /* __PMU_H */ |