mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-18 15:58:06 +02:00
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>
70 lines
1.4 KiB
C
70 lines
1.4 KiB
C
/*
|
|
* Copyright 2024 Intel Corporation
|
|
* SPDX-License-Identifier: MIT
|
|
*/
|
|
|
|
#include "error2hangdump_lib.h"
|
|
|
|
#include "common/intel_hang_dump.h"
|
|
|
|
void
|
|
write_header(FILE *f)
|
|
{
|
|
struct intel_hang_dump_block_header header = {
|
|
.base = {
|
|
.type = INTEL_HANG_DUMP_BLOCK_TYPE_HEADER,
|
|
},
|
|
.magic = INTEL_HANG_DUMP_MAGIC,
|
|
.version = INTEL_HANG_DUMP_VERSION,
|
|
};
|
|
|
|
fwrite(&header, sizeof(header), 1, f);
|
|
}
|
|
|
|
void
|
|
write_buffer(FILE *f,
|
|
uint64_t offset,
|
|
const void *data,
|
|
uint64_t size,
|
|
const char *name)
|
|
{
|
|
struct intel_hang_dump_block_bo header = {
|
|
.base = {
|
|
.type = INTEL_HANG_DUMP_BLOCK_TYPE_BO,
|
|
},
|
|
.offset = offset,
|
|
.size = size,
|
|
};
|
|
snprintf(header.name, sizeof(header.name), "%s", name);
|
|
|
|
fwrite(&header, sizeof(header), 1, f);
|
|
fwrite(data, size, 1, f);
|
|
}
|
|
|
|
void
|
|
write_hw_image_buffer(FILE *f, const void *data, uint64_t size, uint64_t offset)
|
|
{
|
|
struct intel_hang_dump_block_hw_image header = {
|
|
.base = {
|
|
.type = INTEL_HANG_DUMP_BLOCK_TYPE_HW_IMAGE,
|
|
},
|
|
.size = size,
|
|
.offset = offset,
|
|
};
|
|
|
|
fwrite(&header, sizeof(header), 1, f);
|
|
fwrite(data, size, 1, f);
|
|
}
|
|
|
|
void
|
|
write_exec(FILE *f, uint64_t offset)
|
|
{
|
|
struct intel_hang_dump_block_exec header = {
|
|
.base = {
|
|
.type = INTEL_HANG_DUMP_BLOCK_TYPE_EXEC,
|
|
},
|
|
.offset = offset,
|
|
};
|
|
|
|
fwrite(&header, sizeof(header), 1, f);
|
|
}
|