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> |
David Howells | d2709c7 | 2012-11-19 22:21:03 +0000 | [diff] [blame] | 5 | #include <linux/perf_event.h> |
Jiri Olsa | cd82a32 | 2012-03-15 20:09:17 +0100 | [diff] [blame] | 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 | |
Jiri Olsa | cd82a32 | 2012-03-15 20:09:17 +0100 | [diff] [blame] | 15 | struct perf_pmu { |
| 16 | char *name; |
| 17 | __u32 type; |
Yan, Zheng | 7ae92e7 | 2012-09-10 15:53:50 +0800 | [diff] [blame] | 18 | struct cpu_map *cpus; |
Jiri Olsa | cd82a32 | 2012-03-15 20:09:17 +0100 | [diff] [blame] | 19 | struct list_head format; |
Zheng Yan | a6146d5 | 2012-06-15 14:31:41 +0800 | [diff] [blame] | 20 | struct list_head aliases; |
Jiri Olsa | cd82a32 | 2012-03-15 20:09:17 +0100 | [diff] [blame] | 21 | struct list_head list; |
| 22 | }; |
| 23 | |
Adrian Hunter | b6b96fb | 2013-07-04 16:20:25 +0300 | [diff] [blame^] | 24 | struct perf_pmu *perf_pmu__find(const char *name); |
Jiri Olsa | cd82a32 | 2012-03-15 20:09:17 +0100 | [diff] [blame] | 25 | int perf_pmu__config(struct perf_pmu *pmu, struct perf_event_attr *attr, |
| 26 | struct list_head *head_terms); |
Jiri Olsa | cff7f95 | 2012-11-10 01:46:50 +0100 | [diff] [blame] | 27 | int perf_pmu__config_terms(struct list_head *formats, |
| 28 | struct perf_event_attr *attr, |
| 29 | struct list_head *head_terms); |
Zheng Yan | a6146d5 | 2012-06-15 14:31:41 +0800 | [diff] [blame] | 30 | int perf_pmu__check_alias(struct perf_pmu *pmu, struct list_head *head_terms); |
| 31 | struct list_head *perf_pmu__alias(struct perf_pmu *pmu, |
Arnaldo Carvalho de Melo | 5c6ccc3 | 2013-01-18 16:54:00 -0300 | [diff] [blame] | 32 | struct list_head *head_terms); |
Jiri Olsa | cd82a32 | 2012-03-15 20:09:17 +0100 | [diff] [blame] | 33 | int perf_pmu_wrap(void); |
| 34 | void perf_pmu_error(struct list_head *list, char *name, char const *msg); |
| 35 | |
| 36 | int perf_pmu__new_format(struct list_head *list, char *name, |
| 37 | int config, unsigned long *bits); |
| 38 | void perf_pmu__set_format(unsigned long *bits, long from, long to); |
Jiri Olsa | cff7f95 | 2012-11-10 01:46:50 +0100 | [diff] [blame] | 39 | int perf_pmu__format_parse(char *dir, struct list_head *head); |
Jiri Olsa | cd82a32 | 2012-03-15 20:09:17 +0100 | [diff] [blame] | 40 | |
Robert Richter | 50a9667 | 2012-08-16 21:10:24 +0200 | [diff] [blame] | 41 | struct perf_pmu *perf_pmu__scan(struct perf_pmu *pmu); |
| 42 | |
Jiri Olsa | cd82a32 | 2012-03-15 20:09:17 +0100 | [diff] [blame] | 43 | int perf_pmu__test(void); |
| 44 | #endif /* __PMU_H */ |