From 171eb89b75d3bd61b3450a6ac10c1599ecd929e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Roberto=20de=20Souza?= Date: Wed, 28 Feb 2024 11:36:54 -0800 Subject: [PATCH] intel/tools/error_decode: Fix parsing in Xe decoder MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit xe_topic can't be inside of the for loop otherwise it will be set to TOPIC_INVALID at every iteration. TOPIC_INVALID was added after it was reviewed by Lionel because CI complained that xe_topic may be not initialized, turns out leaving it not initialized was causing the xe_topic value to keep the value set in the previous interation makeing the parser to work by luck. Fixes: 90e38bbb3b57 ("intel/tools/error_decode: Parse Xe KMD error dump file") Signed-off-by: José Roberto de Souza Reviewed-by: Lionel Landwerlin Part-of: --- src/intel/tools/aubinator_error_decode_xe.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/intel/tools/aubinator_error_decode_xe.c b/src/intel/tools/aubinator_error_decode_xe.c index 800306fde63..13c0e39b67b 100644 --- a/src/intel/tools/aubinator_error_decode_xe.c +++ b/src/intel/tools/aubinator_error_decode_xe.c @@ -257,6 +257,14 @@ read_xe_data_file(FILE *file, struct xe_vm xe_vm; char *line = NULL; size_t line_size; + enum { + TOPIC_DEVICE = 0, + TOPIC_GUC_CT, + TOPIC_JOB, + TOPIC_HW_ENGINES, + TOPIC_VM, + TOPIC_INVALID, + } xe_topic = TOPIC_INVALID; xe_vm_init(&xe_vm); @@ -268,14 +276,6 @@ read_xe_data_file(FILE *file, "**** HW Engines ****", "**** VM state ****", }; - enum { - TOPIC_DEVICE = 0, - TOPIC_GUC_CT, - TOPIC_JOB, - TOPIC_HW_ENGINES, - TOPIC_VM, - TOPIC_INVALID, - } xe_topic = TOPIC_INVALID; bool topic_changed = false; bool print_line = true;