Jiri Olsa | cd82a32 | 2012-03-15 20:09:17 +0100 | [diff] [blame] | 1 | #ifndef __PMU_H |
| 2 | #define __PMU_H |
| 3 | |
| 4 | #include <linux/bitops.h> |
| 5 | #include "../../../include/linux/perf_event.h" |
| 6 | |
| 7 | enum { |
| 8 | PERF_PMU_FORMAT_VALUE_CONFIG, |
| 9 | PERF_PMU_FORMAT_VALUE_CONFIG1, |
| 10 | PERF_PMU_FORMAT_VALUE_CONFIG2, |
| 11 | }; |
| 12 | |
| 13 | #define PERF_PMU_FORMAT_BITS 64 |
| 14 | |
| 15 | struct perf_pmu__format { |
| 16 | char *name; |
| 17 | int value; |
| 18 | DECLARE_BITMAP(bits, PERF_PMU_FORMAT_BITS); |
| 19 | struct list_head list; |
| 20 | }; |
| 21 | |
Zheng Yan | a6146d5 | 2012-06-15 14:31:41 +0800 | [diff] [blame] | 22 | struct perf_pmu__alias { |
| 23 | char *name; |
| 24 | struct list_head terms; |
| 25 | struct list_head list; |
| 26 | }; |
| 27 | |
Jiri Olsa | cd82a32 | 2012-03-15 20:09:17 +0100 | [diff] [blame] | 28 | struct perf_pmu { |
| 29 | char *name; |
| 30 | __u32 type; |
| 31 | struct list_head format; |
Zheng Yan | a6146d5 | 2012-06-15 14:31:41 +0800 | [diff] [blame] | 32 | struct list_head aliases; |
Jiri Olsa | cd82a32 | 2012-03-15 20:09:17 +0100 | [diff] [blame] | 33 | struct list_head list; |
| 34 | }; |
| 35 | |
| 36 | struct perf_pmu *perf_pmu__find(char *name); |
| 37 | int perf_pmu__config(struct perf_pmu *pmu, struct perf_event_attr *attr, |
| 38 | struct list_head *head_terms); |
Zheng Yan | a6146d5 | 2012-06-15 14:31:41 +0800 | [diff] [blame] | 39 | int perf_pmu__check_alias(struct perf_pmu *pmu, struct list_head *head_terms); |
| 40 | struct list_head *perf_pmu__alias(struct perf_pmu *pmu, |
| 41 | struct list_head *head_terms); |
Jiri Olsa | cd82a32 | 2012-03-15 20:09:17 +0100 | [diff] [blame] | 42 | int perf_pmu_wrap(void); |
| 43 | void perf_pmu_error(struct list_head *list, char *name, char const *msg); |
| 44 | |
| 45 | int perf_pmu__new_format(struct list_head *list, char *name, |
| 46 | int config, unsigned long *bits); |
| 47 | void perf_pmu__set_format(unsigned long *bits, long from, long to); |
| 48 | |
| 49 | int perf_pmu__test(void); |
| 50 | #endif /* __PMU_H */ |