append_oa_sample(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 into buf; 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:


Source/version + date sign-off: ./drivers/gpu/drm/i915 Β· October 2026 Β· append_oa_sample(9) β€” mwah, bestie πŸ’‹πŸŽ€

πŸ“¦ where this page comes from