tools/perf/util/synthetic-events.h
Source file repositories/reference/linux-study-clean/tools/perf/util/synthetic-events.h
File Facts
- System
- Linux kernel
- Corpus path
tools/perf/util/synthetic-events.h- Extension
.h- Size
- 7854 bytes
- Lines
- 135
- 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
stdbool.hsys/types.hlinux/compiler.hlinux/types.hperf/cpumap.h
Detected Declarations
struct auxtrace_recordstruct build_idstruct dsostruct evliststruct evselstruct machinestruct perf_counts_valuesstruct perf_cpu_mapstruct perf_datastruct perf_event_attrstruct perf_event_mmap_pagestruct perf_samplestruct perf_sessionstruct perf_stat_configstruct perf_thread_mapstruct perf_toolstruct record_optsstruct targetenum perf_record_synthfunction perf_event__synthesize_bpf_events
Annotated Snippet
#ifndef __PERF_SYNTHETIC_EVENTS_H
#define __PERF_SYNTHETIC_EVENTS_H
#include <stdbool.h>
#include <sys/types.h> // pid_t
#include <linux/compiler.h>
#include <linux/types.h>
#include <perf/cpumap.h>
struct auxtrace_record;
struct build_id;
struct dso;
struct evlist;
struct evsel;
struct machine;
struct perf_counts_values;
struct perf_cpu_map;
struct perf_data;
struct perf_event_attr;
struct perf_event_mmap_page;
struct perf_sample;
struct perf_session;
struct perf_stat_config;
struct perf_thread_map;
struct perf_tool;
struct record_opts;
struct target;
union perf_event;
enum perf_record_synth {
PERF_SYNTH_TASK = 1 << 0,
PERF_SYNTH_MMAP = 1 << 1,
PERF_SYNTH_CGROUP = 1 << 2,
/* last element */
PERF_SYNTH_MAX = 1 << 3,
};
#define PERF_SYNTH_ALL (PERF_SYNTH_MAX - 1)
int parse_synth_opt(char *str);
typedef int (*perf_event__handler_t)(const struct perf_tool *tool, union perf_event *event,
struct perf_sample *sample, struct machine *machine);
int perf_event__synthesize_attrs(const struct perf_tool *tool, struct evlist *evlist, perf_event__handler_t process);
int perf_event__synthesize_attr(const struct perf_tool *tool, struct perf_event_attr *attr, u32 ids, u64 *id, perf_event__handler_t process);
int perf_event__synthesize_build_id(const struct perf_tool *tool,
struct perf_sample *sample,
struct machine *machine,
perf_event__handler_t process,
const struct evsel *evsel,
__u16 misc,
const struct build_id *bid,
const char *filename);
int perf_event__synthesize_mmap2_build_id(const struct perf_tool *tool,
struct perf_sample *sample,
struct machine *machine,
perf_event__handler_t process,
const struct evsel *evsel,
__u16 misc,
__u32 pid, __u32 tid,
__u64 start, __u64 len, __u64 pgoff,
const struct build_id *bid,
__u32 prot, __u32 flags,
const char *filename);
int perf_event__synthesize_cpu_map(const struct perf_tool *tool, const struct perf_cpu_map *cpus, perf_event__handler_t process, struct machine *machine);
int perf_event__synthesize_event_update_cpus(const struct perf_tool *tool, struct evsel *evsel, perf_event__handler_t process);
int perf_event__synthesize_event_update_name(const struct perf_tool *tool, struct evsel *evsel, perf_event__handler_t process);
int perf_event__synthesize_event_update_scale(const struct perf_tool *tool, struct evsel *evsel, perf_event__handler_t process);
int perf_event__synthesize_event_update_unit(const struct perf_tool *tool, struct evsel *evsel, perf_event__handler_t process);
int perf_event__synthesize_extra_attr(const struct perf_tool *tool, struct evlist *evsel_list, perf_event__handler_t process, bool is_pipe);
int perf_event__synthesize_extra_kmaps(const struct perf_tool *tool, perf_event__handler_t process, struct machine *machine);
int perf_event__synthesize_features(const struct perf_tool *tool, struct perf_session *session, struct evlist *evlist, perf_event__handler_t process);
int perf_event__synthesize_id_index(const struct perf_tool *tool, perf_event__handler_t process, struct evlist *evlist, struct machine *machine);
int __perf_event__synthesize_id_index(const struct perf_tool *tool, perf_event__handler_t process, struct evlist *evlist, struct machine *machine, size_t from);
int perf_event__synthesize_id_sample(__u64 *array, u64 type, const struct perf_sample *sample);
int perf_event__synthesize_kernel_mmap(const struct perf_tool *tool, perf_event__handler_t process, struct machine *machine);
int perf_event__synthesize_mmap_events(const struct perf_tool *tool, union perf_event *event, pid_t pid, pid_t tgid, perf_event__handler_t process, struct machine *machine, bool mmap_data);
int perf_event__synthesize_modules(const struct perf_tool *tool, perf_event__handler_t process, struct machine *machine);
int perf_event__synthesize_namespaces(const struct perf_tool *tool, union perf_event *event, pid_t pid, pid_t tgid, perf_event__handler_t process, struct machine *machine);
int perf_event__synthesize_cgroups(const struct perf_tool *tool, perf_event__handler_t process, struct machine *machine);
int perf_event__synthesize_sample(union perf_event *event, u64 type, u64 read_format, const struct perf_sample *sample);
int perf_event__synthesize_stat_config(const struct perf_tool *tool, struct perf_stat_config *config, perf_event__handler_t process, struct machine *machine);
int perf_event__synthesize_stat_events(struct perf_stat_config *config, const struct perf_tool *tool, struct evlist *evlist, perf_event__handler_t process, bool attrs);
int perf_event__synthesize_stat_round(const struct perf_tool *tool, u64 time, u64 type, perf_event__handler_t process, struct machine *machine);
int perf_event__synthesize_stat(const struct perf_tool *tool, struct perf_cpu cpu, u32 thread, u64 id, struct perf_counts_values *count, perf_event__handler_t process, struct machine *machine);
int perf_event__synthesize_thread_map2(const struct perf_tool *tool, struct perf_thread_map *threads, perf_event__handler_t process, struct machine *machine);
int perf_event__synthesize_thread_map(const struct perf_tool *tool, struct perf_thread_map *threads, perf_event__handler_t process, struct machine *machine, bool needs_mmap, bool mmap_data);
int perf_event__synthesize_threads(const struct perf_tool *tool, perf_event__handler_t process, struct machine *machine, bool needs_mmap, bool mmap_data, unsigned int nr_threads_synthesize);
Annotation
- Immediate include surface: `stdbool.h`, `sys/types.h`, `linux/compiler.h`, `linux/types.h`, `perf/cpumap.h`.
- Detected declarations: `struct auxtrace_record`, `struct build_id`, `struct dso`, `struct evlist`, `struct evsel`, `struct machine`, `struct perf_counts_values`, `struct perf_cpu_map`, `struct perf_data`, `struct perf_event_attr`.
- 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.