From 341d0fcbf6951e81e9acff7a25979a716662fa94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Roberto=20de=20Souza?= Date: Wed, 17 Jan 2024 09:32:18 -0800 Subject: [PATCH] intel/tools/error_decode: Detect and split error dump file parsing by KMD MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewed-by: Lionel Landwerlin Signed-off-by: José Roberto de Souza Part-of: --- src/intel/tools/aubinator_error_decode.c | 16 ++++++++++++++-- src/intel/tools/aubinator_error_decode_xe.c | 11 +++++++++++ src/intel/tools/aubinator_error_decode_xe.h | 10 ++++++++++ src/intel/tools/meson.build | 4 +++- 4 files changed, 38 insertions(+), 3 deletions(-) create mode 100644 src/intel/tools/aubinator_error_decode_xe.c create mode 100644 src/intel/tools/aubinator_error_decode_xe.h diff --git a/src/intel/tools/aubinator_error_decode.c b/src/intel/tools/aubinator_error_decode.c index efbb240f7a1..a1a1544f10c 100644 --- a/src/intel/tools/aubinator_error_decode.c +++ b/src/intel/tools/aubinator_error_decode.c @@ -38,6 +38,7 @@ #include #include +#include "aubinator_error_decode_xe.h" #include "compiler/brw_compiler.h" #include "decoder/intel_decoder.h" #include "dev/intel_debug.h" @@ -45,6 +46,8 @@ #define MIN(a, b) ((a) < (b) ? (a) : (b)) +#define XE_KMD_ERROR_DUMP_IDENTIFIER "**** Xe Device Coredump ****" + /* options */ static bool option_full_decode = true; @@ -427,7 +430,7 @@ dump_shader_binary(void *user_data, const char *short_name, } static void -read_data_file(FILE *file) +read_i915_data_file(FILE *file) { struct intel_spec *spec = NULL; long long unsigned fence; @@ -901,6 +904,9 @@ main(int argc, char *argv[]) FILE *file; int c, i; bool help = false, pager = true; + char *line = NULL; + size_t line_size; + const struct option aubinator_opts[] = { { "help", no_argument, (int *) &help, true }, { "no-pager", no_argument, (int *) &pager, false }, @@ -987,7 +993,13 @@ main(int argc, char *argv[]) if (isatty(1) && pager) setup_pager(); - read_data_file(file); + 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); + else + read_i915_data_file(file); + free(line); fclose(file); /* close the stdout which is opened to write the output */ diff --git a/src/intel/tools/aubinator_error_decode_xe.c b/src/intel/tools/aubinator_error_decode_xe.c new file mode 100644 index 00000000000..6ea0b273bd4 --- /dev/null +++ b/src/intel/tools/aubinator_error_decode_xe.c @@ -0,0 +1,11 @@ +/* + * Copyright 2024 Intel Corporation + * SPDX-License-Identifier: MIT + */ + +#include "aubinator_error_decode_xe.h" + +void +read_xe_data_file(FILE *file) +{ +} diff --git a/src/intel/tools/aubinator_error_decode_xe.h b/src/intel/tools/aubinator_error_decode_xe.h new file mode 100644 index 00000000000..9fd35d860d3 --- /dev/null +++ b/src/intel/tools/aubinator_error_decode_xe.h @@ -0,0 +1,10 @@ +/* + * Copyright 2024 Intel Corporation + * SPDX-License-Identifier: MIT + */ + +#pragma once + +#include + +void read_xe_data_file(FILE *file); diff --git a/src/intel/tools/meson.build b/src/intel/tools/meson.build index ef5b4ac17bd..24981d6005a 100644 --- a/src/intel/tools/meson.build +++ b/src/intel/tools/meson.build @@ -42,7 +42,9 @@ aubinator = executable( aubinator_error_decode = executable( 'aubinator_error_decode', - files('aubinator_error_decode.c'), + files('aubinator_error_decode.c', + 'aubinator_error_decode_xe.c', + 'aubinator_error_decode_xe.h'), dependencies : [idep_mesautil, dep_zlib, dep_thread, idep_intel_dev, idep_intel_decoder], include_directories : [inc_include, inc_src, inc_intel], link_with : [libintel_common, libintel_compiler],