From 55c355c572d38aa77b401edca6db3c20d2fc7d8a Mon Sep 17 00:00:00 2001 From: Yiwei Zhang Date: Mon, 6 Oct 2025 14:11:57 -0700 Subject: [PATCH] pan/genxml: use process name to distinguish CS dumps Android has to enable dumping globally. There's no per app based env var at runtime since most apps just fork from Zygote process. So we have to add process name to the dump file name. Now with pandecode.dump as the base name, it'll be like below on Android: - pandecode.dump.com.example.VkCube.ctx-* - pandecode.dump.com.google.android.apps.nexuslauncher.ctx-* This can be generally useful on Linux as well when debugging different things to avoid accidentally touching existing dumps. Reviewed-by: Boris Brezillon Part-of: --- src/panfrost/genxml/decode_common.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/panfrost/genxml/decode_common.c b/src/panfrost/genxml/decode_common.c index 1ec07536812..bceb0ba3408 100644 --- a/src/panfrost/genxml/decode_common.c +++ b/src/panfrost/genxml/decode_common.c @@ -35,6 +35,7 @@ #include "util/macros.h" #include "util/u_debug.h" #include "util/u_hexdump.h" +#include "util/u_process.h" #include "decode.h" #include "compiler/bifrost/disassemble.h" @@ -260,8 +261,8 @@ pandecode_dump_file_open(struct pandecode_context *ctx) ctx->dump_stream = stderr; else if (!ctx->dump_stream) { char buffer[1024]; - snprintf(buffer, sizeof(buffer), "%s.ctx-%d.%04d", dump_file_base, - ctx->id, ctx->dump_frame_count); + snprintf(buffer, sizeof(buffer), "%s.%s.ctx-%d.%04d", dump_file_base, + util_get_process_name(), ctx->id, ctx->dump_frame_count); mesa_logd("pandecode: dump command stream to file %s", buffer); ctx->dump_stream = fopen(buffer, "w"); if (!ctx->dump_stream) {