mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-07 02:48:06 +02:00
pan/decode: Dump to a file
The file name is taken from the environment variable PANDECODE_DUMP_FILE, defaulting to pandecode.dump if it is not set. Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3525>
This commit is contained in:
parent
be22c0789f
commit
c1952779d6
2 changed files with 35 additions and 1 deletions
|
|
@ -31,6 +31,7 @@
|
||||||
|
|
||||||
#include "decode.h"
|
#include "decode.h"
|
||||||
#include "util/macros.h"
|
#include "util/macros.h"
|
||||||
|
#include "util/u_debug.h"
|
||||||
|
|
||||||
/* Memory handling */
|
/* Memory handling */
|
||||||
|
|
||||||
|
|
@ -115,9 +116,40 @@ pointer_as_memory_reference(uint64_t ptr)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
pandecode_dump_file_open(void)
|
||||||
|
{
|
||||||
|
if (pandecode_dump_stream)
|
||||||
|
return;
|
||||||
|
|
||||||
|
const char *dump_file = debug_get_option("PANDECODE_DUMP_FILE", "pandecode.dump");
|
||||||
|
|
||||||
|
printf("pandecode: dump command stream to file %s\n", dump_file);
|
||||||
|
pandecode_dump_stream = fopen(dump_file, "w");
|
||||||
|
|
||||||
|
if (!pandecode_dump_stream)
|
||||||
|
fprintf(stderr,"pandecode: failed to open command stream log file %s\n",
|
||||||
|
dump_file);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
pandecode_dump_file_close(void)
|
||||||
|
{
|
||||||
|
if (pandecode_dump_stream) {
|
||||||
|
fclose(pandecode_dump_stream);
|
||||||
|
pandecode_dump_stream = NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
pandecode_initialize(void)
|
pandecode_initialize(void)
|
||||||
{
|
{
|
||||||
list_inithead(&mmaps.node);
|
list_inithead(&mmaps.node);
|
||||||
pandecode_dump_stream = stdout;
|
pandecode_dump_file_open();
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
pandecode_close(void)
|
||||||
|
{
|
||||||
|
pandecode_dump_file_close();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -44,6 +44,8 @@
|
||||||
|
|
||||||
void pandecode_initialize(void);
|
void pandecode_initialize(void);
|
||||||
|
|
||||||
|
void pandecode_close(void);
|
||||||
|
|
||||||
void
|
void
|
||||||
pandecode_inject_mmap(uint64_t gpu_va, void *cpu, unsigned sz, const char *name);
|
pandecode_inject_mmap(uint64_t gpu_va, void *cpu, unsigned sz, const char *name);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue