trace: allow GALLIUM_TRACE=stdout/stderr
authorBrian Paul <brianp@vmware.com>
Tue, 29 Jan 2013 23:48:25 +0000 (16:48 -0700)
committerBrian Paul <brianp@vmware.com>
Fri, 1 Feb 2013 15:00:28 +0000 (08:00 -0700)
src/gallium/drivers/trace/tr_dump.c

index 90befb09b6bb2719b4a7ea4168a19f8270977005..0714e9a3860d8a7d268568d768e481b51d806141 100644 (file)
@@ -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");