static boolean close_stream = FALSE;
static FILE *stream = NULL;
-static unsigned refcount = 0;
pipe_static_mutex(call_mutex);
static long unsigned call_no = 0;
static boolean dumping = FALSE;
close_stream = FALSE;
stream = NULL;
}
- refcount = 0;
call_no = 0;
}
}
trace_dump_writes("<?xml-stylesheet type='text/xsl' href='trace.xsl'?>\n");
trace_dump_writes("<trace version='0.1'>\n");
-#if defined(PIPE_OS_LINUX) || defined(PIPE_OS_BSD) || defined(PIPE_OS_SOLARIS) || defined(PIPE_OS_APPLE)
- /* Linux applications rarely cleanup GL / Gallium resources so catch
- * application exit here */
+ /* Many applications don't exit cleanly, others may create and destroy a
+ * screen multiple times, so we only write </trace> tag and close at exit
+ * time.
+ */
atexit(trace_dump_trace_close);
-#endif
}
- ++refcount;
-
return TRUE;
}
return stream ? TRUE : FALSE;
}
-void trace_dump_trace_end(void)
-{
- if(stream)
- if(!--refcount)
- trace_dump_trace_close();
-}
-
/*
* Call lock
*/
boolean trace_dump_trace_begin(void);
boolean trace_dump_trace_enabled(void);
void trace_dump_trace_flush(void);
-void trace_dump_trace_end(void);
/*
* Lock and unlock the call mutex.
trace_dump_call_begin("pipe_screen", "destroy");
trace_dump_arg(ptr, screen);
trace_dump_call_end();
- trace_dump_trace_end();
screen->destroy(screen);
error2:
trace_dump_ret(ptr, screen);
trace_dump_call_end();
- trace_dump_trace_end();
error1:
return screen;
}