intel/perf: set read buffer len to 0 to identify empty buffer
We always add an empty buffer in the list when creating the query. Let's set the len appropriately so that we can recognize it when we read OA reports up to the end of a query. We were using an 0 timestamp value associated with the empty buffer and incorrectly assuming this was a valid value. In turn that led to not reading enough reports and resulted in deltas added to our counter values which should have been discarded because those would be flagged for a different context. Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Cc: <mesa-stable@lists.freedesktop.org> Reviewed-by: Mark Janes <mark.a.janes@intel.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
This commit is contained in:
@@ -1465,8 +1465,8 @@ get_free_sample_buf(struct gen_perf_context *perf_ctx)
|
|||||||
|
|
||||||
exec_node_init(&buf->link);
|
exec_node_init(&buf->link);
|
||||||
buf->refcount = 0;
|
buf->refcount = 0;
|
||||||
buf->len = 0;
|
|
||||||
}
|
}
|
||||||
|
buf->len = 0;
|
||||||
|
|
||||||
return buf;
|
return buf;
|
||||||
}
|
}
|
||||||
@@ -1983,7 +1983,8 @@ read_oa_samples_until(struct gen_perf_context *perf_ctx,
|
|||||||
exec_list_get_tail(&perf_ctx->sample_buffers);
|
exec_list_get_tail(&perf_ctx->sample_buffers);
|
||||||
struct oa_sample_buf *tail_buf =
|
struct oa_sample_buf *tail_buf =
|
||||||
exec_node_data(struct oa_sample_buf, tail_node, link);
|
exec_node_data(struct oa_sample_buf, tail_node, link);
|
||||||
uint32_t last_timestamp = tail_buf->last_timestamp;
|
uint32_t last_timestamp =
|
||||||
|
tail_buf->len == 0 ? start_timestamp : tail_buf->last_timestamp;
|
||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
struct oa_sample_buf *buf = get_free_sample_buf(perf_ctx);
|
struct oa_sample_buf *buf = get_free_sample_buf(perf_ctx);
|
||||||
|
Reference in New Issue
Block a user