4 #include <linux/bitmap.h>
5 #include <linux/perf_event.h>
9 PERF_PMU_FORMAT_VALUE_CONFIG
,
10 PERF_PMU_FORMAT_VALUE_CONFIG1
,
11 PERF_PMU_FORMAT_VALUE_CONFIG2
,
14 #define PERF_PMU_FORMAT_BITS 64
16 struct perf_event_attr
;
22 struct perf_event_attr
*default_config
;
24 struct list_head format
; /* HEAD struct perf_pmu_format -> list */
25 struct list_head aliases
; /* HEAD struct perf_pmu_alias -> list */
26 struct list_head list
; /* ELEM */
29 struct perf_pmu_info
{
36 #define UNIT_MAX_LEN 31 /* max length for event unit name */
38 struct perf_pmu_alias
{
40 struct list_head terms
; /* HEAD struct parse_events_term -> list */
41 struct list_head list
; /* ELEM */
42 char unit
[UNIT_MAX_LEN
+1];
48 struct perf_pmu
*perf_pmu__find(const char *name
);
49 int perf_pmu__config(struct perf_pmu
*pmu
, struct perf_event_attr
*attr
,
50 struct list_head
*head_terms
);
51 int perf_pmu__config_terms(struct list_head
*formats
,
52 struct perf_event_attr
*attr
,
53 struct list_head
*head_terms
,
55 int perf_pmu__check_alias(struct perf_pmu
*pmu
, struct list_head
*head_terms
,
56 struct perf_pmu_info
*info
);
57 struct list_head
*perf_pmu__alias(struct perf_pmu
*pmu
,
58 struct list_head
*head_terms
);
59 int perf_pmu_wrap(void);
60 void perf_pmu_error(struct list_head
*list
, char *name
, char const *msg
);
62 int perf_pmu__new_format(struct list_head
*list
, char *name
,
63 int config
, unsigned long *bits
);
64 void perf_pmu__set_format(unsigned long *bits
, long from
, long to
);
65 int perf_pmu__format_parse(char *dir
, struct list_head
*head
);
67 struct perf_pmu
*perf_pmu__scan(struct perf_pmu
*pmu
);
69 void print_pmu_events(const char *event_glob
, bool name_only
);
70 bool pmu_have_event(const char *pname
, const char *name
);
72 int perf_pmu__scan_file(struct perf_pmu
*pmu
, const char *name
, const char *fmt
,
73 ...) __attribute__((format(scanf
, 3, 4)));
75 int perf_pmu__test(void);
77 struct perf_event_attr
*perf_pmu__get_default_config(struct perf_pmu
*pmu
);