Perf Event Collector Stage

This stage enables the capture of kernel ‘perf event counters’ (see the section on profiling). All information captured from the kernel is packed into rbufs and transmitted, allowing you to log this information and post-process it into something more actionable.

Configuration

The stage is configured via the PerfEventConfig structure. This structure contains a single field, events, which allows you to configure the events that you wish to capture. Each event can be configured as such:

  • name - The name of the event, such as sched/sched_waking or sched/sched_switch.
  • buffer_size_pages - The size of the ring buffer (must be a power of two). Larger buffers use more memory but will reduce the data that is dropped.
  • event_wakeup_threshold - The number of events to accumulate before data is collected. Lower numbers cause higher system load but reduce latency.

You can leave buffer_size_pages and event_wakeup_threshold at zero to accept the defaults.

Interacting

By default, the stage will wake up and collect data whenever a ring buffer has sufficient data in it. It does not offer any other control.

Metrics

The stage periodically emits statistics indicating how many errors there have been, connection attempts have been made, and how many bytes have been read.