[][src]Constant nc::types::PERF_RECORD_MMAP

pub const PERF_RECORD_MMAP: i32

perf_event_type: If perf_event_attr.sample_id_all is set then all event types will have the sample_type selected fields related to where/when (identity) an event took place (TID, TIME, ID, STREAM_ID, CPU IDENTIFIER) described in PERF_RECORD_SAMPLE below, it will be stashed just after the perf_event_header and the fields already present for the existing fields, i.e. at the end of the payload. That way a newer perf.data file will be supported by older perf tools, with these new optional fields being ignored.

struct sample_id { { u32 pid, tid; } && PERF_SAMPLE_TID { u64 time; } && PERF_SAMPLE_TIME { u64 id; } && PERF_SAMPLE_ID { u64 stream_id;} && PERF_SAMPLE_STREAM_ID { u32 cpu, res; } && PERF_SAMPLE_CPU { u64 id; } && PERF_SAMPLE_IDENTIFIER } && perf_event_attr::sample_id_all

Note that PERF_SAMPLE_IDENTIFIER duplicates PERF_SAMPLE_ID. The advantage of PERF_SAMPLE_IDENTIFIER is that its position is fixed relative to header.size.

The MMAP events record the PROT_EXEC mappings so that we can correlate userspace IPs to code. They have the following structure:

struct { struct perf_event_header header;

u32 pid, tid; u64 addr; u64 len; u64 pgoff; char filename[]; struct sample_id sample_id; };