tools/perf/util/evsel.h
Source file repositories/reference/linux-study-clean/tools/perf/util/evsel.h
File Facts
- System
- Linux kernel
- Corpus path
tools/perf/util/evsel.h- Extension
.h- Size
- 19039 bytes
- Lines
- 591
- Domain
- Support Tooling And Documentation
- Bucket
- tools
- Inferred role
- Support Tooling And Documentation: implementation source
- Status
- source implementation candidate
Why This File Exists
Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
- Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/list.hstdbool.hsys/types.hlinux/perf_event.hlinux/types.hinternal/evsel.hperf/evsel.hsymbol_conf.hpmus.hpmu.h
Detected Declarations
struct bpf_objectstruct cgroupstruct perf_countsstruct perf_stat_configstruct perf_stat_evselstruct bpf_counter_opsstruct targetstruct hashmapstruct bperf_leader_bpfstruct bperf_follower_bpfstruct evselstruct _retirement_latencystruct perf_missing_featuresstruct perf_cpu_mapstruct thread_mapstruct record_optsstruct callchain_paramstruct perf_samplestruct tep_format_fieldfunction evsel__nr_cpusfunction evsel__is_bpffunction evsel__is_bperffunction evsel__is_retire_latfunction evsel__read_on_cpufunction evsel__read_on_cpu_scaledfunction evsel__is_group_leaderfunction evsel__is_group_eventfunction evsel__is_bpf_outputfunction evsel__is_clockfunction evsel__group_idxfunction evsel__has_branch_callstackfunction evsel__has_branch_hw_idxfunction evsel__has_callchainfunction evsel__has_br_stackfunction evsel__is_dummy_event
Annotated Snippet
struct evsel {
struct perf_evsel core;
struct evlist *evlist;
off_t id_offset;
int id_pos;
int is_pos;
unsigned int sample_size;
/*
* These fields can be set in the parse-events code or similar.
* Please check evsel__clone() to copy them properly so that
* they can be released properly.
*/
struct {
char *name;
char *group_name;
const char *group_pmu_name;
#ifdef HAVE_LIBTRACEEVENT
char *tp_sys;
char *tp_name;
struct tep_event *tp_format;
#endif
char *filter;
unsigned long max_events;
double scale;
const char *unit;
struct cgroup *cgrp;
const char *metric_id;
/*
* This point to the first evsel with the same name, intended to store the
* aggregated counts in aggregation mode.
*/
struct evsel *first_wildcard_match;
/* parse modifier helper */
int exclude_GH;
int sample_read;
bool snapshot;
bool per_pkg;
bool percore;
bool precise_max;
bool is_libpfm_event;
bool collect_stat;
bool weak_group;
bool bpf_counter;
bool use_config_name;
bool skippable;
bool retire_lat;
bool dont_regroup;
int bpf_fd;
struct bpf_object *bpf_obj;
struct list_head config_terms;
u64 alternate_hw_config;
};
/*
* metric fields are similar, but needs more care as they can have
* references to other metric (evsel).
*/
struct evsel *metric_leader;
void *handler;
struct perf_counts *counts;
struct perf_counts *prev_raw_counts;
unsigned long nr_events_printed;
struct perf_stat_evsel *stats;
void *priv;
u64 db_id;
bool uniquified_name;
bool supported;
bool needs_swap;
bool disabled;
bool no_aux_samples;
bool immediate;
bool tracking;
bool ignore_missing_thread;
bool forced_leader;
bool cmdline_group_boundary;
bool reset_group;
bool needs_auxtrace_mmap;
bool default_metricgroup; /* A member of the Default metricgroup */
bool default_show_events; /* If a default group member, show the event */
bool needs_uniquify;
bool fallenback_eacces;
bool fallenback_eopnotsupp;
struct hashmap *per_pkg_mask;
int err;
int script_output_type;
struct {
evsel__sb_cb_t *cb;
void *data;
Annotation
- Immediate include surface: `linux/list.h`, `stdbool.h`, `sys/types.h`, `linux/perf_event.h`, `linux/types.h`, `internal/evsel.h`, `perf/evsel.h`, `symbol_conf.h`.
- Detected declarations: `struct bpf_object`, `struct cgroup`, `struct perf_counts`, `struct perf_stat_config`, `struct perf_stat_evsel`, `struct bpf_counter_ops`, `struct target`, `struct hashmap`, `struct bperf_leader_bpf`, `struct bperf_follower_bpf`.
- Atlas domain: Support Tooling And Documentation / tools.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.