From bf15688fa15bbd64d54658edf1e8814c330c2abc Mon Sep 17 00:00:00 2001 From: Konstantin Seurer Date: Sun, 4 Feb 2024 18:07:08 +0100 Subject: [PATCH] ac/parse_ib: Implement annotations MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Annotates the IB dump with driver specified strings. Reviewed-by: Marek Olšák Part-of: --- src/amd/common/ac_debug.h | 1 + src/amd/common/ac_parse_ib.c | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/src/amd/common/ac_debug.h b/src/amd/common/ac_debug.h index e2dd63017b4..6cc7c52a8ca 100644 --- a/src/amd/common/ac_debug.h +++ b/src/amd/common/ac_debug.h @@ -81,6 +81,7 @@ struct ac_ib_parser { enum amd_ip_type ip_type; ac_debug_addr_callback addr_callback; void *addr_callback_data; + struct hash_table *annotations; /* Internal */ unsigned cur_dw; diff --git a/src/amd/common/ac_parse_ib.c b/src/amd/common/ac_parse_ib.c index a896baf4ca7..9eea077778d 100644 --- a/src/amd/common/ac_parse_ib.c +++ b/src/amd/common/ac_parse_ib.c @@ -9,6 +9,7 @@ #include "sid_tables.h" #include "util/compiler.h" +#include "util/hash_table.h" #include "util/u_debug.h" #include "util/u_math.h" #include "util/memstream.h" @@ -695,6 +696,12 @@ static void parse_gfx_compute_ib(FILE *f, struct ac_ib_parser *ib) int current_trace_id = -1; while (ib->cur_dw < ib->num_dw) { + if (ib->annotations) { + struct hash_entry *marker = _mesa_hash_table_search(ib->annotations, ib->ib + ib->cur_dw); + if (marker) + fprintf(f, "\n%s:", (char *)marker->data); + } + uint32_t header = ac_ib_get(ib); unsigned type = PKT_TYPE_G(header);