From 965e28ff8aab6e4c5d291d90257991a26128342a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Roberto=20de=20Souza?= Date: Wed, 22 Apr 2026 11:02:35 -0700 Subject: [PATCH] intel/tools: Fix parse of '[HWCTX].replay_*' in aubinator_error_decode_xe MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This hides [HWCTX].replay_offset and [HWCTX].replay_length for error decoder as those are not relevante when just reading the error decoded. From: GuC ID: 33 Name: bcs33 Class: 3 Logical mask: 0x1 Width: 1 Ref: 65 Timeout: 0 (ms) Timeslice: 1000 (us) Preempt timeout: 640000 (us) HW Context Desc: 0x03862000 HW Ring address: 0x0385e000 HW Indirect Ring State: 0x00000000 LRC Head: (memory) 0 LRC Tail: (internal) 4408, (memory) 4408 Ring start: (memory) 0x0385e000 Start seqno: (memory) -127 Seqno: (memory) -128 Timestamp: 0x00000001 Job Timestamp: 0x0000005c type char: [HWCTX].replay_offset: 0x0 type char: [HWCTX].replay_length: 0x1000 Schedule State: 0x241 Flags: 0x0 To: **** Contexts **** GuC ID: 33 Name: bcs33 Class: 3 Logical mask: 0x1 Width: 1 Ref: 65 Timeout: 0 (ms) Timeslice: 1000 (us) Preempt timeout: 640000 (us) HW Context Desc: 0x03862000 HW Ring address: 0x0385e000 HW Indirect Ring State: 0x00000000 LRC Head: (memory) 0 LRC Tail: (internal) 4408, (memory) 4408 Ring start: (memory) 0x0385e000 Start seqno: (memory) -127 Seqno: (memory) -128 Timestamp: 0x00000001 Job Timestamp: 0x0000005c Schedule State: 0x241 Flags: 0x0 Acked-by: Lionel Landwerlin Reviewed-by: Carlos Santa Signed-off-by: José Roberto de Souza Part-of: --- src/intel/tools/aubinator_error_decode_xe.c | 3 +++ src/intel/tools/error2hangdump_xe.c | 18 ++++++------------ src/intel/tools/error_decode_xe_lib.c | 10 ++++++++++ src/intel/tools/error_decode_xe_lib.h | 2 ++ 4 files changed, 21 insertions(+), 12 deletions(-) diff --git a/src/intel/tools/aubinator_error_decode_xe.c b/src/intel/tools/aubinator_error_decode_xe.c index 13028af72cf..df8901ab1c2 100644 --- a/src/intel/tools/aubinator_error_decode_xe.c +++ b/src/intel/tools/aubinator_error_decode_xe.c @@ -257,6 +257,9 @@ read_xe_data_file(FILE *file, case XE_VM_TOPIC_TYPE_ERROR: printf("HWCTX not present in dump, content will be zeroed: %s\n", line); break; + case XE_VM_TOPIC_TYPE_REPLAY_OFFSET: + case XE_VM_TOPIC_TYPE_REPLAY_LENGTH: + break; default: printf("Not expected line in HWCTX: %s", line); } diff --git a/src/intel/tools/error2hangdump_xe.c b/src/intel/tools/error2hangdump_xe.c index a898400057a..017fa0a57be 100644 --- a/src/intel/tools/error2hangdump_xe.c +++ b/src/intel/tools/error2hangdump_xe.c @@ -61,18 +61,6 @@ read_xe_data_file(FILE *dump_file, FILE *hang_dump_file, bool verbose) const char *value_ptr; char binary_name[64]; - uint64_t u64_value; - - if (error_decode_xe_read_u64_hexacimal_parameter(line, "[HWCTX].replay_offset", &u64_value)) { - error_decode_xe_vm_hw_ctx_set_offset(&xe_vm, u64_value); - break; - } - - if (error_decode_xe_read_u64_hexacimal_parameter(line, "[HWCTX].replay_length", &u64_value)) { - /* replay_length is implicitly contained in size, so we don't need to save it */ - break; - } - if (error_decode_xe_binary_line(line, binary_name, sizeof(binary_name), &type, &value_ptr)) { if (strncmp(binary_name, "HWCTX", strlen("HWCTX")) != 0) break; @@ -96,6 +84,12 @@ read_xe_data_file(FILE *dump_file, FILE *hang_dump_file, bool verbose) case XE_VM_TOPIC_TYPE_ERROR: printf("HWCTX not present in dump, content will be zeroed: %s\n", line); break; + case XE_VM_TOPIC_TYPE_REPLAY_OFFSET: + error_decode_xe_vm_hw_ctx_set_offset(&xe_vm, strtoul(value_ptr, NULL, 0)); + break; + case XE_VM_TOPIC_TYPE_REPLAY_LENGTH: + /* replay_length is implicitly contained in size, so we don't need to save it */ + break; default: printf("Not expected line in HWCTX: %s", line); } diff --git a/src/intel/tools/error_decode_xe_lib.c b/src/intel/tools/error_decode_xe_lib.c index aaa13ac6e9b..bae210f3278 100644 --- a/src/intel/tools/error_decode_xe_lib.c +++ b/src/intel/tools/error_decode_xe_lib.c @@ -11,6 +11,7 @@ #include "error_decode_lib.h" #include "intel/common/intel_gem.h" #include "util/macros.h" +#include "util/compiler.h" static const char * read_parameter_helper(const char *line, const char *parameter) @@ -289,6 +290,15 @@ error_decode_xe_binary_line(const char *line, char *name, int name_len, enum xe_ case 'l': *type = XE_VM_TOPIC_TYPE_LENGTH; break; + case 'r': + if (strncmp(c, "replay_offset", strlen("replay_offset")) == 0) { + *type = XE_VM_TOPIC_TYPE_REPLAY_OFFSET; + break; + } else if (strncmp(c, "replay_length", strlen("replay_length")) == 0) { + *type = XE_VM_TOPIC_TYPE_REPLAY_LENGTH; + break; + } + FALLTHROUGH; default: printf("type char: %c\n", *line); return false; diff --git a/src/intel/tools/error_decode_xe_lib.h b/src/intel/tools/error_decode_xe_lib.h index 018fd5a888e..6e1376e6f96 100644 --- a/src/intel/tools/error_decode_xe_lib.h +++ b/src/intel/tools/error_decode_xe_lib.h @@ -25,6 +25,8 @@ enum xe_vm_topic_type { XE_VM_TOPIC_TYPE_LENGTH, XE_VM_TOPIC_TYPE_DATA, XE_VM_TOPIC_TYPE_PROPERTY, + XE_VM_TOPIC_TYPE_REPLAY_OFFSET, + XE_VM_TOPIC_TYPE_REPLAY_LENGTH, XE_VM_TOPIC_TYPE_ERROR, };