gen8_append_oa_reports(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸŽ€ gen8_append_oa_reports(9) πŸŽ€

ok so this is a page from the Kernel API Manual β€” yes bestie, the kernel has lore too β€” and the file it lives in is ./drivers/gpu/drm/i915/i915_perf.c. buckle up, it's actually kinda iconic πŸ’…


✨ NAME ✨

gen8_append_oa_reports β€” literally copies all the buffered OA reports into the userspace read() buffer. that's the whole job. she scoops them all in 🫢


🌸 SYNOPSIS 🌸

int gen8_append_oa_reports (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. that's your girl, the whole reason we're here πŸ’–
  • buf β€” the destination buffer, handed to us by userspace. their house, their rules 🏠
  • count β€” how many bytes userspace actually wants to read. respect the limit babes βœ‹
  • offset β€” inout type situation: this is the current position we're writing into buf at. comes in with a value, leaves with a value, main character energy πŸ”₯

πŸ’œ DESCRIPTION πŸ’œ

ok so heads up, this is the important bit: any error condition that results in a short read (-ENOSPC or -EFAULT) will still get returned, even though one or more records may have already been successfully copied over. 😭 so it's fully possible that stuff got written AND you get an error back.

because of that, it's up to the caller to decide if that error should be squashed before returning to userspace. no cap, that's on you, not on this function 🫑


πŸ™ˆ NOTE πŸ™ˆ

reports are consumed from the head, and appended to the tail β€” so the tail kind of… chases the head?? 🀨

if you think that's mad and back-to-front, you're not alone bestie, but this follows the Gen PRM naming convention. so we vibe with it. periodt πŸ’€


⭐ RETURN ⭐

0 on success, negative error code on failure. slay when it's zero, cry when it's negative πŸŽ€


🌈 SEE ALSO 🌈

the whole friend group, fr fr:

Kernel file ./drivers/gpu/drm/i915/i915_perf.c, i915 Perf Overview(9), i915 Perf History and Comparison with Core Perf(9), OA Tail Pointer Race(9), struct perf_open_properties(9), oa_buffer_check_unlocked(9), append_oa_status(9), append_oa_sample(9), gen8_oa_read(9), gen7_append_oa_reports(9), gen7_oa_read(9), i915_oa_wait_unlocked(9), i915_oa_poll_wait(9), i915_oa_read(9), oa_get_render_ctx_id(9), oa_put_render_ctx_id(9), i915_oa_stream_enable(9), i915_oa_stream_disable(9), i915_oa_stream_init(9), i915_perf_read(9), i915_perf_poll_locked(9), i915_perf_poll(9), i915_perf_enable_locked(9), i915_perf_disable_locked(9), i915_perf_ioctl_locked(9), i915_perf_ioctl(9), i915_perf_destroy_locked(9), i915_perf_release(9), i915_perf_open_ioctl_locked(9), read_properties_unlocked(9), i915_perf_open_ioctl(9), i915_perf_register(9), i915_perf_unregister(9), i915_perf_add_config_ioctl(9), i915_perf_remove_config_ioctl(9), i915_perf_init(9), i915_perf_fini(9), i915_perf_ioctl_version(9)


ok that's the whole page, mwah πŸ’‹ this one comes straight out of ./drivers/gpu/drm/i915 and it's dated October 2026 β€” go read the other pages, ily, bye πŸ§šβ€β™€οΈβœ¨

πŸ“¦ where this page comes from