mesa/src/intel/tools/error2hangdump_lib.h
Carlos Santa c8a08c5375 intel/tools: Handle new replay properties in the Xe KMD error dump file
The changes as part of the Contexts state now include:

**** Contexts ****
[HWCTX].replay_offset: 0x0
[HWCTX].replay_length: 0xd000

and the changes as part of the VM state now include:

**** VM state ****
VM.uapi_flags: 0x1
[40000].length: 0x2000
[40000].properties: read_write|bo|mem_region=0x1|pat_index=2|cpu_caching=1
[40000].data: &-)\3!!E9mzzzzzzzzzz

In order to be able to replay a GPU hang from a devcore dump file
new properties have been added describing the offset and the length
of the affected hw context as well as a global VM flag and
several VMA property types: memory region, bo caching, pat index,
memory permission and memory type.

Signed-off-by: Carlos Santa <carlos.santa@intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34829>
2026-01-07 19:16:25 +00:00

39 lines
878 B
C

/*
* Copyright 2024 Intel Corporation
* SPDX-License-Identifier: MIT
*/
#pragma once
#include <stdarg.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
static inline void
_fail(const char *prefix, const char *format, ...)
{
va_list args;
va_start(args, format);
if (prefix)
fprintf(stderr, "%s: ", prefix);
vfprintf(stderr, format, args);
va_end(args);
abort();
}
#define _fail_if(cond, prefix, ...) do { \
if (cond) \
_fail(prefix, __VA_ARGS__); \
} while (0)
#define fail_if(cond, ...) _fail_if(cond, NULL, __VA_ARGS__)
#define fail(...) fail_if(true, __VA_ARGS__)
void write_header(FILE *f);
void write_buffer(FILE *f, uint64_t offset, const void *data, uint64_t size, const char *name);
void write_hw_image_buffer(FILE *f, const void *data, uint64_t size, uint64_t offset);
void write_exec(FILE *f, uint64_t offset);