anv: add query tracepoints

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23500>
This commit is contained in:
Lionel Landwerlin 2023-06-09 23:00:09 +03:00 committed by Marge Bot
parent 9de8134410
commit 06b436e51e
3 changed files with 24 additions and 0 deletions

View file

@ -392,6 +392,9 @@ CREATE_DUAL_EVENT_CALLBACK(xfb, INTEL_DS_QUEUE_STAGE_CMD_BUFFER)
CREATE_DUAL_EVENT_CALLBACK(compute, INTEL_DS_QUEUE_STAGE_COMPUTE)
CREATE_DUAL_EVENT_CALLBACK(generate_draws, INTEL_DS_QUEUE_STAGE_GENERATE_DRAWS)
CREATE_DUAL_EVENT_CALLBACK(trace_copy, INTEL_DS_QUEUE_STAGE_BLORP)
CREATE_DUAL_EVENT_CALLBACK(query_clear_blorp, INTEL_DS_QUEUE_STAGE_BLORP)
CREATE_DUAL_EVENT_CALLBACK(query_clear_cs, INTEL_DS_QUEUE_STAGE_CMD_BUFFER)
CREATE_DUAL_EVENT_CALLBACK(query_copy, INTEL_DS_QUEUE_STAGE_CMD_BUFFER)
void
intel_ds_begin_cmd_buffer_annotation(struct intel_ds_device *device,

View file

@ -121,6 +121,13 @@ def define_tracepoints(args):
# Indirect draw generation, only for Anv
begin_end_tp('generate_draws')
# vkCmdResetQuery, only for Anv
begin_end_tp('query_clear_blorp')
begin_end_tp('query_clear_cs', end_pipelined=False)
# vkCmdCopyQueryResults, only for Anv
begin_end_tp('query_copy', end_pipelined=False)
# Various draws/dispatch, Anv & Iris
begin_end_tp('draw',
tp_args=[Arg(type='uint32_t', var='count', c_format='%u')])

View file

@ -34,6 +34,8 @@
#include "genxml/gen_macros.h"
#include "genxml/genX_pack.h"
#include "ds/intel_tracepoints.h"
/* We reserve :
* - GPR 14 for perf queries
* - GPR 15 for conditional rendering
@ -786,6 +788,8 @@ void genX(CmdResetQueryPool)(
*/
if (queryCount >= pdevice->instance->query_clear_with_blorp_threshold &&
!intel_device_info_is_mtl(cmd_buffer->device->info)) {
trace_intel_begin_query_clear_blorp(&cmd_buffer->trace);
anv_cmd_buffer_fill_area(cmd_buffer,
anv_query_address(pool, firstQuery),
queryCount * pool->stride,
@ -794,9 +798,13 @@ void genX(CmdResetQueryPool)(
anv_add_pending_pipe_bits(cmd_buffer,
ANV_PIPE_QUERY_CLEARS_BIT,
"vkCmdResetQueryPool of timestamps");
trace_intel_end_query_clear_blorp(&cmd_buffer->trace);
return;
}
trace_intel_begin_query_clear_cs(&cmd_buffer->trace);
switch (pool->type) {
case VK_QUERY_TYPE_OCCLUSION:
#if GFX_VERx10 >= 125
@ -870,6 +878,8 @@ void genX(CmdResetQueryPool)(
default:
unreachable("Unsupported query type");
}
trace_intel_end_query_clear_cs(&cmd_buffer->trace);
}
void genX(ResetQueryPool)(
@ -1500,6 +1510,8 @@ void genX(CmdCopyQueryPoolResults)(
ANV_FROM_HANDLE(anv_query_pool, pool, queryPool);
ANV_FROM_HANDLE(anv_buffer, buffer, destBuffer);
trace_intel_begin_query_copy(&cmd_buffer->trace);
struct mi_builder b;
mi_builder_init(&b, cmd_buffer->device->info, &cmd_buffer->batch);
struct mi_value result;
@ -1630,6 +1642,8 @@ void genX(CmdCopyQueryPoolResults)(
dest_addr = anv_address_add(dest_addr, destStride);
}
trace_intel_end_query_copy(&cmd_buffer->trace);
}
#if GFX_VERx10 >= 125 && ANV_SUPPORT_RT