tools/perf/util/evlist.h
Source file repositories/reference/linux-study-clean/tools/perf/util/evlist.h
File Facts
- System
- Linux kernel
- Corpus path
tools/perf/util/evlist.h- Extension
.h- Size
- 16864 bytes
- Lines
- 465
- 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/compiler.hlinux/kernel.hlinux/refcount.hlinux/list.hapi/fd/array.hinternal/evlist.hinternal/evsel.hperf/evlist.haffinity.hevents_stats.hevsel.hrblist.hpthread.hsignal.hunistd.h
Detected Declarations
struct pollfdstruct thread_mapstruct perf_cpu_mapstruct perf_stat_configstruct record_optsstruct strbufstruct targetstruct event_enable_timerstruct evliststruct evsel_str_handlerstruct callchain_paramstruct optionstruct evlist_cpu_iteratorenum bkw_mmap_stateenum evlist_ctl_cmdfunction evlist__emptyfunction evlist__nr_groupsfunction evlist_cpu_iterator__end
Annotated Snippet
struct evlist {
struct perf_evlist core;
bool enabled;
bool no_affinity;
int id_pos;
int is_pos;
int nr_br_cntr;
u64 combined_sample_type;
enum bkw_mmap_state bkw_mmap_state;
struct {
int cork_fd;
pid_t pid;
} workload;
struct mmap *mmap;
struct mmap *overwrite_mmap;
struct evsel *selected;
struct events_stats stats;
struct perf_session *session;
void (*trace_event_sample_raw)(struct evlist *evlist,
union perf_event *event,
struct perf_sample *sample);
u64 first_sample_time;
u64 last_sample_time;
struct {
pthread_t th;
volatile int done;
} thread;
struct {
int fd; /* control file descriptor */
int ack; /* ack file descriptor for control commands */
int pos; /* index at evlist core object to check signals */
} ctl_fd;
struct event_enable_timer *eet;
/**
* @metric_events: A list of struct metric_event which each have a list
* of struct metric_expr.
*/
struct rblist metric_events;
/* samples with deferred_callchain would wait here. */
struct list_head deferred_samples;
};
struct evsel_str_handler {
const char *name;
void *handler;
};
struct evlist *evlist__new(void);
struct evlist *evlist__new_default(const struct target *target, bool sample_callchains);
struct evlist *evlist__new_dummy(void);
void evlist__init(struct evlist *evlist, struct perf_cpu_map *cpus,
struct perf_thread_map *threads);
void evlist__exit(struct evlist *evlist);
void evlist__delete(struct evlist *evlist);
void evlist__add(struct evlist *evlist, struct evsel *entry);
void evlist__remove(struct evlist *evlist, struct evsel *evsel);
int arch_evlist__cmp(const struct evsel *lhs, const struct evsel *rhs);
int arch_evlist__add_required_events(struct list_head *list);
int evlist__add_dummy(struct evlist *evlist);
struct evsel *evlist__add_aux_dummy(struct evlist *evlist, bool system_wide);
static inline struct evsel *evlist__add_dummy_on_all_cpus(struct evlist *evlist)
{
return evlist__add_aux_dummy(evlist, true);
}
#ifdef HAVE_LIBTRACEEVENT
struct evsel *evlist__add_sched_switch(struct evlist *evlist, bool system_wide);
#endif
int evlist__add_sb_event(struct evlist *evlist, struct perf_event_attr *attr,
evsel__sb_cb_t cb, void *data);
void evlist__set_cb(struct evlist *evlist, evsel__sb_cb_t cb, void *data);
int evlist__start_sb_thread(struct evlist *evlist, struct target *target);
void evlist__stop_sb_thread(struct evlist *evlist);
#ifdef HAVE_LIBTRACEEVENT
int evlist__add_newtp(struct evlist *evlist, const char *sys, const char *name, void *handler);
#endif
int __evlist__set_tracepoints_handlers(struct evlist *evlist,
const struct evsel_str_handler *assocs,
size_t nr_assocs);
#define evlist__set_tracepoints_handlers(evlist, array) \
__evlist__set_tracepoints_handlers(evlist, array, ARRAY_SIZE(array))
int evlist__set_tp_filter(struct evlist *evlist, const char *filter);
int evlist__set_tp_filter_pids(struct evlist *evlist, size_t npids, pid_t *pids);
Annotation
- Immediate include surface: `linux/compiler.h`, `linux/kernel.h`, `linux/refcount.h`, `linux/list.h`, `api/fd/array.h`, `internal/evlist.h`, `internal/evsel.h`, `perf/evlist.h`.
- Detected declarations: `struct pollfd`, `struct thread_map`, `struct perf_cpu_map`, `struct perf_stat_config`, `struct record_opts`, `struct strbuf`, `struct target`, `struct event_enable_timer`, `struct evlist`, `struct evsel_str_handler`.
- 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.