summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/trace/tr_dump.c
diff options
context:
space:
mode:
authorJosé Fonseca <[email protected]>2013-04-25 14:18:33 +0100
committerJosé Fonseca <[email protected]>2013-04-25 14:18:33 +0100
commit28e6a272fc0d16b2c3c8972f8936126ebf0aa764 (patch)
treee2eaee87a000ed31e11518718fcfb5d7c4a8a59a /src/gallium/drivers/trace/tr_dump.c
parent74d1153c9c3f5f88ad3fa1819d54f5b574b2e37f (diff)
trace: Only close trace files on exit.
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.
Diffstat (limited to 'src/gallium/drivers/trace/tr_dump.c')
-rw-r--r--src/gallium/drivers/trace/tr_dump.c19
1 files changed, 4 insertions, 15 deletions
diff --git a/src/gallium/drivers/trace/tr_dump.c b/src/gallium/drivers/trace/tr_dump.c
index 826ce5bc1ba..7111e0d174d 100644
--- a/src/gallium/drivers/trace/tr_dump.c
+++ b/src/gallium/drivers/trace/tr_dump.c
@@ -59,7 +59,6 @@
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;
@@ -234,7 +233,6 @@ trace_dump_trace_close(void)
close_stream = FALSE;
stream = NULL;
}
- refcount = 0;
call_no = 0;
}
}
@@ -283,15 +281,13 @@ trace_dump_trace_begin(void)
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;
}
@@ -300,13 +296,6 @@ boolean trace_dump_trace_enabled(void)
return stream ? TRUE : FALSE;
}
-void trace_dump_trace_end(void)
-{
- if(stream)
- if(!--refcount)
- trace_dump_trace_close();
-}
-
/*
* Call lock
*/