Enum nc::types::perf_event_type_t[][src]

pub enum perf_event_type_t {
Show 21 variants PERF_RECORD_MMAP, PERF_RECORD_LOST, PERF_RECORD_COMM, PERF_RECORD_EXIT, PERF_RECORD_THROTTLE, PERF_RECORD_UNTHROTTLE, PERF_RECORD_FORK, PERF_RECORD_READ, PERF_RECORD_SAMPLE, PERF_RECORD_MMAP2, PERF_RECORD_AUX, PERF_RECORD_ITRACE_START, PERF_RECORD_LOST_SAMPLES, PERF_RECORD_SWITCH, PERF_RECORD_SWITCH_CPU_WIDE, PERF_RECORD_NAMESPACES, PERF_RECORD_KSYMBOL, PERF_RECORD_BPF_EVENT, PERF_RECORD_CGROUP, PERF_RECORD_TEXT_POKE, PERF_RECORD_MAX,
}
Expand description

perf_event_type

Variants

PERF_RECORD_MMAP

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; };

PERF_RECORD_LOST

struct { struct perf_event_header header; u64 id; u64 lost; struct sample_id sample_id; };

PERF_RECORD_COMM

struct {
  struct perf_event_header header;

  u32 pid, tid;
  char comm[];
  struct sample_id sample_id;
};

PERF_RECORD_EXIT

struct { struct perf_event_header header; u32 pid, ppid; u32 tid, ptid; u64 time; struct sample_id sample_id; };

PERF_RECORD_THROTTLE

struct {
  struct perf_event_header header;
  u64 time;
  u64 id;
  u64 stream_id;
  struct sample_id sample_id;
};

PERF_RECORD_UNTHROTTLE

PERF_RECORD_FORK

struct {
  struct perf_event_header header;
  u32 pid, ppid;
  u32 tid, ptid;
  u64 time;
  struct sample_id sample_id;
};

PERF_RECORD_READ

struct {
  struct perf_event_header header;
  u32 pid, tid;

  struct read_format values;
  struct sample_id sample_id;
};

PERF_RECORD_SAMPLE

struct {
 struct perf_event_header header;

 { u64 id; } && PERF_SAMPLE_IDENTIFIER
 { u64 ip; } && PERF_SAMPLE_IP
 { u32 pid, tid; } && PERF_SAMPLE_TID
 { u64 time; } && PERF_SAMPLE_TIME
 { u64 addr; } && PERF_SAMPLE_ADDR
 { u64 id; } && PERF_SAMPLE_ID
 { u64 stream_id; } && PERF_SAMPLE_STREAM_ID
 { u32 cpu, res; } && PERF_SAMPLE_CPU
 { u64 period; } && PERF_SAMPLE_PERIOD

 { struct read_format values; } && PERF_SAMPLE_READ

 { u64 nr;
   u64 ips[nr]; } && PERF_SAMPLE_CALLCHAIN


 { u32 size;
   char data[size]; }&& PERF_SAMPLE_RAW

 { u64 nr;
   { u64 from, to, flags } lbr[nr];} && PERF_SAMPLE_BRANCH_STACK

 { u64 abi; # enum perf_sample_regs_abi
   u64 regs[weight(mask)]; } && PERF_SAMPLE_REGS_USER
 { u64 size;
   char data[size];
   u64 dyn_size; } && PERF_SAMPLE_STACK_USER

 { u64 weight; } && PERF_SAMPLE_WEIGHT
 { u64 data_src; } && PERF_SAMPLE_DATA_SRC
 { u64 transaction; } && PERF_SAMPLE_TRANSACTION
 { u64 abi; # enum perf_sample_regs_abi
   u64 regs[weight(mask)]; } && PERF_SAMPLE_REGS_INTR
 { u64 phys_addr;} && PERF_SAMPLE_PHYS_ADDR
};

PERF_RECORD_MMAP2

The MMAP2 records are an augmented version of MMAP, they add maj, min, ino numbers to be used to uniquely identify each mapping

struct { struct perf_event_header header; u32 pid, tid; u64 addr; u64 len; u64 pgoff; u32 maj; u32 min; u64 ino; u64 ino_generation; u32 prot, flags; char filename[]; struct sample_id sample_id; };

PERF_RECORD_AUX

Records that new data landed in the AUX buffer part.

struct {
  struct perf_event_header header;

  u64 aux_offset;
  u64 aux_size;
  u64 flags;
  struct sample_id sample_id;
};

PERF_RECORD_ITRACE_START

Indicates that instruction trace has started

struct {
  struct perf_event_header header;
  u32 pid;
  u32 tid;
  struct sample_id sample_id;
};

PERF_RECORD_LOST_SAMPLES

Records the dropped/lost sample number.

struct {
  struct perf_event_header header;

  u64 lost;
  struct sample_id sample_id;
};

PERF_RECORD_SWITCH

Records a context switch in or out (flagged by PERF_RECORD_MISC_SWITCH_OUT). See also PERF_RECORD_SWITCH_CPU_WIDE.

struct {
  struct perf_event_header header;
  struct sample_id sample_id;
};

PERF_RECORD_SWITCH_CPU_WIDE

CPU-wide version of PERF_RECORD_SWITCH with next_prev_pid and next_prev_tid that are the next (switching out) or previous (switching in) pid/tid.

struct {
  struct perf_event_header header;
  u32 next_prev_pid;
  u32 next_prev_tid;
  struct sample_id sample_id;
};

PERF_RECORD_NAMESPACES

struct {
  struct perf_event_header header;
  u32 pid;
  u32 tid;
  u64 nr_namespaces;
  { u64 dev, inode; } [nr_namespaces];
  struct sample_id sample_id;
};

PERF_RECORD_KSYMBOL

Record ksymbol register/unregister events:

struct {
  struct perf_event_header	header;
  u64				addr;
  u32				len;
  u16				ksym_type;
  u16				flags;
  char				name[];
  struct sample_id		sample_id;
};

PERF_RECORD_BPF_EVENT

Record bpf events:

enum perf_bpf_event_type {
  PERF_BPF_EVENT_UNKNOWN		= 0,
  PERF_BPF_EVENT_PROG_LOAD	= 1,
  PERF_BPF_EVENT_PROG_UNLOAD	= 2,
};

struct {
  struct perf_event_header	header;
  u16				type;
  u16				flags;
  u32				id;
  u8				tag[BPF_TAG_SIZE];
  struct sample_id		sample_id;
};

PERF_RECORD_CGROUP

struct {
  struct perf_event_header	header;
  u64				id;
  char				path[];
  struct sample_id		sample_id;
};

PERF_RECORD_TEXT_POKE

Records changes to kernel text i.e. self-modified code. ‘old_len’ is the number of old bytes, ‘new_len’ is the number of new bytes. Either ‘old_len’ or ‘new_len’ may be zero to indicate, for example, the addition or removal of a trampoline. ‘bytes’ contains the old bytes followed immediately by the new bytes.

struct {
struct perf_event_header	header;
  u64				addr;
  u16				old_len;
  u16				new_len;
  u8				bytes[];
  struct sample_id		sample_id;
};

PERF_RECORD_MAX

non-ABI

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.