[Mesa-dev] [PATCH 1/3] trace: allow GALLIUM_TRACE=stdout/stderr

Brian Paul brianp at vmware.com
Thu Jan 31 07:41:27 PST 2013


---
 src/gallium/drivers/trace/tr_dump.c |   14 +++++++++++---
 1 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/src/gallium/drivers/trace/tr_dump.c b/src/gallium/drivers/trace/tr_dump.c
index 90befb0..0714e9a 100644
--- a/src/gallium/drivers/trace/tr_dump.c
+++ b/src/gallium/drivers/trace/tr_dump.c
@@ -244,9 +244,17 @@ boolean trace_dump_trace_begin()
 
    if(!stream) {
 
-      stream = fopen(filename, "wt");
-      if(!stream)
-         return FALSE;
+      if (strcmp(filename, "stderr") == 0) {
+         stream = stderr;
+      }
+      else if (strcmp(filename, "stdout") == 0) {
+         stream = stdout;
+      }
+      else {
+         stream = fopen(filename, "wt");
+         if (!stream)
+            return FALSE;
+      }
 
       trace_dump_writes("<?xml version='1.0' encoding='UTF-8'?>\n");
       trace_dump_writes("<?xml-stylesheet type='text/xsl' href='trace.xsl'?>\n");
-- 
1.7.3.4



More information about the mesa-dev mailing list