summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/gallium/drivers/trace/README9
-rw-r--r--src/gallium/drivers/trace/tr_dump.c7
-rw-r--r--src/gallium/drivers/trace/tr_stream.c6
-rw-r--r--src/gallium/drivers/trace/tr_stream.h3
4 files changed, 12 insertions, 13 deletions
diff --git a/src/gallium/drivers/trace/README b/src/gallium/drivers/trace/README
index 5f0ae2c641..7e98ec2454 100644
--- a/src/gallium/drivers/trace/README
+++ b/src/gallium/drivers/trace/README
@@ -8,7 +8,6 @@ To use do
ln -s libGL.so build/linux-x86-debug/gallium/winsys/xlib/libGL.so.1
export LD_LIBRARY_PATH=$PWD/build/linux-x86-debug/gallium/winsys/xlib
- export GALLIUM_TRACE=y
ensure the right libGL.so is being picked by doing
@@ -16,11 +15,11 @@ ensure the right libGL.so is being picked by doing
and then try running
- glxinfo
+ GALLIUM_TRACE=tri.trace ./progs/trivial/tri
-which should create a gallium.*.trace file, which is an XML file. You can view
-copying trace.xsl and trace.css to the same directory, and opening with a
-XSLT capable browser like Firefox or Internet Explorer.
+which should create a tri.trace file, which is an XML file. You can view copying
+trace.xsl to the same directory, and opening with a XSLT capable browser like
+Firefox or Internet Explorer.
--
Jose Fonseca <jrfonseca@tungstengraphics.com>
diff --git a/src/gallium/drivers/trace/tr_dump.c b/src/gallium/drivers/trace/tr_dump.c
index c711a56b94..ecd0d6830d 100644
--- a/src/gallium/drivers/trace/tr_dump.c
+++ b/src/gallium/drivers/trace/tr_dump.c
@@ -218,12 +218,15 @@ trace_dump_trace_close(void)
boolean trace_dump_trace_begin()
{
- if(!debug_get_bool_option("GALLIUM_TRACE", FALSE))
+ const char *filename;
+
+ filename = debug_get_option("GALLIUM_TRACE", NULL);
+ if(!filename)
return FALSE;
if(!stream) {
- stream = trace_stream_create("gallium", "trace");
+ stream = trace_stream_create(filename);
if(!stream)
return FALSE;
diff --git a/src/gallium/drivers/trace/tr_stream.c b/src/gallium/drivers/trace/tr_stream.c
index aecc1286b8..d008dbac27 100644
--- a/src/gallium/drivers/trace/tr_stream.c
+++ b/src/gallium/drivers/trace/tr_stream.c
@@ -47,18 +47,14 @@ struct trace_stream
struct trace_stream *
-trace_stream_create(const char *name, const char *ext)
+trace_stream_create(const char *filename)
{
struct trace_stream *stream;
- static unsigned file_no = 0;
- char filename[1024];
stream = CALLOC_STRUCT(trace_stream);
if(!stream)
goto error1;
- snprintf(filename, sizeof(filename), "%s.%u.%s", name, file_no, ext);
-
#if defined(PIPE_OS_LINUX)
stream->file = fopen(filename, "w");
if(!stream->file)
diff --git a/src/gallium/drivers/trace/tr_stream.h b/src/gallium/drivers/trace/tr_stream.h
index 679c4a725d..6111174d6a 100644
--- a/src/gallium/drivers/trace/tr_stream.h
+++ b/src/gallium/drivers/trace/tr_stream.h
@@ -39,11 +39,12 @@
#include "pipe/p_compiler.h"
+
struct trace_stream;
struct trace_stream *
-trace_stream_create(const char *name, const char *ext);
+trace_stream_create(const char *filename);
boolean
trace_stream_write(struct trace_stream *stream, const void *data, size_t size);