append_oa_sample(9)
π append_oa_sample(9) π
Okay bestie, this is append_oa_sample(9) straight out of the Kernel API Manual. Itβs giving kernel-perf fairy vibes, itβs lowkey iconic, and itβs literally about copying one single OA report into the userspace read() buffer. π
π NAME π
append_oa_sample β copies a single OA report into the userspace read() buffer. β¨
β¨ SYNOPSIS β¨
int append_oa_sample (struct i915_perf_stream *stream , char __user *buf
, size_t count , size_t *offset , const u8 *report );
π¦ ARGUMENTS π¦
streamβ an i915-perf stream opened for OA metrics, the main character here. πbufβ the destination buffer given by userspace.countβ the number of bytes userspace wants to read.offsetβ (inout) the current position for writing intobuf; yes, itβs an inout situation, track it carefully.reportβ a single OA report to (optionally) include as part of the sample.
πΈ DESCRIPTION πΈ
So the contents of a sample are configured through DRM_I915_PERF_PROP_SAMPLE_* properties when opening a stream, and those are tracked as stream->sample_flags. This function copies the requested components of a single sample into the given read buf. Simple? Mostly. iykyk. π«Ά
Important vibe check: the buf offset will only be updated on success. No accidental offset glow-up on failure, periodt. π
π₯ RETURN π₯
0 on success, negative error code on failure. Thatβs it, thatβs the return tea. π
π SEE ALSO π
Kernel file: ./drivers/gpu/drm/i915/i915_perf.c. Hereβs the full squad of references, every single one, no cap:
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)gen8_append_oa_reports(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)
Source/version + date sign-off: ./drivers/gpu/drm/i915 Β· October 2026 Β· append_oa_sample(9) β mwah, bestie ππ
π¦ 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