Lines Matching refs:evsel
59 struct evsel { struct
110 struct evsel **metric_events; argument
111 struct evsel *metric_leader; argument
202 static inline struct perf_cpu_map *evsel__cpus(struct evsel *evsel) in evsel__cpus() argument
204 return perf_evsel__cpus(&evsel->core); in evsel__cpus()
207 static inline int evsel__nr_cpus(struct evsel *evsel) in evsel__nr_cpus() argument
209 return perf_cpu_map__nr(evsel__cpus(evsel)); in evsel__nr_cpus()
212 void evsel__compute_deltas(struct evsel *evsel, int cpu, int thread,
216 int (*init)(struct evsel *evsel),
217 void (*fini)(struct evsel *evsel));
219 struct perf_pmu *evsel__find_pmu(const struct evsel *evsel);
220 bool evsel__is_aux_event(const struct evsel *evsel);
222 struct evsel *evsel__new_idx(struct perf_event_attr *attr, int idx);
224 static inline struct evsel *evsel__new(struct perf_event_attr *attr) in evsel__new()
229 struct evsel *evsel__clone(struct evsel *orig);
236 struct evsel *evsel__newtp_idx(const char *sys, const char *name, int idx);
241 static inline struct evsel *evsel__newtp(const char *sys, const char *name) in evsel__newtp()
251 void evsel__init(struct evsel *evsel, struct perf_event_attr *attr, int idx);
252 void evsel__exit(struct evsel *evsel);
253 void evsel__delete(struct evsel *evsel);
257 void evsel__config(struct evsel *evsel, struct record_opts *opts,
259 void evsel__config_callchain(struct evsel *evsel, struct record_opts *opts,
263 void evsel__calc_id_pos(struct evsel *evsel);
267 static inline bool evsel__is_bpf(struct evsel *evsel) in evsel__is_bpf() argument
269 return evsel->bpf_counter_ops != NULL; in evsel__is_bpf()
272 static inline bool evsel__is_bperf(struct evsel *evsel) in evsel__is_bperf() argument
274 return evsel->bpf_counter_ops != NULL && list_empty(&evsel->bpf_counter_list); in evsel__is_bperf()
286 int arch_evsel__hw_name(struct evsel *evsel, char *bf, size_t size);
289 const char *evsel__name(struct evsel *evsel);
290 bool evsel__name_is(struct evsel *evsel, const char *name);
291 const char *evsel__metric_id(const struct evsel *evsel);
293 static inline bool evsel__is_tool(const struct evsel *evsel) in evsel__is_tool() argument
295 return evsel->tool_event != PERF_TOOL_NONE; in evsel__is_tool()
298 const char *evsel__group_name(struct evsel *evsel);
299 int evsel__group_desc(struct evsel *evsel, char *buf, size_t size);
301 void __evsel__set_sample_bit(struct evsel *evsel, enum perf_event_sample_format bit);
302 void __evsel__reset_sample_bit(struct evsel *evsel, enum perf_event_sample_format bit);
304 #define evsel__set_sample_bit(evsel, bit) \ argument
305 __evsel__set_sample_bit(evsel, PERF_SAMPLE_##bit)
307 #define evsel__reset_sample_bit(evsel, bit) \ argument
308 __evsel__reset_sample_bit(evsel, PERF_SAMPLE_##bit)
310 void evsel__set_sample_id(struct evsel *evsel, bool use_sample_identifier);
312 void arch_evsel__set_sample_weight(struct evsel *evsel);
313 void arch__post_evsel_config(struct evsel *evsel, struct perf_event_attr *attr);
314 int arch_evsel__open_strerror(struct evsel *evsel, char *msg, size_t size);
316 int evsel__set_filter(struct evsel *evsel, const char *filter);
317 int evsel__append_tp_filter(struct evsel *evsel, const char *filter);
318 int evsel__append_addr_filter(struct evsel *evsel, const char *filter);
319 int evsel__enable_cpu(struct evsel *evsel, int cpu_map_idx);
320 int evsel__enable(struct evsel *evsel);
321 int evsel__disable(struct evsel *evsel);
322 int evsel__disable_cpu(struct evsel *evsel, int cpu_map_idx);
324 int evsel__open_per_cpu(struct evsel *evsel, struct perf_cpu_map *cpus, int cpu_map_idx);
325 int evsel__open_per_thread(struct evsel *evsel, struct perf_thread_map *threads);
326 int evsel__open(struct evsel *evsel, struct perf_cpu_map *cpus,
328 void evsel__close(struct evsel *evsel);
329 int evsel__prepare_open(struct evsel *evsel, struct perf_cpu_map *cpus,
331 bool evsel__detect_missing_features(struct evsel *evsel);
336 bool evsel__precise_ip_fallback(struct evsel *evsel);
341 void *evsel__rawptr(struct evsel *evsel, struct perf_sample *sample, const char *name);
342 u64 evsel__intval(struct evsel *evsel, struct perf_sample *sample, const char *name);
344 static inline char *evsel__strval(struct evsel *evsel, struct perf_sample *sample, const char *name) in evsel__strval() argument
346 return evsel__rawptr(evsel, sample, name); in evsel__strval()
354 struct tep_format_field *evsel__field(struct evsel *evsel, const char *name);
356 static inline bool __evsel__match(const struct evsel *evsel, u32 type, u64 config) in __evsel__match() argument
358 if (evsel->core.attr.type != type) in __evsel__match()
363 return (evsel->core.attr.config & PERF_HW_EVENT_MASK) == config; in __evsel__match()
365 return evsel->core.attr.config == config; in __evsel__match()
368 #define evsel__match(evsel, t, c) __evsel__match(evsel, PERF_TYPE_##t, PERF_COUNT_##c) argument
370 static inline bool evsel__match2(struct evsel *e1, struct evsel *e2) in evsel__match2()
376 int evsel__read_counter(struct evsel *evsel, int cpu_map_idx, int thread);
378 int __evsel__read_on_cpu(struct evsel *evsel, int cpu_map_idx, int thread, bool scale);
387 static inline int evsel__read_on_cpu(struct evsel *evsel, int cpu_map_idx, int thread) in evsel__read_on_cpu() argument
389 return __evsel__read_on_cpu(evsel, cpu_map_idx, thread, false); in evsel__read_on_cpu()
399 static inline int evsel__read_on_cpu_scaled(struct evsel *evsel, int cpu_map_idx, int thread) in evsel__read_on_cpu_scaled() argument
401 return __evsel__read_on_cpu(evsel, cpu_map_idx, thread, true); in evsel__read_on_cpu_scaled()
404 int evsel__parse_sample(struct evsel *evsel, union perf_event *event,
407 int evsel__parse_sample_timestamp(struct evsel *evsel, union perf_event *event,
410 u16 evsel__id_hdr_size(struct evsel *evsel);
412 static inline struct evsel *evsel__next(struct evsel *evsel) in evsel__next() argument
414 return list_entry(evsel->core.node.next, struct evsel, core.node); in evsel__next()
417 static inline struct evsel *evsel__prev(struct evsel *evsel) in evsel__prev() argument
419 return list_entry(evsel->core.node.prev, struct evsel, core.node); in evsel__prev()
429 static inline bool evsel__is_group_leader(const struct evsel *evsel) in evsel__is_group_leader() argument
431 return evsel->core.leader == &evsel->core; in evsel__is_group_leader()
442 static inline bool evsel__is_group_event(struct evsel *evsel) in evsel__is_group_event() argument
447 return evsel__is_group_leader(evsel) && evsel->core.nr_members > 1; in evsel__is_group_event()
450 bool evsel__is_function_event(struct evsel *evsel);
452 static inline bool evsel__is_bpf_output(struct evsel *evsel) in evsel__is_bpf_output() argument
454 return evsel__match(evsel, SOFTWARE, SW_BPF_OUTPUT); in evsel__is_bpf_output()
457 static inline bool evsel__is_clock(const struct evsel *evsel) in evsel__is_clock() argument
459 return evsel__match(evsel, SOFTWARE, SW_CPU_CLOCK) || in evsel__is_clock()
460 evsel__match(evsel, SOFTWARE, SW_TASK_CLOCK); in evsel__is_clock()
463 bool evsel__fallback(struct evsel *evsel, int err, char *msg, size_t msgsize);
464 int evsel__open_strerror(struct evsel *evsel, struct target *target,
467 static inline int evsel__group_idx(struct evsel *evsel) in evsel__group_idx() argument
469 return evsel->core.idx - evsel->core.leader->idx; in evsel__group_idx()
474 for ((_evsel) = list_entry((_leader)->core.node.next, struct evsel, core.node); \
477 (_evsel) = list_entry((_evsel)->core.node.next, struct evsel, core.node))
487 (_evsel) = list_entry((_evsel)->core.node.next, struct evsel, core.node))
492 static inline bool evsel__has_branch_callstack(const struct evsel *evsel) in evsel__has_branch_callstack() argument
494 return evsel->core.attr.branch_sample_type & PERF_SAMPLE_BRANCH_CALL_STACK; in evsel__has_branch_callstack()
497 static inline bool evsel__has_branch_hw_idx(const struct evsel *evsel) in evsel__has_branch_hw_idx() argument
499 return evsel->core.attr.branch_sample_type & PERF_SAMPLE_BRANCH_HW_INDEX; in evsel__has_branch_hw_idx()
502 static inline bool evsel__has_callchain(const struct evsel *evsel) in evsel__has_callchain() argument
508 return evsel->core.attr.sample_type & PERF_SAMPLE_CALLCHAIN || in evsel__has_callchain()
509 evsel->synth_sample_type & PERF_SAMPLE_CALLCHAIN; in evsel__has_callchain()
512 static inline bool evsel__has_br_stack(const struct evsel *evsel) in evsel__has_br_stack() argument
518 return evsel->core.attr.sample_type & PERF_SAMPLE_BRANCH_STACK || in evsel__has_br_stack()
519 evsel->synth_sample_type & PERF_SAMPLE_BRANCH_STACK; in evsel__has_br_stack()
522 static inline bool evsel__is_dummy_event(struct evsel *evsel) in evsel__is_dummy_event() argument
524 return (evsel->core.attr.type == PERF_TYPE_SOFTWARE) && in evsel__is_dummy_event()
525 (evsel->core.attr.config == PERF_COUNT_SW_DUMMY); in evsel__is_dummy_event()
528 struct perf_env *evsel__env(struct evsel *evsel);
530 int evsel__store_ids(struct evsel *evsel, struct evlist *evlist);
532 void evsel__zero_per_pkg(struct evsel *evsel);
533 bool evsel__is_hybrid(const struct evsel *evsel);
534 struct evsel *evsel__leader(const struct evsel *evsel);
535 bool evsel__has_leader(struct evsel *evsel, struct evsel *leader);
536 bool evsel__is_leader(struct evsel *evsel);
537 void evsel__set_leader(struct evsel *evsel, struct evsel *leader);
538 int evsel__source_count(const struct evsel *evsel);
539 void evsel__remove_from_group(struct evsel *evsel, struct evsel *leader);
541 bool arch_evsel__must_be_in_group(const struct evsel *evsel);
555 void evsel__set_config_if_unset(struct perf_pmu *pmu, struct evsel *evsel,