aux/trace: fix PIPE_QUERY_PIPELINE_STATISTICS_SINGLE tracing
don't just crash, dump! Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13582>
This commit is contained in:
parent
78b613db23
commit
58ba18474b
|
@ -47,6 +47,7 @@ struct trace_query
|
||||||
{
|
{
|
||||||
struct threaded_query base;
|
struct threaded_query base;
|
||||||
unsigned type;
|
unsigned type;
|
||||||
|
unsigned index;
|
||||||
|
|
||||||
struct pipe_query *query;
|
struct pipe_query *query;
|
||||||
};
|
};
|
||||||
|
@ -201,6 +202,7 @@ trace_context_create_query(struct pipe_context *_pipe,
|
||||||
if (tr_query) {
|
if (tr_query) {
|
||||||
tr_query->type = query_type;
|
tr_query->type = query_type;
|
||||||
tr_query->query = query;
|
tr_query->query = query;
|
||||||
|
tr_query->index = index;
|
||||||
query = (struct pipe_query *)tr_query;
|
query = (struct pipe_query *)tr_query;
|
||||||
} else {
|
} else {
|
||||||
pipe->destroy_query(pipe, query);
|
pipe->destroy_query(pipe, query);
|
||||||
|
@ -305,7 +307,7 @@ trace_context_get_query_result(struct pipe_context *_pipe,
|
||||||
|
|
||||||
trace_dump_arg_begin("result");
|
trace_dump_arg_begin("result");
|
||||||
if (ret) {
|
if (ret) {
|
||||||
trace_dump_query_result(tr_query->type, result);
|
trace_dump_query_result(tr_query->type, tr_query->index, result);
|
||||||
} else {
|
} else {
|
||||||
trace_dump_null();
|
trace_dump_null();
|
||||||
}
|
}
|
||||||
|
|
|
@ -936,7 +936,7 @@ void trace_dump_blit_info(const struct pipe_blit_info *info)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
trace_dump_query_result(unsigned query_type,
|
trace_dump_query_result(unsigned query_type, unsigned index,
|
||||||
const union pipe_query_result *result)
|
const union pipe_query_result *result)
|
||||||
{
|
{
|
||||||
if (!trace_dumping_enabled_locked())
|
if (!trace_dumping_enabled_locked())
|
||||||
|
@ -994,6 +994,46 @@ trace_dump_query_result(unsigned query_type,
|
||||||
trace_dump_struct_end();
|
trace_dump_struct_end();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case PIPE_QUERY_PIPELINE_STATISTICS_SINGLE:
|
||||||
|
trace_dump_struct_begin("pipe_query_data_pipeline_statistics");
|
||||||
|
switch (index) {
|
||||||
|
case PIPE_STAT_QUERY_IA_VERTICES:
|
||||||
|
trace_dump_member(uint, &result->pipeline_statistics, ia_vertices);
|
||||||
|
break;
|
||||||
|
case PIPE_STAT_QUERY_IA_PRIMITIVES:
|
||||||
|
trace_dump_member(uint, &result->pipeline_statistics, ia_primitives);
|
||||||
|
break;
|
||||||
|
case PIPE_STAT_QUERY_VS_INVOCATIONS:
|
||||||
|
trace_dump_member(uint, &result->pipeline_statistics, vs_invocations);
|
||||||
|
break;
|
||||||
|
case PIPE_STAT_QUERY_GS_INVOCATIONS:
|
||||||
|
trace_dump_member(uint, &result->pipeline_statistics, gs_invocations);
|
||||||
|
break;
|
||||||
|
case PIPE_STAT_QUERY_GS_PRIMITIVES:
|
||||||
|
trace_dump_member(uint, &result->pipeline_statistics, gs_primitives);
|
||||||
|
break;
|
||||||
|
case PIPE_STAT_QUERY_C_INVOCATIONS:
|
||||||
|
trace_dump_member(uint, &result->pipeline_statistics, c_invocations);
|
||||||
|
break;
|
||||||
|
case PIPE_STAT_QUERY_C_PRIMITIVES:
|
||||||
|
trace_dump_member(uint, &result->pipeline_statistics, c_primitives);
|
||||||
|
break;
|
||||||
|
case PIPE_STAT_QUERY_PS_INVOCATIONS:
|
||||||
|
trace_dump_member(uint, &result->pipeline_statistics, ps_invocations);
|
||||||
|
break;
|
||||||
|
case PIPE_STAT_QUERY_HS_INVOCATIONS:
|
||||||
|
trace_dump_member(uint, &result->pipeline_statistics, hs_invocations);
|
||||||
|
break;
|
||||||
|
case PIPE_STAT_QUERY_DS_INVOCATIONS:
|
||||||
|
trace_dump_member(uint, &result->pipeline_statistics, ds_invocations);
|
||||||
|
break;
|
||||||
|
case PIPE_STAT_QUERY_CS_INVOCATIONS:
|
||||||
|
trace_dump_member(uint, &result->pipeline_statistics, cs_invocations);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
trace_dump_struct_end();
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
assert(query_type >= PIPE_QUERY_DRIVER_SPECIFIC);
|
assert(query_type >= PIPE_QUERY_DRIVER_SPECIFIC);
|
||||||
trace_dump_uint(result->u64);
|
trace_dump_uint(result->u64);
|
||||||
|
|
|
@ -94,7 +94,7 @@ void trace_dump_draw_indirect_info(const struct pipe_draw_indirect_info *state);
|
||||||
|
|
||||||
void trace_dump_blit_info(const struct pipe_blit_info *);
|
void trace_dump_blit_info(const struct pipe_blit_info *);
|
||||||
|
|
||||||
void trace_dump_query_result(unsigned query_type,
|
void trace_dump_query_result(unsigned query_type, unsigned index,
|
||||||
const union pipe_query_result *result);
|
const union pipe_query_result *result);
|
||||||
|
|
||||||
void trace_dump_grid_info(const struct pipe_grid_info *state);
|
void trace_dump_grid_info(const struct pipe_grid_info *state);
|
||||||
|
|
Loading…
Reference in New Issue