Linux Perf
evsel.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef __PERF_EVSEL_H
3 #define __PERF_EVSEL_H 1
4 
5 #include <linux/list.h>
6 #include <stdbool.h>
7 #include <stddef.h>
8 #include <linux/perf_event.h>
9 #include <linux/types.h>
10 #include "xyarray.h"
11 #include "symbol.h"
12 #include "cpumap.h"
13 #include "counts.h"
14 
15 struct perf_evsel;
16 
17 /*
18  * Per fd, to map back from PERF_SAMPLE_ID to evsel, only used when there are
19  * more than one entry in the evlist.
20  */
22  struct hlist_node node;
23  u64 id;
24  struct perf_evsel *evsel;
25  int idx;
26  int cpu;
27  pid_t tid;
28 
29  /* Holds total ID period value for PERF_SAMPLE_READ processing. */
30  u64 period;
31 };
32 
33 struct cgroup;
34 
35 /*
36  * The 'struct perf_evsel_config_term' is used to pass event
37  * specific configuration data to perf_evsel__config routine.
38  * It is allocated within event parsing and attached to
39  * perf_evsel::config_terms list head.
40 */
41 enum term_type {
52 };
53 
55  struct list_head list;
56  enum term_type type;
57  union {
58  u64 period;
59  u64 freq;
60  bool time;
61  char *callgraph;
62  char *drv_cfg;
64  int max_stack;
65  bool inherit;
66  bool overwrite;
67  char *branch;
68  } val;
69  bool weak;
70 };
71 
72 struct perf_stat_evsel;
73 
90 struct perf_evsel {
91  struct list_head node;
93  struct perf_event_attr attr;
94  char *filter;
95  struct xyarray *fd;
96  struct xyarray *sample_id;
97  u64 *id;
100  int idx;
101  u32 ids;
102  char *name;
103  double scale;
104  const char *unit;
105  struct event_format *tp_format;
106  off_t id_offset;
108  void *priv;
109  u64 db_id;
110  struct cgroup *cgrp;
111  void *handler;
112  struct cpu_map *cpus;
113  struct cpu_map *own_cpus;
115  unsigned int sample_size;
116  int id_pos;
117  int is_pos;
119  bool snapshot;
120  bool supported;
123  bool immediate;
125  bool tracking;
126  bool per_pkg;
131  /* parse modifier helper */
135  unsigned long *per_pkg_mask;
137  char *group_name;
139  struct list_head config_terms;
140  int bpf_fd;
143  const char * metric_expr;
144  const char * metric_name;
148  const char *pmu_name;
149 };
150 
151 union u64_swap {
152  u64 val64;
153  u32 val32[2];
154 };
155 
159  bool mmap2;
160  bool cloexec;
161  bool clockid;
163  bool lbr_flags;
166 };
167 
169 
170 struct cpu_map;
171 struct target;
172 struct thread_map;
173 struct record_opts;
174 
175 static inline struct cpu_map *perf_evsel__cpus(struct perf_evsel *evsel)
176 {
177  return evsel->cpus;
178 }
179 
180 static inline int perf_evsel__nr_cpus(struct perf_evsel *evsel)
181 {
182  return perf_evsel__cpus(evsel)->nr;
183 }
184 
186  bool scale, s8 *pscaled);
187 
188 void perf_evsel__compute_deltas(struct perf_evsel *evsel, int cpu, int thread,
189  struct perf_counts_values *count);
190 
191 int perf_evsel__object_config(size_t object_size,
192  int (*init)(struct perf_evsel *evsel),
193  void (*fini)(struct perf_evsel *evsel));
194 
195 struct perf_evsel *perf_evsel__new_idx(struct perf_event_attr *attr, int idx);
196 
197 static inline struct perf_evsel *perf_evsel__new(struct perf_event_attr *attr)
198 {
199  return perf_evsel__new_idx(attr, 0);
200 }
201 
202 struct perf_evsel *perf_evsel__newtp_idx(const char *sys, const char *name, int idx);
203 
204 /*
205  * Returns pointer with encoded error via <linux/err.h> interface.
206  */
207 static inline struct perf_evsel *perf_evsel__newtp(const char *sys, const char *name)
208 {
209  return perf_evsel__newtp_idx(sys, name, 0);
210 }
211 
212 struct perf_evsel *perf_evsel__new_cycles(bool precise);
213 
214 struct event_format *event_format__new(const char *sys, const char *name);
215 
216 void perf_evsel__init(struct perf_evsel *evsel,
217  struct perf_event_attr *attr, int idx);
218 void perf_evsel__exit(struct perf_evsel *evsel);
219 void perf_evsel__delete(struct perf_evsel *evsel);
220 
221 struct callchain_param;
222 
223 void perf_evsel__config(struct perf_evsel *evsel,
224  struct record_opts *opts,
225  struct callchain_param *callchain);
226 void perf_evsel__config_callchain(struct perf_evsel *evsel,
227  struct record_opts *opts,
228  struct callchain_param *callchain);
229 
230 int __perf_evsel__sample_size(u64 sample_type);
231 void perf_evsel__calc_id_pos(struct perf_evsel *evsel);
232 
233 bool perf_evsel__is_cache_op_valid(u8 type, u8 op);
234 
235 #define PERF_EVSEL__MAX_ALIASES 8
236 
237 extern const char *perf_evsel__hw_cache[PERF_COUNT_HW_CACHE_MAX]
239 extern const char *perf_evsel__hw_cache_op[PERF_COUNT_HW_CACHE_OP_MAX]
241 extern const char *perf_evsel__hw_cache_result[PERF_COUNT_HW_CACHE_RESULT_MAX]
243 extern const char *perf_evsel__hw_names[PERF_COUNT_HW_MAX];
244 extern const char *perf_evsel__sw_names[PERF_COUNT_SW_MAX];
245 int __perf_evsel__hw_cache_type_op_res_name(u8 type, u8 op, u8 result,
246  char *bf, size_t size);
247 const char *perf_evsel__name(struct perf_evsel *evsel);
248 
249 const char *perf_evsel__group_name(struct perf_evsel *evsel);
250 int perf_evsel__group_desc(struct perf_evsel *evsel, char *buf, size_t size);
251 
252 int perf_evsel__alloc_id(struct perf_evsel *evsel, int ncpus, int nthreads);
253 void perf_evsel__close_fd(struct perf_evsel *evsel);
254 
255 void __perf_evsel__set_sample_bit(struct perf_evsel *evsel,
256  enum perf_event_sample_format bit);
257 void __perf_evsel__reset_sample_bit(struct perf_evsel *evsel,
258  enum perf_event_sample_format bit);
259 
260 #define perf_evsel__set_sample_bit(evsel, bit) \
261  __perf_evsel__set_sample_bit(evsel, PERF_SAMPLE_##bit)
262 
263 #define perf_evsel__reset_sample_bit(evsel, bit) \
264  __perf_evsel__reset_sample_bit(evsel, PERF_SAMPLE_##bit)
265 
266 void perf_evsel__set_sample_id(struct perf_evsel *evsel,
267  bool use_sample_identifier);
268 
269 int perf_evsel__set_filter(struct perf_evsel *evsel, const char *filter);
270 int perf_evsel__append_tp_filter(struct perf_evsel *evsel, const char *filter);
272  const char *filter);
273 int perf_evsel__apply_filter(struct perf_evsel *evsel, const char *filter);
274 int perf_evsel__enable(struct perf_evsel *evsel);
275 int perf_evsel__disable(struct perf_evsel *evsel);
276 
277 int perf_evsel__open_per_cpu(struct perf_evsel *evsel,
278  struct cpu_map *cpus);
279 int perf_evsel__open_per_thread(struct perf_evsel *evsel,
280  struct thread_map *threads);
281 int perf_evsel__open(struct perf_evsel *evsel, struct cpu_map *cpus,
282  struct thread_map *threads);
283 void perf_evsel__close(struct perf_evsel *evsel);
284 
285 struct perf_sample;
286 
287 void *perf_evsel__rawptr(struct perf_evsel *evsel, struct perf_sample *sample,
288  const char *name);
289 u64 perf_evsel__intval(struct perf_evsel *evsel, struct perf_sample *sample,
290  const char *name);
291 
292 static inline char *perf_evsel__strval(struct perf_evsel *evsel,
293  struct perf_sample *sample,
294  const char *name)
295 {
296  return perf_evsel__rawptr(evsel, sample, name);
297 }
298 
299 struct format_field;
300 
301 u64 format_field__intval(struct format_field *field, struct perf_sample *sample, bool needs_swap);
302 
303 struct format_field *perf_evsel__field(struct perf_evsel *evsel, const char *name);
304 
305 #define perf_evsel__match(evsel, t, c) \
306  (evsel->attr.type == PERF_TYPE_##t && \
307  evsel->attr.config == PERF_COUNT_##c)
308 
309 static inline bool perf_evsel__match2(struct perf_evsel *e1,
310  struct perf_evsel *e2)
311 {
312  return (e1->attr.type == e2->attr.type) &&
313  (e1->attr.config == e2->attr.config);
314 }
315 
316 #define perf_evsel__cmp(a, b) \
317  ((a) && \
318  (b) && \
319  (a)->attr.type == (b)->attr.type && \
320  (a)->attr.config == (b)->attr.config)
321 
322 int perf_evsel__read(struct perf_evsel *evsel, int cpu, int thread,
323  struct perf_counts_values *count);
324 
325 int perf_evsel__read_counter(struct perf_evsel *evsel, int cpu, int thread);
326 
327 int __perf_evsel__read_on_cpu(struct perf_evsel *evsel,
328  int cpu, int thread, bool scale);
329 
337 static inline int perf_evsel__read_on_cpu(struct perf_evsel *evsel,
338  int cpu, int thread)
339 {
340  return __perf_evsel__read_on_cpu(evsel, cpu, thread, false);
341 }
342 
350 static inline int perf_evsel__read_on_cpu_scaled(struct perf_evsel *evsel,
351  int cpu, int thread)
352 {
353  return __perf_evsel__read_on_cpu(evsel, cpu, thread, true);
354 }
355 
356 int perf_evsel__parse_sample(struct perf_evsel *evsel, union perf_event *event,
357  struct perf_sample *sample);
358 
360  union perf_event *event,
361  u64 *timestamp);
362 
363 static inline struct perf_evsel *perf_evsel__next(struct perf_evsel *evsel)
364 {
365  return list_entry(evsel->node.next, struct perf_evsel, node);
366 }
367 
368 static inline struct perf_evsel *perf_evsel__prev(struct perf_evsel *evsel)
369 {
370  return list_entry(evsel->node.prev, struct perf_evsel, node);
371 }
372 
380 static inline bool perf_evsel__is_group_leader(const struct perf_evsel *evsel)
381 {
382  return evsel->leader == evsel;
383 }
384 
393 static inline bool perf_evsel__is_group_event(struct perf_evsel *evsel)
394 {
396  return false;
397 
398  return perf_evsel__is_group_leader(evsel) && evsel->nr_members > 1;
399 }
400 
401 bool perf_evsel__is_function_event(struct perf_evsel *evsel);
402 
403 static inline bool perf_evsel__is_bpf_output(struct perf_evsel *evsel)
404 {
405  struct perf_event_attr *attr = &evsel->attr;
406 
407  return (attr->config == PERF_COUNT_SW_BPF_OUTPUT) &&
408  (attr->type == PERF_TYPE_SOFTWARE);
409 }
410 
412  bool freq;
413  bool verbose;
415  bool force;
417 };
418 
419 int perf_evsel__fprintf(struct perf_evsel *evsel,
420  struct perf_attr_details *details, FILE *fp);
421 
422 #define EVSEL__PRINT_IP (1<<0)
423 #define EVSEL__PRINT_SYM (1<<1)
424 #define EVSEL__PRINT_DSO (1<<2)
425 #define EVSEL__PRINT_SYMOFFSET (1<<3)
426 #define EVSEL__PRINT_ONELINE (1<<4)
427 #define EVSEL__PRINT_SRCLINE (1<<5)
428 #define EVSEL__PRINT_UNKNOWN_AS_ADDR (1<<6)
429 #define EVSEL__PRINT_CALLCHAIN_ARROW (1<<7)
430 #define EVSEL__PRINT_SKIP_IGNORED (1<<8)
431 
432 struct callchain_cursor;
433 
434 int sample__fprintf_callchain(struct perf_sample *sample, int left_alignment,
435  unsigned int print_opts,
436  struct callchain_cursor *cursor, FILE *fp);
437 
438 int sample__fprintf_sym(struct perf_sample *sample, struct addr_location *al,
439  int left_alignment, unsigned int print_opts,
440  struct callchain_cursor *cursor, FILE *fp);
441 
442 bool perf_evsel__fallback(struct perf_evsel *evsel, int err,
443  char *msg, size_t msgsize);
444 int perf_evsel__open_strerror(struct perf_evsel *evsel, struct target *target,
445  int err, char *msg, size_t size);
446 
447 static inline int perf_evsel__group_idx(struct perf_evsel *evsel)
448 {
449  return evsel->idx - evsel->leader->idx;
450 }
451 
452 #define for_each_group_member(_evsel, _leader) \
453 for ((_evsel) = list_entry((_leader)->node.next, struct perf_evsel, node); \
454  (_evsel) && (_evsel)->leader == (_leader); \
455  (_evsel) = list_entry((_evsel)->node.next, struct perf_evsel, node))
456 
457 static inline bool perf_evsel__has_branch_callstack(const struct perf_evsel *evsel)
458 {
459  return evsel->attr.branch_sample_type & PERF_SAMPLE_BRANCH_CALL_STACK;
460 }
461 
462 static inline bool evsel__has_callchain(const struct perf_evsel *evsel)
463 {
464  return (evsel->attr.sample_type & PERF_SAMPLE_CALLCHAIN) != 0;
465 }
466 
467 typedef int (*attr__fprintf_f)(FILE *, const char *, const char *, void *);
468 
469 int perf_event_attr__fprintf(FILE *fp, struct perf_event_attr *attr,
470  attr__fprintf_f attr__fprintf, void *priv);
471 
472 struct perf_env *perf_evsel__env(struct perf_evsel *evsel);
473 
474 #endif /* __PERF_EVSEL_H */
bool event_group
Definition: symbol.h:93
bool auto_merge_stats
Definition: evsel.h:141
u64 val64
Definition: evsel.h:152
int nr
Definition: cpumap.h:14
void perf_evsel__init(struct perf_evsel *evsel, struct perf_event_attr *attr, int idx)
Definition: evsel.c:226
void perf_evsel__config_callchain(struct perf_evsel *evsel, struct record_opts *opts, struct callchain_param *callchain)
Definition: evsel.c:705
int(* attr__fprintf_f)(FILE *, const char *, const char *, void *)
Definition: evsel.h:467
Definition: mem2node.c:7
bool event_group
Definition: evsel.h:414
int exclude_GH
Definition: evsel.h:132
bool use_uncore_alias
Definition: evsel.h:130
Definition: env.h:36
int perf_evsel__object_config(size_t object_size, int(*init)(struct perf_evsel *evsel), void(*fini)(struct perf_evsel *evsel))
Definition: evsel.c:69
void __perf_evsel__reset_sample_bit(struct perf_evsel *evsel, enum perf_event_sample_format bit)
Definition: evsel.c:186
void perf_evsel__config(struct perf_evsel *evsel, struct record_opts *opts, struct callchain_param *callchain)
Definition: evsel.c:879
static bool perf_evsel__match2(struct perf_evsel *e1, struct perf_evsel *e2)
Definition: evsel.h:309
size_t size
Definition: evsel.c:60
bool tracking
Definition: evsel.h:125
static int perf_evsel__read_on_cpu(struct perf_evsel *evsel, int cpu, int thread)
Definition: evsel.h:337
bool trace_fields
Definition: evsel.h:416
Definition: xyarray.h:7
struct xyarray * sample_id
Definition: evsel.h:96
int id_pos
Definition: evsel.h:116
bool perf_evsel__fallback(struct perf_evsel *evsel, int err, char *msg, size_t msgsize)
Definition: evsel.c:2733
bool perf_evsel__is_function_event(struct perf_evsel *evsel)
Definition: evsel.c:216
void perf_counts_values__scale(struct perf_counts_values *count, bool scale, s8 *pscaled)
Definition: evsel.c:1288
static bool perf_evsel__is_bpf_output(struct perf_evsel *evsel)
Definition: evsel.h:403
int perf_evsel__read(struct perf_evsel *evsel, int cpu, int thread, struct perf_counts_values *count)
Definition: evsel.c:1333
const char * pmu_name
Definition: evsel.h:148
int int err
Definition: 5sec.c:44
int sample__fprintf_sym(struct perf_sample *sample, struct addr_location *al, int left_alignment, unsigned int print_opts, struct callchain_cursor *cursor, FILE *fp)
const char * perf_evsel__hw_cache_op[PERF_COUNT_HW_CACHE_OP_MAX][PERF_EVSEL__MAX_ALIASES]
Definition: evsel.c:484
bool system_wide
Definition: evsel.h:124
void perf_evsel__delete(struct perf_evsel *evsel)
Definition: evsel.c:1261
bool snapshot
Definition: evsel.h:119
const char * perf_evsel__hw_cache[PERF_COUNT_HW_CACHE_MAX][PERF_EVSEL__MAX_ALIASES]
Definition: evsel.c:473
void perf_evsel__calc_id_pos(struct perf_evsel *evsel)
Definition: evsel.c:170
struct perf_evsel * perf_evsel__new_cycles(bool precise)
Definition: evsel.c:271
int perf_evsel__apply_filter(struct perf_evsel *evsel, const char *filter)
Definition: evsel.c:1128
char * group_name
Definition: evsel.h:137
u64 format_field__intval(struct format_field *field, struct perf_sample *sample, bool needs_swap)
Definition: evsel.c:2683
struct cpu_map * cpus
Definition: evsel.h:112
Definition: cpumap.h:12
struct cgroup * cgrp
Definition: evsel.h:110
int idx
Definition: evsel.h:100
const char * unit
Definition: evsel.h:104
static int perf_evsel__read_on_cpu_scaled(struct perf_evsel *evsel, int cpu, int thread)
Definition: evsel.h:350
int bpf_fd
Definition: evsel.h:140
int perf_evsel__append_addr_filter(struct perf_evsel *evsel, const char *filter)
Definition: evsel.c:1170
u64 db_id
Definition: evsel.h:109
u64 period
Definition: evsel.h:30
struct format_field * perf_evsel__field(struct perf_evsel *evsel, const char *name)
Definition: evsel.c:2659
int perf_evsel__open_per_cpu(struct perf_evsel *evsel, struct cpu_map *cpus)
Definition: evsel.c:1957
bool precise_max
Definition: evsel.h:127
void(* fini)(struct perf_evsel *evsel)
Definition: evsel.c:62
u32 ids
Definition: evsel.h:101
bool per_pkg
Definition: evsel.h:126
bool supported
Definition: evsel.h:120
int perf_evsel__group_desc(struct perf_evsel *evsel, char *buf, size_t size)
Definition: evsel.c:635
struct perf_evsel * perf_evsel__new_idx(struct perf_event_attr *attr, int idx)
Definition: evsel.c:250
bool weak_group
Definition: evsel.h:147
const char * perf_evsel__sw_names[PERF_COUNT_SW_MAX]
Definition: evsel.c:421
#define PERF_EVSEL__MAX_ALIASES
Definition: evsel.h:235
int sample__fprintf_callchain(struct perf_sample *sample, int left_alignment, unsigned int print_opts, struct callchain_cursor *cursor, FILE *fp)
int perf_evsel__parse_sample_timestamp(struct perf_evsel *evsel, union perf_event *event, u64 *timestamp)
Definition: evsel.c:2338
void __perf_evsel__set_sample_bit(struct perf_evsel *evsel, enum perf_event_sample_format bit)
Definition: evsel.c:176
bool ignore_missing_thread
Definition: evsel.h:128
void perf_evsel__set_sample_id(struct perf_evsel *evsel, bool use_sample_identifier)
Definition: evsel.c:196
int perf_evsel__alloc_id(struct perf_evsel *evsel, int ncpus, int nthreads)
Definition: evsel.c:1189
int perf_evsel__read_counter(struct perf_evsel *evsel, int cpu, int thread)
Definition: evsel.c:1440
static struct perf_evsel * perf_evsel__next(struct perf_evsel *evsel)
Definition: evsel.h:363
Definition: thread.h:18
const char * name
int perf_evsel__open_per_thread(struct perf_evsel *evsel, struct thread_map *threads)
Definition: evsel.c:1963
term_type
Definition: evsel.h:41
struct perf_evlist * evlist
Definition: evsel.h:92
void perf_evsel__exit(struct perf_evsel *evsel)
Definition: evsel.c:1245
int perf_evsel__disable(struct perf_evsel *evsel)
Definition: evsel.c:1182
int perf_evsel__fprintf(struct perf_evsel *evsel, struct perf_attr_details *details, FILE *fp)
Definition: evsel_fprintf.c:36
bool cmdline_group_boundary
Definition: evsel.h:138
void perf_evsel__close_fd(struct perf_evsel *evsel)
Definition: evsel.c:1234
u64 perf_evsel__intval(struct perf_evsel *evsel, struct perf_sample *sample, const char *name)
Definition: evsel.c:2722
struct perf_evsel ** metric_events
Definition: evsel.h:145
const char * perf_evsel__hw_cache_result[PERF_COUNT_HW_CACHE_RESULT_MAX][PERF_EVSEL__MAX_ALIASES]
Definition: evsel.c:491
bool forced_leader
Definition: evsel.h:129
pid_t tid
Definition: evsel.h:27
static unsigned int nthreads
Definition: futex-hash.c:31
bool perf_evsel__is_cache_op_valid(u8 type, u8 op)
Definition: evsel.c:517
static char * perf_evsel__strval(struct perf_evsel *evsel, struct perf_sample *sample, const char *name)
Definition: evsel.h:292
char * filter
Definition: evsel.h:94
int __perf_evsel__read_on_cpu(struct perf_evsel *evsel, int cpu, int thread, bool scale)
Definition: evsel.c:1450
bool collect_stat
Definition: evsel.h:146
int perf_evsel__set_filter(struct perf_evsel *evsel, const char *filter)
Definition: evsel.c:1135
static struct cpu_map * perf_evsel__cpus(struct perf_evsel *evsel)
Definition: evsel.h:175
int __perf_evsel__sample_size(u64 sample_type)
Definition: evsel.c:94
struct perf_counts * prev_raw_counts
Definition: evsel.h:99
const char * perf_evsel__name(struct perf_evsel *evsel)
Definition: evsel.c:577
int __perf_evsel__hw_cache_type_op_res_name(u8 type, u8 op, u8 result, char *bf, size_t size)
Definition: evsel.c:525
struct event_format * tp_format
Definition: evsel.h:105
void perf_evsel__close(struct perf_evsel *evsel)
Definition: evsel.c:1948
bool immediate
Definition: evsel.h:123
list cpus
Definition: stat-cpi.py:7
Definition: jevents.c:169
int perf_evsel__open_strerror(struct perf_evsel *evsel, struct target *target, int err, char *msg, size_t size)
Definition: evsel.c:2820
#define event
struct perf_counts * counts
Definition: evsel.h:98
static struct perf_evsel * perf_evsel__prev(struct perf_evsel *evsel)
Definition: evsel.h:368
struct cpu_map * own_cpus
Definition: evsel.h:113
struct thread_map * threads
Definition: evsel.h:114
double scale
Definition: evsel.h:103
struct event_format * event_format__new(const char *sys, const char *name)
static struct perf_evsel * perf_evsel__new(struct perf_event_attr *attr)
Definition: evsel.h:197
int perf_event_attr__fprintf(FILE *fp, struct perf_event_attr *attr, attr__fprintf_f attr__fprintf, void *priv)
Definition: evsel.c:1571
struct strfilter * filter
Definition: builtin-probe.c:60
static int perf_evsel__group_idx(struct perf_evsel *evsel)
Definition: evsel.h:447
int perf_evsel__open(struct perf_evsel *evsel, struct cpu_map *cpus, struct thread_map *threads)
Definition: evsel.c:1704
struct perf_evsel * leader
Definition: evsel.h:136
unsigned long * per_pkg_mask
Definition: evsel.h:135
int is_pos
Definition: evsel.h:117
struct perf_env * perf_evsel__env(struct perf_evsel *evsel)
Definition: evsel.c:2911
static unsigned int ncpus
Definition: futex-wake.c:45
int perf_evsel__append_tp_filter(struct perf_evsel *evsel, const char *filter)
Definition: evsel.c:1165
int perf_evsel__enable(struct perf_evsel *evsel)
Definition: evsel.c:1175
struct perf_evsel * perf_evsel__newtp_idx(const char *sys, const char *name, int idx)
Definition: evsel.c:320
void * priv
Definition: evsel.h:108
int nr_members
Definition: evsel.h:133
const char * perf_evsel__hw_names[PERF_COUNT_HW_MAX]
Definition: evsel.c:358
static bool perf_evsel__is_group_event(struct perf_evsel *evsel)
Definition: evsel.h:393
static bool perf_evsel__is_group_leader(const struct perf_evsel *evsel)
Definition: evsel.h:380
static int perf_evsel__nr_cpus(struct perf_evsel *evsel)
Definition: evsel.h:180
void * perf_evsel__rawptr(struct perf_evsel *evsel, struct perf_sample *sample, const char *name)
Definition: evsel.c:2664
Definition: attr.py:1
off_t id_offset
Definition: evsel.h:106
struct perf_evsel * evsel
Definition: evsel.h:24
struct xyarray * fd
Definition: evsel.h:95
struct list_head node
Definition: evsel.h:91
struct perf_stat_evsel * stats
Definition: evsel.h:107
static struct perf_evsel * perf_evsel__newtp(const char *sys, const char *name)
Definition: evsel.h:207
int(* init)(struct perf_evsel *evsel)
Definition: evsel.c:61
char * name
Definition: evsel.h:102
bool no_aux_samples
Definition: evsel.h:122
int sample_read
Definition: evsel.h:134
static bool evsel__has_callchain(const struct perf_evsel *evsel)
Definition: evsel.h:462
bool uniquified_name
Definition: evsel.h:118
const char * metric_expr
Definition: evsel.h:143
unsigned int sample_size
Definition: evsel.h:115
const char * metric_name
Definition: evsel.h:144
u64 * id
Definition: evsel.h:97
bool merged_stat
Definition: evsel.h:142
bool needs_swap
Definition: evsel.h:121
struct perf_event_attr attr
Definition: evsel.h:93
int perf_evsel__parse_sample(struct perf_evsel *evsel, union perf_event *event, struct perf_sample *sample)
Definition: evsel.c:2059
Definition: target.h:8
static bool perf_evsel__has_branch_callstack(const struct perf_evsel *evsel)
Definition: evsel.h:457
const char * perf_evsel__group_name(struct perf_evsel *evsel)
Definition: evsel.c:620
void perf_evsel__compute_deltas(struct perf_evsel *evsel, int cpu, int thread, struct perf_counts_values *count)
Definition: evsel.c:1267
Definition: cgroup.h:9
void * handler
Definition: evsel.h:111