gen8_append_oa_reports(9)
π 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 intobufat. 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
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms