radv: replace RADV_TRACE_FILE by RADV_DEBUG=hang
The trace file will be dumped as part of the hang report into $HOME/radv_dumps_<pid>/trace.log if a GPU hang is detected. The old and famous RADV_TRACE_FILE envvar is now deprecated. Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7233>
This commit is contained in:

committed by
Marge Bot

parent
9516f9369e
commit
33c9d4bf31
@@ -83,19 +83,10 @@ radv_init_trace(struct radv_device *device)
|
||||
}
|
||||
|
||||
static void
|
||||
radv_dump_trace(struct radv_device *device, struct radeon_cmdbuf *cs)
|
||||
radv_dump_trace(struct radv_device *device, struct radeon_cmdbuf *cs, FILE *f)
|
||||
{
|
||||
const char *filename = getenv("RADV_TRACE_FILE");
|
||||
FILE *f = fopen(filename, "w");
|
||||
|
||||
if (!f) {
|
||||
fprintf(stderr, "Failed to write trace dump to %s\n", filename);
|
||||
return;
|
||||
}
|
||||
|
||||
fprintf(f, "Trace ID: %x\n", *device->trace_id_ptr);
|
||||
device->ws->cs_dump(cs, f, (const int*)device->trace_id_ptr, 2);
|
||||
fclose(f);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -625,8 +616,6 @@ radv_check_gpu_hangs(struct radv_queue *queue, struct radeon_cmdbuf *cs)
|
||||
|
||||
fprintf(stderr, "radv: GPU hang detected...\n");
|
||||
|
||||
radv_dump_trace(queue->device, cs);
|
||||
|
||||
/* Create a directory into $HOME/radv_dumps_<pid> to save various
|
||||
* debugging info about that GPU hang.
|
||||
*/
|
||||
@@ -638,6 +627,14 @@ radv_check_gpu_hangs(struct radv_queue *queue, struct radeon_cmdbuf *cs)
|
||||
abort();
|
||||
}
|
||||
|
||||
/* Dump trace file. */
|
||||
snprintf(dump_path, sizeof(dump_path), "%s/%s", dump_dir, "trace.log");
|
||||
f = fopen(dump_path, "w+");
|
||||
if (f) {
|
||||
radv_dump_trace(queue->device, cs, f);
|
||||
fclose(f);
|
||||
}
|
||||
|
||||
/* Dump pipeline state. */
|
||||
snprintf(dump_path, sizeof(dump_path), "%s/%s", dump_dir, "pipeline.log");
|
||||
f = fopen(dump_path, "w+");
|
||||
|
Reference in New Issue
Block a user