intel/tools: Add ELK support for intel_hang_replay

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27563>
This commit is contained in:
Caio Oliveira 2024-02-09 09:23:43 -08:00 committed by Marge Bot
parent c9a6b49b4b
commit 9d379f08af
2 changed files with 16 additions and 6 deletions

View file

@ -44,6 +44,8 @@
#include "common/intel_gem.h"
#include "common/intel_hang_dump.h"
#include "compiler/elk/elk_disasm.h"
#include "compiler/elk/elk_isa_info.h"
#include "compiler/brw_disasm.h"
#include "compiler/brw_isa_info.h"
#include "dev/intel_device_info.h"
@ -416,11 +418,19 @@ main(int argc, char *argv[])
found = true;
fprintf(stderr, "shader at 0x%016"PRIx64" file_offset=0%016"PRIx64" addr_offset=%016"PRIx64":\n", *addr,
(bo->file_offset - aligned_offset), (*addr - bo->offset));
struct brw_isa_info _isa, *isa = &_isa;
brw_init_isa_info(isa, &devinfo);
brw_disassemble_with_errors(isa,
map + (bo->file_offset - aligned_offset) + (*addr - bo->offset),
0, stderr);
if (devinfo.ver >= 9) {
struct brw_isa_info _isa, *isa = &_isa;
brw_init_isa_info(isa, &devinfo);
brw_disassemble_with_errors(isa,
map + (bo->file_offset - aligned_offset) + (*addr - bo->offset),
0, stderr);
} else {
struct elk_isa_info _isa, *isa = &_isa;
elk_init_isa_info(isa, &devinfo);
elk_disassemble_with_errors(isa,
map + (bo->file_offset - aligned_offset) + (*addr - bo->offset),
0, stderr);
}
munmap(map, remaining_length);
}

View file

@ -80,7 +80,7 @@ intel_hang_replay = executable(
files('intel_hang_replay.c'),
dependencies : [idep_intel_dev, idep_libintel_common, dep_libdrm, dep_dl, dep_thread, dep_m],
include_directories : [inc_include, inc_src, inc_intel],
link_with : [libintel_compiler],
link_with : [libintel_compiler, libintel_compiler_elk],
c_args : [no_override_init_args],
gnu_symbol_visibility : 'hidden',
install : true