STRUCT I915_PERF_STREAM_OPS(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

okay so bestie πŸ’– this is the struct i915_perf_stream_ops(9) page from the Kernel API Manual β€” yes, that manual name is staying right here near the top, cute and accounted for 🫢

🌸 NAME 🌸

struct i915_perf_stream_ops β€” the OPs to support a specific stream type. literally the plug for one stream type, periodt ✨

✨ SYNOPSIS ✨

struct i915_perf_stream_ops {
    void (*enable)(struct i915_perf_stream *stream);
    void (*disable)(struct i915_perf_stream *stream);
    void (*poll_wait)(struct i915_perf_stream *stream, struct file
*file, poll_table *wait);
    int (*wait_unlocked)(struct i915_perf_stream *stream);
    int (*read)(struct i915_perf_stream *stream, char __user *buf,
size_t count, size_t *offset);
    void (*destroy)(struct i915_perf_stream *stream);
 };

πŸŽ€ Members πŸŽ€

  • enable β€” Enables the collection of HW samples, either in response to I915_PERF_IOCTL_ENABLE or implicitly called when stream is opened without I915_PERF_FLAG_DISABLED πŸ’…
  • disable β€” Disables the collection of HW samples, either in response to I915_PERF_IOCTL_DISABLE or implicitly called before destroying the stream.
  • poll_wait β€” Call poll_wait, passing a wait queue that will be woken once there is something ready to read for the stream.
  • wait_unlocked β€” For handling a blocking read, wait until there is something to ready to read for the stream. E.g. wait on the same wait queue that would be passed to poll_wait.
  • read β€” Copy buffered metrics as records to userspace:
    • buf β€” the userspace, destination buffer
    • count β€” the number of bytes to copy, requested by userspace
    • offset β€” zero at the start of the read, updated as the read proceeds, it represents how many bytes have been copied so far and the buffer offset for copying the next record.

Copy as many buffered i915 perf samples and records for this stream to userspace as will fit in the given buffer.

Only write complete records; returning -ENOSPC if there isn't room for a complete record.

Return any error condition that results in a short read such as -ENOSPC or -EFAULT, even though these may be squashed before returning to userspace.

  • destroy β€” Cleanup any stream specific resources.

The stream will always be disabled before this is called.

πŸ¦‹ SEE ALSO πŸ¦‹

go peek at the kernel file ./drivers/gpu/drm/i915/i915_perf_types.h β€” and also struct i915_perf_stream(9) and struct i915_oa_ops(9). iykyk πŸ”₯


mwah πŸ’‹ this one lives under ./drivers/gpu/drm/i915 and is dated October 2026 β€” iconic little kernel cameo, no cap πŸ‘‘

πŸ“¦ where this page comes from