blob: d17b5656bacf07344c0ad2c57313a661f602bdf6 [file] [log] [blame]
Jiri Olsacd82a322012-03-15 20:09:17 +01001#ifndef __PMU_H
2#define __PMU_H
3
4#include <linux/bitops.h>
David Howellsd2709c72012-11-19 22:21:03 +00005#include <linux/perf_event.h>
Jiri Olsacd82a322012-03-15 20:09:17 +01006
7enum {
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 Olsacd82a322012-03-15 20:09:17 +010015struct perf_pmu {
16 char *name;
17 __u32 type;
Yan, Zheng7ae92e72012-09-10 15:53:50 +080018 struct cpu_map *cpus;
Jiri Olsacd82a322012-03-15 20:09:17 +010019 struct list_head format;
Zheng Yana6146d52012-06-15 14:31:41 +080020 struct list_head aliases;
Jiri Olsacd82a322012-03-15 20:09:17 +010021 struct list_head list;
22};
23
Adrian Hunterb6b96fb2013-07-04 16:20:25 +030024struct perf_pmu *perf_pmu__find(const char *name);
Jiri Olsacd82a322012-03-15 20:09:17 +010025int perf_pmu__config(struct perf_pmu *pmu, struct perf_event_attr *attr,
26 struct list_head *head_terms);
Jiri Olsacff7f952012-11-10 01:46:50 +010027int perf_pmu__config_terms(struct list_head *formats,
28 struct perf_event_attr *attr,
29 struct list_head *head_terms);
Zheng Yana6146d52012-06-15 14:31:41 +080030int perf_pmu__check_alias(struct perf_pmu *pmu, struct list_head *head_terms);
31struct list_head *perf_pmu__alias(struct perf_pmu *pmu,
Arnaldo Carvalho de Melo5c6ccc32013-01-18 16:54:00 -030032 struct list_head *head_terms);
Jiri Olsacd82a322012-03-15 20:09:17 +010033int perf_pmu_wrap(void);
34void perf_pmu_error(struct list_head *list, char *name, char const *msg);
35
36int perf_pmu__new_format(struct list_head *list, char *name,
37 int config, unsigned long *bits);
38void perf_pmu__set_format(unsigned long *bits, long from, long to);
Jiri Olsacff7f952012-11-10 01:46:50 +010039int perf_pmu__format_parse(char *dir, struct list_head *head);
Jiri Olsacd82a322012-03-15 20:09:17 +010040
Robert Richter50a96672012-08-16 21:10:24 +020041struct perf_pmu *perf_pmu__scan(struct perf_pmu *pmu);
42
Jiri Olsacd82a322012-03-15 20:09:17 +010043int perf_pmu__test(void);
44#endif /* __PMU_H */