4 #include <linux/bitmap.h>
5 #include <linux/perf_event.h>
8 #include "parse-events.h"
11 PERF_PMU_FORMAT_VALUE_CONFIG
,
12 PERF_PMU_FORMAT_VALUE_CONFIG1
,
13 PERF_PMU_FORMAT_VALUE_CONFIG2
,
16 #define PERF_PMU_FORMAT_BITS 64
18 struct perf_event_attr
;
24 struct perf_event_attr
*default_config
;
26 struct list_head format
; /* HEAD struct perf_pmu_format -> list */
27 struct list_head aliases
; /* HEAD struct perf_pmu_alias -> list */
28 struct list_head list
; /* ELEM */
29 int (*set_drv_config
) (struct perf_evsel_config_term
*term
);
32 struct perf_pmu_info
{
34 const char *metric_expr
;
35 const char *metric_name
;
41 #define UNIT_MAX_LEN 31 /* max length for event unit name */
43 struct perf_pmu_alias
{
49 struct list_head terms
; /* HEAD struct parse_events_term -> list */
50 struct list_head list
; /* ELEM */
51 char unit
[UNIT_MAX_LEN
+1];
59 struct perf_pmu
*perf_pmu__find(const char *name
);
60 int perf_pmu__config(struct perf_pmu
*pmu
, struct perf_event_attr
*attr
,
61 struct list_head
*head_terms
,
62 struct parse_events_error
*error
);
63 int perf_pmu__config_terms(struct list_head
*formats
,
64 struct perf_event_attr
*attr
,
65 struct list_head
*head_terms
,
66 bool zero
, struct parse_events_error
*error
);
67 __u64
perf_pmu__format_bits(struct list_head
*formats
, const char *name
);
68 int perf_pmu__check_alias(struct perf_pmu
*pmu
, struct list_head
*head_terms
,
69 struct perf_pmu_info
*info
);
70 struct list_head
*perf_pmu__alias(struct perf_pmu
*pmu
,
71 struct list_head
*head_terms
);
72 int perf_pmu_wrap(void);
73 void perf_pmu_error(struct list_head
*list
, char *name
, char const *msg
);
75 int perf_pmu__new_format(struct list_head
*list
, char *name
,
76 int config
, unsigned long *bits
);
77 void perf_pmu__set_format(unsigned long *bits
, long from
, long to
);
78 int perf_pmu__format_parse(char *dir
, struct list_head
*head
);
80 struct perf_pmu
*perf_pmu__scan(struct perf_pmu
*pmu
);
82 void print_pmu_events(const char *event_glob
, bool name_only
, bool quiet
,
83 bool long_desc
, bool details_flag
);
84 bool pmu_have_event(const char *pname
, const char *name
);
86 int perf_pmu__scan_file(struct perf_pmu
*pmu
, const char *name
, const char *fmt
,
87 ...) __attribute__((format(scanf
, 3, 4)));
89 int perf_pmu__test(void);
91 struct perf_event_attr
*perf_pmu__get_default_config(struct perf_pmu
*pmu
);