mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-04 22:49:13 +02:00
trace: Add initializer for static variables
This commit is contained in:
parent
6900046aad
commit
8ae52413c7
3 changed files with 20 additions and 2 deletions
|
|
@ -62,6 +62,7 @@ static unsigned refcount = 0;
|
|||
static pipe_mutex call_mutex;
|
||||
static long unsigned call_no = 0;
|
||||
static boolean dumping = FALSE;
|
||||
static boolean initialized = FALSE;
|
||||
|
||||
|
||||
static INLINE void
|
||||
|
|
@ -227,10 +228,22 @@ trace_dump_trace_close(void)
|
|||
}
|
||||
}
|
||||
|
||||
void trace_dump_init()
|
||||
{
|
||||
if (initialized)
|
||||
return;
|
||||
|
||||
pipe_mutex_init(call_mutex);
|
||||
dumping = FALSE;
|
||||
initialized = TRUE;
|
||||
}
|
||||
|
||||
boolean trace_dump_trace_begin()
|
||||
{
|
||||
const char *filename;
|
||||
|
||||
assert(initialized);
|
||||
|
||||
filename = debug_get_option("GALLIUM_TRACE", NULL);
|
||||
if(!filename)
|
||||
return FALSE;
|
||||
|
|
@ -241,8 +254,6 @@ boolean trace_dump_trace_begin()
|
|||
if(!stream)
|
||||
return FALSE;
|
||||
|
||||
pipe_mutex_init(call_mutex);
|
||||
|
||||
trace_dump_writes("<?xml version='1.0' encoding='UTF-8'?>\n");
|
||||
trace_dump_writes("<?xml-stylesheet type='text/xsl' href='trace.xsl'?>\n");
|
||||
trace_dump_writes("<trace version='0.1'>\n");
|
||||
|
|
|
|||
|
|
@ -42,6 +42,11 @@ struct pipe_texture;
|
|||
struct pipe_surface;
|
||||
struct pipe_transfer;
|
||||
|
||||
/*
|
||||
* Call before use.
|
||||
*/
|
||||
void trace_dump_init(void);
|
||||
|
||||
/*
|
||||
* Low level dumping controls.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -840,6 +840,8 @@ trace_screen_create(struct pipe_screen *screen)
|
|||
if(!screen)
|
||||
goto error1;
|
||||
|
||||
trace_dump_init();
|
||||
|
||||
if(!trace_dump_trace_begin())
|
||||
goto error1;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue