[igt-dev] [PATCH 4/5] tools/i915-perf: Add mmapped OA buffer support to i915-perf-recorder

Dixit, Ashutosh ashutosh.dixit at intel.com
Tue Aug 24 01:45:22 UTC 2021


On Tue, 03 Aug 2021 13:07:36 -0700, Umesh Nerlige Ramappa wrote:
>
> +	/*
> +	 * We do not have permissions to update the OA HEAD register, so we
> +	 * would end up with a buffer lost error once the OA buffer fills up. To

s/buffer lost/data lost/ ?

> +	 * avoid that, drain the OA buffer into a zero mem device. The drain
> +	 * eventually updates the head register in i915.
> +	 */
> +	while (read(ctx->perf_fd, ctx->zero_mem, ctx->oa_buffer_size) > 0 || errno == EINTR);

Also this looks strange that in this mmap mode userspace cannot update the
head and it must re-read the data using read() which it has already
previously read from the mmap'd buffer. Is this an acceptable interface and
has it been reviewed? Maybe when the OA buffer is mmap'd i915 should not
report the data lost error (and silently clear it) and leave it to
userspace to manage this? And anyway I think the mmap and the read() modes
are mutually exclusive so the data lost error will be seen only in the
read() mode not in the mmap mode correct? So I don't understand why this
drain operation needs to be done. Thanks.


More information about the igt-dev mailing list