diff options
author | Konstantin Seurer <konstantin.seurer@gmail.com> | 2024-02-04 18:07:08 +0100 |
---|---|---|
committer | Marge Bot <emma+marge@anholt.net> | 2024-03-19 16:08:13 +0000 |
commit | bf15688fa15bbd64d54658edf1e8814c330c2abc (patch) | |
tree | e9381c03566cc37547aede04cffc2ab4d6714694 | |
parent | 0f436e0fe157cc78a0a3b35a9ed68133c4e1516a (diff) |
ac/parse_ib: Implement annotations
Annotates the IB dump with driver specified strings.
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27549>
-rw-r--r-- | src/amd/common/ac_debug.h | 1 | ||||
-rw-r--r-- | src/amd/common/ac_parse_ib.c | 7 |
2 files changed, 8 insertions, 0 deletions
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); |