3 #define __PERF_EVSEL_H 1 5 #include <linux/list.h> 8 #include <linux/perf_event.h> 9 #include <linux/types.h> 55 struct list_head list;
93 struct perf_event_attr
attr;
139 struct list_head config_terms;
186 bool scale, s8 *pscaled);
217 struct perf_event_attr *
attr,
int idx);
235 #define PERF_EVSEL__MAX_ALIASES 8 246 char *bf,
size_t size);
256 enum perf_event_sample_format bit);
258 enum perf_event_sample_format bit);
260 #define perf_evsel__set_sample_bit(evsel, bit) \ 261 __perf_evsel__set_sample_bit(evsel, PERF_SAMPLE_##bit) 263 #define perf_evsel__reset_sample_bit(evsel, bit) \ 264 __perf_evsel__reset_sample_bit(evsel, PERF_SAMPLE_##bit) 267 bool use_sample_identifier);
305 #define perf_evsel__match(evsel, t, c) \ 306 (evsel->attr.type == PERF_TYPE_##t && \ 307 evsel->attr.config == PERF_COUNT_##c) 312 return (e1->
attr.type == e2->
attr.type) &&
313 (e1->
attr.config == e2->
attr.config);
316 #define perf_evsel__cmp(a, b) \ 319 (a)->attr.type == (b)->attr.type && \ 320 (a)->attr.config == (b)->attr.config) 405 struct perf_event_attr *
attr = &evsel->
attr;
407 return (attr->config == PERF_COUNT_SW_BPF_OUTPUT) &&
408 (attr->type == PERF_TYPE_SOFTWARE);
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) 435 unsigned int print_opts,
439 int left_alignment,
unsigned int print_opts,
443 char *msg,
size_t msgsize);
445 int err,
char *msg,
size_t size);
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)) 459 return evsel->
attr.branch_sample_type & PERF_SAMPLE_BRANCH_CALL_STACK;
464 return (evsel->
attr.sample_type & PERF_SAMPLE_CALLCHAIN) != 0;
void perf_evsel__init(struct perf_evsel *evsel, struct perf_event_attr *attr, int idx)
void perf_evsel__config_callchain(struct perf_evsel *evsel, struct record_opts *opts, struct callchain_param *callchain)
int(* attr__fprintf_f)(FILE *, const char *, const char *, void *)
int perf_evsel__object_config(size_t object_size, int(*init)(struct perf_evsel *evsel), void(*fini)(struct perf_evsel *evsel))
void __perf_evsel__reset_sample_bit(struct perf_evsel *evsel, enum perf_event_sample_format bit)
void perf_evsel__config(struct perf_evsel *evsel, struct record_opts *opts, struct callchain_param *callchain)
static bool perf_evsel__match2(struct perf_evsel *e1, struct perf_evsel *e2)
static int perf_evsel__read_on_cpu(struct perf_evsel *evsel, int cpu, int thread)
struct xyarray * sample_id
bool perf_evsel__fallback(struct perf_evsel *evsel, int err, char *msg, size_t msgsize)
bool perf_evsel__is_function_event(struct perf_evsel *evsel)
void perf_counts_values__scale(struct perf_counts_values *count, bool scale, s8 *pscaled)
static bool perf_evsel__is_bpf_output(struct perf_evsel *evsel)
int perf_evsel__read(struct perf_evsel *evsel, int cpu, int thread, struct perf_counts_values *count)
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]
void perf_evsel__delete(struct perf_evsel *evsel)
const char * perf_evsel__hw_cache[PERF_COUNT_HW_CACHE_MAX][PERF_EVSEL__MAX_ALIASES]
void perf_evsel__calc_id_pos(struct perf_evsel *evsel)
struct perf_evsel * perf_evsel__new_cycles(bool precise)
int perf_evsel__apply_filter(struct perf_evsel *evsel, const char *filter)
u64 format_field__intval(struct format_field *field, struct perf_sample *sample, bool needs_swap)
static int perf_evsel__read_on_cpu_scaled(struct perf_evsel *evsel, int cpu, int thread)
int perf_evsel__append_addr_filter(struct perf_evsel *evsel, const char *filter)
struct format_field * perf_evsel__field(struct perf_evsel *evsel, const char *name)
int perf_evsel__open_per_cpu(struct perf_evsel *evsel, struct cpu_map *cpus)
void(* fini)(struct perf_evsel *evsel)
int perf_evsel__group_desc(struct perf_evsel *evsel, char *buf, size_t size)
struct perf_evsel * perf_evsel__new_idx(struct perf_event_attr *attr, int idx)
const char * perf_evsel__sw_names[PERF_COUNT_SW_MAX]
#define PERF_EVSEL__MAX_ALIASES
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)
void __perf_evsel__set_sample_bit(struct perf_evsel *evsel, enum perf_event_sample_format bit)
bool ignore_missing_thread
void perf_evsel__set_sample_id(struct perf_evsel *evsel, bool use_sample_identifier)
int perf_evsel__alloc_id(struct perf_evsel *evsel, int ncpus, int nthreads)
int perf_evsel__read_counter(struct perf_evsel *evsel, int cpu, int thread)
static struct perf_evsel * perf_evsel__next(struct perf_evsel *evsel)
int perf_evsel__open_per_thread(struct perf_evsel *evsel, struct thread_map *threads)
struct perf_evlist * evlist
void perf_evsel__exit(struct perf_evsel *evsel)
int perf_evsel__disable(struct perf_evsel *evsel)
int perf_evsel__fprintf(struct perf_evsel *evsel, struct perf_attr_details *details, FILE *fp)
bool cmdline_group_boundary
void perf_evsel__close_fd(struct perf_evsel *evsel)
u64 perf_evsel__intval(struct perf_evsel *evsel, struct perf_sample *sample, const char *name)
struct perf_evsel ** metric_events
const char * perf_evsel__hw_cache_result[PERF_COUNT_HW_CACHE_RESULT_MAX][PERF_EVSEL__MAX_ALIASES]
static unsigned int nthreads
bool perf_evsel__is_cache_op_valid(u8 type, u8 op)
static char * perf_evsel__strval(struct perf_evsel *evsel, struct perf_sample *sample, const char *name)
int __perf_evsel__read_on_cpu(struct perf_evsel *evsel, int cpu, int thread, bool scale)
int perf_evsel__set_filter(struct perf_evsel *evsel, const char *filter)
static struct cpu_map * perf_evsel__cpus(struct perf_evsel *evsel)
int __perf_evsel__sample_size(u64 sample_type)
struct perf_counts * prev_raw_counts
const char * perf_evsel__name(struct perf_evsel *evsel)
int __perf_evsel__hw_cache_type_op_res_name(u8 type, u8 op, u8 result, char *bf, size_t size)
struct event_format * tp_format
void perf_evsel__close(struct perf_evsel *evsel)
int perf_evsel__open_strerror(struct perf_evsel *evsel, struct target *target, int err, char *msg, size_t size)
struct perf_counts * counts
static struct perf_evsel * perf_evsel__prev(struct perf_evsel *evsel)
struct cpu_map * own_cpus
struct thread_map * threads
struct event_format * event_format__new(const char *sys, const char *name)
static struct perf_evsel * perf_evsel__new(struct perf_event_attr *attr)
int perf_event_attr__fprintf(FILE *fp, struct perf_event_attr *attr, attr__fprintf_f attr__fprintf, void *priv)
struct strfilter * filter
static int perf_evsel__group_idx(struct perf_evsel *evsel)
int perf_evsel__open(struct perf_evsel *evsel, struct cpu_map *cpus, struct thread_map *threads)
struct perf_evsel * leader
unsigned long * per_pkg_mask
struct perf_env * perf_evsel__env(struct perf_evsel *evsel)
static unsigned int ncpus
int perf_evsel__append_tp_filter(struct perf_evsel *evsel, const char *filter)
int perf_evsel__enable(struct perf_evsel *evsel)
struct perf_evsel * perf_evsel__newtp_idx(const char *sys, const char *name, int idx)
const char * perf_evsel__hw_names[PERF_COUNT_HW_MAX]
static bool perf_evsel__is_group_event(struct perf_evsel *evsel)
static bool perf_evsel__is_group_leader(const struct perf_evsel *evsel)
static int perf_evsel__nr_cpus(struct perf_evsel *evsel)
void * perf_evsel__rawptr(struct perf_evsel *evsel, struct perf_sample *sample, const char *name)
struct perf_evsel * evsel
struct perf_stat_evsel * stats
static struct perf_evsel * perf_evsel__newtp(const char *sys, const char *name)
int(* init)(struct perf_evsel *evsel)
static bool evsel__has_callchain(const struct perf_evsel *evsel)
struct perf_event_attr attr
int perf_evsel__parse_sample(struct perf_evsel *evsel, union perf_event *event, struct perf_sample *sample)
static bool perf_evsel__has_branch_callstack(const struct perf_evsel *evsel)
const char * perf_evsel__group_name(struct perf_evsel *evsel)
void perf_evsel__compute_deltas(struct perf_evsel *evsel, int cpu, int thread, struct perf_counts_values *count)