From 1bd6a2efe1503624cadae746edcaa40ddfce2858 Mon Sep 17 00:00:00 2001 From: Lucas De Marchi Date: Wed, 22 Jan 2025 20:59:29 -0800 Subject: [PATCH] intel/tools: Fix Xe KMD error dump parser MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Xe KMD originally put the exec queue snapshot in the wrong topic, XE_TOPIC_GUC_CT. Add it to the right one while still keeping a fallback to the previous place so the new version of the tool is able to parse both before and after the kernel change. Based on previous version by José Roberto de Souza at https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32617 Cc: stable Acked-by: Lionel Landwerlin Reviewed-by: José Roberto de Souza Signed-off-by: Lucas De Marchi Part-of: --- src/intel/tools/aubinator_error_decode_xe.c | 7 ++++++- src/intel/tools/error2hangdump_xe.c | 7 ++++++- src/intel/tools/error_decode_xe_lib.c | 1 + src/intel/tools/error_decode_xe_lib.h | 1 + 4 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/intel/tools/aubinator_error_decode_xe.c b/src/intel/tools/aubinator_error_decode_xe.c index dd0a774cc8e..25a81d53473 100644 --- a/src/intel/tools/aubinator_error_decode_xe.c +++ b/src/intel/tools/aubinator_error_decode_xe.c @@ -219,7 +219,12 @@ read_xe_data_file(FILE *file, break; } - case XE_TOPIC_GUC_CT: { + case XE_TOPIC_GUC_CT: + /* + * Workaround bug in the kernel that would put the exec queue dump + * in the wrong place, under "GuC CT" topic. + */ + case XE_TOPIC_CONTEXT: { enum xe_vm_topic_type type; const char *value_ptr; bool is_hw_ctx; diff --git a/src/intel/tools/error2hangdump_xe.c b/src/intel/tools/error2hangdump_xe.c index 78e0866e7d8..82af68ca471 100644 --- a/src/intel/tools/error2hangdump_xe.c +++ b/src/intel/tools/error2hangdump_xe.c @@ -48,7 +48,12 @@ read_xe_data_file(FILE *dump_file, FILE *hang_dump_file, bool verbose) break; } - case XE_TOPIC_GUC_CT: { + case XE_TOPIC_GUC_CT: + /* + * Workaround bug in the kernel that would put the exec queue dump + * in the wrong place, under "GuC CT" topic. + */ + case XE_TOPIC_CONTEXT: { enum xe_vm_topic_type type; const char *value_ptr; bool is_hw_ctx; diff --git a/src/intel/tools/error_decode_xe_lib.c b/src/intel/tools/error_decode_xe_lib.c index ff8527a73f3..d4e43d45b12 100644 --- a/src/intel/tools/error_decode_xe_lib.c +++ b/src/intel/tools/error_decode_xe_lib.c @@ -79,6 +79,7 @@ error_decode_xe_decode_topic(const char *line, enum xe_topic *new_topic) "**** Job ****", "**** HW Engines ****", "**** VM state ****", + "**** Contexts ****", }; bool topic_changed = false; diff --git a/src/intel/tools/error_decode_xe_lib.h b/src/intel/tools/error_decode_xe_lib.h index 9a658d991bb..a67a245ad3c 100644 --- a/src/intel/tools/error_decode_xe_lib.h +++ b/src/intel/tools/error_decode_xe_lib.h @@ -14,6 +14,7 @@ enum xe_topic { XE_TOPIC_JOB, XE_TOPIC_HW_ENGINES, XE_TOPIC_VM, + XE_TOPIC_CONTEXT, XE_TOPIC_INVALID, };