diff --git a/src/intel/tools/aubinator_error_decode.c b/src/intel/tools/aubinator_error_decode.c index 67f09f817b838..92e6e20138f6b 100644 --- a/src/intel/tools/aubinator_error_decode.c +++ b/src/intel/tools/aubinator_error_decode.c @@ -942,7 +942,8 @@ main(int argc, char *argv[]) getline(&line, &line_size, file); rewind(file); if (strncmp(line, XE_KMD_ERROR_DUMP_IDENTIFIER, strlen(XE_KMD_ERROR_DUMP_IDENTIFIER)) == 0) - read_xe_data_file(file, batch_flags, xml_path, option_dump_kernels, option_print_all_bb); + read_xe_data_file(file, batch_flags, xml_path, option_dump_kernels, + option_print_all_bb, option_color); else read_i915_data_file(file, batch_flags); free(line); diff --git a/src/intel/tools/aubinator_error_decode_xe.c b/src/intel/tools/aubinator_error_decode_xe.c index 60695583c5294..dd0a774cc8e20 100644 --- a/src/intel/tools/aubinator_error_decode_xe.c +++ b/src/intel/tools/aubinator_error_decode_xe.c @@ -64,12 +64,30 @@ print_batch(struct intel_batch_decode_ctx *batch_ctx, const uint32_t *bb_data, } } +static void +print_register(struct intel_spec *spec, enum decode_color option_color, + const char *name, uint32_t reg) +{ + struct intel_group *reg_spec = + name ? intel_spec_find_register_by_name(spec, name) : NULL; + + if (reg_spec) { + const char *spacing_reg = "\t\t"; + const char *spacing_dword = "\t"; + + intel_print_group_custom_spacing(stdout, reg_spec, 0, ®, 0, + option_color == DECODE_COLOR_ALWAYS, + spacing_reg, spacing_dword); + } +} + void read_xe_data_file(FILE *file, enum intel_batch_decode_flags batch_flags, const char *spec_xml_path, bool option_dump_kernels, - bool option_print_all_bb) + bool option_print_all_bb, + enum decode_color option_color) { struct intel_batch_decode_ctx batch_ctx; struct intel_device_info devinfo; @@ -105,10 +123,10 @@ read_xe_data_file(FILE *file, switch (xe_topic) { case XE_TOPIC_DEVICE: { - int int_value; + uint32_t value; - if (error_decode_xe_read_hexacimal_parameter(line, "PCI ID", &int_value)) { - if (intel_get_device_info_from_pci_id(int_value, &devinfo)) { + if (error_decode_xe_read_hexacimal_parameter(line, "PCI ID", &value)) { + if (intel_get_device_info_from_pci_id(value, &devinfo)) { printf("Detected GFX ver %i\n", devinfo.verx10); brw_init_isa_info(&isa, &devinfo); @@ -117,7 +135,7 @@ read_xe_data_file(FILE *file, else spec = intel_spec_load_from_path(&devinfo, spec_xml_path); } else { - printf("Unable to identify devid: 0x%x\n", int_value); + printf("Unable to identify devid: 0x%x\n", value); } } @@ -126,12 +144,66 @@ read_xe_data_file(FILE *file, case XE_TOPIC_HW_ENGINES: { char engine_name[64]; uint64_t u64_reg; + uint32_t reg; - if (error_decode_xe_read_engine_name(line, engine_name)) + if (error_decode_xe_read_engine_name(line, engine_name)) { ring_name_to_class(engine_name, &engine_class); + break; + } - if (error_decode_xe_read_u64_hexacimal_parameter(line, "ACTHD", &u64_reg)) + if (error_decode_xe_read_u64_hexacimal_parameter(line, "ACTHD", &u64_reg)) { acthd = u64_reg; + break; + } + + if (error_decode_xe_read_hexacimal_parameter(line, "RING_INSTDONE", ®)) { + print_line = false; + fputs(line, stdout); + print_register(spec, option_color, "INSTDONE_1", reg); + break; + } + + if (error_decode_xe_read_hexacimal_parameter(line, "SC_INSTDONE", ®)) { + print_line = false; + fputs(line, stdout); + print_register(spec, option_color, "SC_INSTDONE", reg); + break; + } + + if (error_decode_xe_read_hexacimal_parameter(line, "SC_INSTDONE_EXTRA", ®)) { + print_line = false; + fputs(line, stdout); + print_register(spec, option_color, "SC_INSTDONE_EXTRA", reg); + break; + } + + if (error_decode_xe_read_hexacimal_parameter(line, "SC_INSTDONE_EXTRA2", ®)) { + print_line = false; + fputs(line, stdout); + print_register(spec, option_color, "SC_INSTDONE_EXTRA2", reg); + break; + } + + if (error_decode_xe_read_hexacimal_parameter(line, "SAMPLER_INSTDONE", ®)) { + print_line = false; + fputs(line, stdout); + print_register(spec, option_color, "SAMPLER_INSTDONE", reg); + break; + } + + if (error_decode_xe_read_hexacimal_parameter(line, "ROW_INSTDONE", ®)) { + print_line = false; + fputs(line, stdout); + print_register(spec, option_color, "ROW_INSTDONE", reg); + break; + } + + if (error_decode_xe_read_hexacimal_parameter(line, "INSTDONE_GEOM_SVGUNIT", ®)) { + print_line = false; + fputs(line, stdout); + print_register(spec, option_color, "INSTDONE_GEOM", reg); + break; + } /* TODO: parse other engine registers */ break; diff --git a/src/intel/tools/aubinator_error_decode_xe.h b/src/intel/tools/aubinator_error_decode_xe.h index 0fd8bb1b83cd4..f4c1975520919 100644 --- a/src/intel/tools/aubinator_error_decode_xe.h +++ b/src/intel/tools/aubinator_error_decode_xe.h @@ -8,6 +8,7 @@ #include #include +#include "aubinator_error_decode_lib.h" #include "decoder/intel_decoder.h" void @@ -15,4 +16,5 @@ read_xe_data_file(FILE *file, enum intel_batch_decode_flags batch_flags, const char *spec_xml_path, bool option_dump_kernels, - bool option_print_all_bb); + bool option_print_all_bb, + enum decode_color option_color); diff --git a/src/intel/tools/error_decode_xe_lib.c b/src/intel/tools/error_decode_xe_lib.c index dc2fb0b5e792c..ff8527a73f35c 100644 --- a/src/intel/tools/error_decode_xe_lib.c +++ b/src/intel/tools/error_decode_xe_lib.c @@ -39,13 +39,13 @@ error_decode_xe_read_u64_hexacimal_parameter(const char *line, const char *param /* parse lines like 'PCI ID: 0x9a49' */ bool -error_decode_xe_read_hexacimal_parameter(const char *line, const char *parameter, int *value) +error_decode_xe_read_hexacimal_parameter(const char *line, const char *parameter, uint32_t *value) { line = read_parameter_helper(line, parameter); if (!line) return false; - *value = (int)strtol(line, NULL, 0); + *value = (int)strtoul(line, NULL, 0); return true; } diff --git a/src/intel/tools/error_decode_xe_lib.h b/src/intel/tools/error_decode_xe_lib.h index 5ce538e44cfc4..9a658d991bbe5 100644 --- a/src/intel/tools/error_decode_xe_lib.h +++ b/src/intel/tools/error_decode_xe_lib.h @@ -41,7 +41,7 @@ struct xe_vm { }; bool error_decode_xe_read_u64_hexacimal_parameter(const char *line, const char *parameter, uint64_t *value); -bool error_decode_xe_read_hexacimal_parameter(const char *line, const char *parameter, int *value); +bool error_decode_xe_read_hexacimal_parameter(const char *line, const char *parameter, uint32_t *value); bool error_decode_xe_read_engine_name(const char *line, char *ring_name); bool error_decode_xe_decode_topic(const char *line, enum xe_topic *new_topic);