intel/tools/error_decode: Fix parsing in Xe decoder

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: 90e38bbb3b ("intel/tools/error_decode: Parse Xe KMD error dump file")
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27888>
This commit is contained in:
José Roberto de Souza 2024-02-28 11:36:54 -08:00 committed by Marge Bot
parent 477943cc9d
commit 171eb89b75

View file

@ -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;