* Hole for extension of the self monitor capabilities *//** align to 1k.
AUX area is defined by aux_{offset,size} fields that should be set by the userspace, so that
lowest version this is compat with
* Control data for the mmap() data buffer. * * User-space reading the @data_head value should issue an smp_rmb(), * after reading this value. * * When the mapping is PROT_WRITE the @data_tail value should be * written by userspace to reflect the last read data, after issueing * an smp_mb() to separate the data read from the ->data_tail store. * In this case the kernel will not over-write unread data. * * See perf_output_put_handle() for the data ordering. * * data_{offset,size} indicate the location and size of the perf record * buffer within the mmapped area. *//** head in the data section
where the buffer starts
data buffer size
user-space written tail
hardware event identifier
* Bits needed to read the hw events in user-space. * --- * u32 seq, time_mult, time_shift, index, width; * u64 count, enabled, running; * u64 cyc, time_offset; * s64 pmc = 0; * * do { * seq = pc->lock; * barrier() * * enabled = pc->time_enabled; * running = pc->time_running; * * if (pc->cap_usr_time && enabled != running) { * cyc = rdtsc(); * time_offset = pc->time_offset; * time_mult = pc->time_mult; * time_shift = pc->time_shift; * } * * index = pc->index; * count = pc->offset; * if (pc->cap_user_rdpmc && index) { * width = pc->pmc_width; * pmc = rdpmc(index - 1); * } * * barrier(); * } while (pc->lock != seq); * --- * NOTE: for obvious reason this only works on self-monitoring * processes. *//** seqlock for synchronization
add to hardware event value
If cap_user_rdpmc this field provides the bit-width of the value read using the rdpmc() or equivalent instruction. This can be used to sign extend the result like:
Header size up to __reserved[] fields.
time event active
time event on cpu
If cap_usr_time the below fields can be used to compute the time delta since time_enabled (in ns) using rdtsc or similar.
If cap_usr_time_zero, the hardware clock (e.g. TSC) can be calculated from sample timestamps.
version number of this structure
Structure of the page that can be mapped via mmap