i915_perf_read(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– i915_perf_read(9) πŸ’–

okay bestie, so this is i915_perf_read(9) from the Kernel API Manual β€” and it's literally the entry point for handling a read() FOP on i915 perf stream FDs, no cap. Let me walk you through it 🫢


✨ SYNOPSIS ✨

ssize_t i915_perf_read (struct file *file , char __user *buf , size_t
count , loff_t *ppos );

πŸŽ€ ARGUMENTS πŸŽ€

  • file β€” an i915 perf stream file, periodt
  • buf β€” the destination buffer, handed to us by userspace πŸ¦‹
  • count β€” how many bytes userspace is trying to read, iykyk
  • ppos β€” (inout) the file seek position β€” and honestly, it's not even used πŸ™ˆ

🌸 DESCRIPTION 🌸

So this is the entry point for handling a read on a stream file descriptor from userspace. Most of the actual work is lowkey left to i915_perf_read_locked and i915_perf_stream_ops->read β€” but here's the thing: to save having stream implementations (of which we might have multiple later, fr fr) we handle the blocking read right here ✨

We can also consistently treat trying to read from a disabled stream as an IO error, so implementations can totally assume the stream is enabled while reading. Iconic behaviour tbh πŸ’…


πŸ”₯ RETURN πŸ”₯

The number of bytes copied, or a negative error code if something goes wrong 😭


πŸ‘‘ SEE ALSO πŸ‘‘

Kernel file ./drivers/gpu/drm/i915/i915_perf.c β€” plus the whole friend group:


and that's the whole page, bestie πŸ’œ this one's brought to you by the fine people at ./drivers/gpu/drm/i915, dated October 2026 β€” mwah, slay, see u in the next manpage πŸŽ€βœ¨πŸ’…

πŸ“¦ where this page comes from