summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJakob Bornecrantz <[email protected]>2009-05-16 01:49:11 +0100
committerJakob Bornecrantz <[email protected]>2009-05-16 01:50:53 +0100
commitf04c38fa1fab0fe640b89d0de82fa44e2ee984a9 (patch)
tree4538ba73698f520230854ad235ae37608d9201cb /src
parentee05658798c047876ccd9e5cd33e12eee1dd8758 (diff)
trace: Export enabled status
Diffstat (limited to 'src')
-rw-r--r--src/gallium/drivers/trace/Makefile2
-rw-r--r--src/gallium/drivers/trace/tr_context.c2
-rw-r--r--src/gallium/drivers/trace/tr_screen.c23
-rw-r--r--src/gallium/drivers/trace/tr_screen.h7
4 files changed, 25 insertions, 9 deletions
diff --git a/src/gallium/drivers/trace/Makefile b/src/gallium/drivers/trace/Makefile
index 94be0bfd5a5..ecb69fb9964 100644
--- a/src/gallium/drivers/trace/Makefile
+++ b/src/gallium/drivers/trace/Makefile
@@ -8,8 +8,8 @@ C_SOURCES = \
tr_context.c \
tr_dump.c \
tr_dump_state.c \
- tr_state.c \
tr_screen.c \
+ tr_state.c \
tr_texture.c
include ../../Makefile.template
diff --git a/src/gallium/drivers/trace/tr_context.c b/src/gallium/drivers/trace/tr_context.c
index e51af2451b2..a4166285628 100644
--- a/src/gallium/drivers/trace/tr_context.c
+++ b/src/gallium/drivers/trace/tr_context.c
@@ -1124,7 +1124,7 @@ trace_context_create(struct pipe_screen *_screen,
if(!pipe)
goto error1;
- if(!trace_dump_trace_enabled())
+ if(!trace_enabled())
goto error1;
tr_scr = trace_screen(_screen);
diff --git a/src/gallium/drivers/trace/tr_screen.c b/src/gallium/drivers/trace/tr_screen.c
index 58855a83460..bc14248eebb 100644
--- a/src/gallium/drivers/trace/tr_screen.c
+++ b/src/gallium/drivers/trace/tr_screen.c
@@ -37,6 +37,8 @@
#include "pipe/p_inlines.h"
+static boolean trace = FALSE;
+
static const char *
trace_screen_get_name(struct pipe_screen *_screen)
{
@@ -820,16 +822,20 @@ trace_screen_destroy(struct pipe_screen *_screen)
struct pipe_screen *screen = tr_scr->screen;
trace_dump_call_begin("pipe_screen", "destroy");
-
trace_dump_arg(ptr, screen);
+ trace_dump_call_end();
+ trace_dump_trace_end();
screen->destroy(screen);
- trace_dump_call_end();
+ FREE(tr_scr);
+}
- trace_dump_trace_end();
- FREE(tr_scr);
+boolean
+trace_enabled(void)
+{
+ return trace;
}
@@ -844,10 +850,13 @@ trace_screen_create(struct pipe_screen *screen)
trace_dump_init();
- if(!trace_dump_trace_begin())
- goto error1;
+ if(trace_dump_trace_begin()) {
+ trace_dumping_start();
+ trace = TRUE;
+ }
- trace_dumping_start();
+ if (!trace)
+ goto error1;
trace_dump_call_begin("", "pipe_screen_create");
diff --git a/src/gallium/drivers/trace/tr_screen.h b/src/gallium/drivers/trace/tr_screen.h
index 59f254166d4..7fae1829858 100644
--- a/src/gallium/drivers/trace/tr_screen.h
+++ b/src/gallium/drivers/trace/tr_screen.h
@@ -71,6 +71,13 @@ struct trace_screen
};
+/*
+ * tr_screen.c
+ */
+
+boolean
+trace_enabled(void);
+
struct trace_screen *
trace_screen(struct pipe_screen *screen);