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>
This commit is contained in:
Konstantin Seurer 2024-02-04 18:07:08 +01:00 committed by Marge Bot
parent 0f436e0fe1
commit bf15688fa1
2 changed files with 8 additions and 0 deletions

View file

@ -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;

View file

@ -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);