gen7_oa_read(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… gen7_oa_read(9) β€” the Kernel API Manual moment πŸŽ€

okay so bestie, this one lives in the Kernel API Manual and honestly it's giving "quiet hero of the OA pipeline" energy. Let's get into it ✨


✨ NAME ✨

gen7_oa_read β€” copy status records and then the buffered OA reports, in that order, no skipping, periodt πŸ’–


πŸ¦‹ SYNOPSIS πŸ¦‹

int gen7_oa_read (struct i915_perf_stream *stream , char __user *buf ,
size_t count , size_t *offset );

🌸 ARGUMENTS 🌸

  • stream β€” an i915-perf stream that was opened for OA metrics πŸŽ€
  • buf β€” the destination buffer, handed over by userspace
  • count β€” how many bytes userspace is asking to read
  • offset β€” (inout!) the current position for writing into buf. It goes in, and it comes back out changed. main character energy, truly πŸ‘‘

πŸ’œ DESCRIPTION πŸ’œ

So what this icon actually does: it checks the Gen 7 specific OA unit status registers β€” yep, those β€” and if it's necessary, it appends the matching status records for userspace (think buffer-full condition, that kind of thing 😭). Then, after that, it kicks off appending any buffered OA reports.

Order matters. Status records first, buffered reports second. That's the whole vibe check. πŸ”₯

And it updates offset to match the number of bytes it actually managed to copy into the userspace buffer β€” so your bookkeeping stays honest, no cap πŸ’…


⭐ RETURN ⭐

zero on success, or a negative error code if it doesn't slay πŸ˜”


🫢 SEE ALSO 🫢

Kernel file ./drivers/gpu/drm/i915/i915_perf.c (iykyk, that's the source of truth) plus this whole squad of friends:


🧚 also a lil shoutout to the source path ./drivers/gpu/drm/i915 and the date October 2026 β€” that's where this page comes from and when it was stamped, so you know it's fresh πŸ’–

okay that's the whole page, go read some perf code bestie, you've got this πŸŒˆπŸ‘‘

πŸ“¦ where this page comes from