gen7_oa_read(9)
π 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 userspacecountβ how many bytes userspace is asking to readoffsetβ (inout!) the current position for writing intobuf. 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:
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_append_oa_reports(9)gen8_oa_read(9)gen7_append_oa_reports(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)
π§ 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
- 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