gen7_append_oa_reports(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… gen7_append_oa_reports β€” like, the whole manual page, bestie

okay so this is from the Kernel API Manual, section 9 (kernel dev docs, iykyk), and the star of the show is gen7_append_oa_reports. Buckle up πŸŽ€


✨ NAME ✨

gen7_append_oa_reports β€” literally copies all the buffered OA reports into the userspace read() buffer. that's it, that's the job 🫢


🌸 SYNOPSIS 🌸

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

look at her go 😭 she returns an int, she takes an i915_perf_stream, she takes a user buffer, she takes a count, she takes an offset pointer. four args, no cap.


πŸ¦‹ ARGUMENTS πŸ¦‹

  • stream β€” an i915-perf stream that was opened for OA metrics. the whole reason we're here πŸ’–
  • buf β€” the destination buffer, handed to us by userspace. respect her, she's user memory 🫑
  • count β€” how many bytes userspace wants to read. the vibe check for how much room we get.
  • offset β€” (inout) the current position for writing into buf. it goes in, and it comes out changed, hence "inout", hence the drama ✨

🧚 DESCRIPTION 🧚

So here's the thing bestie, and it's kinda important πŸ‘€ Notably, any error condition that results in a short read β€” that's -ENOSPC or -EFAULT β€” will be returned even though one or more records may have already been successfully copied. yup. the copy happened, the error still comes back, both things are true, we contain multitudes πŸ’€

In that case it's up to the caller to decide if the error should be squashed before returning to userspace. caller's problem now, not ours. periodt πŸ™ˆ


⭐ NOTE ⭐

reports are consumed from the head, and appended to the tail, so the tail… chases the head?? πŸŒ€ like…

If you think that's mad and back-to-front you're not alone, but this follows the Gen PRM naming convention.

fr fr, we all think it's weird, the PRM said so, we don't make the rules (we literally do not make the rules) 🌈


πŸ”₯ RETURN πŸ”₯

  • 0 on success πŸŽ‰
  • a negative error code on failure 😭

πŸ‘‘ SEE ALSO πŸ‘‘

Kernel file ./drivers/gpu/drm/i915/i915_perf.c and, like, the entire extended universe of OA lore:


that's the whole page babes, every flag, every arg, every cross-reference, no skips, no cap πŸ’œ

mwah πŸ’‹ β€” sourced from ./drivers/gpu/drm/i915, version dated October 2026, page name gen7_append_oa_reports(9). stan her, she's iconic πŸŽ€βœ¨

πŸ“¦ where this page comes from