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

Jose Fonseca jfonseca at vmware.com
Thu Jan 31 08:00:34 PST 2013


I haven't got patch 3/3 but 1-2 look good. Below is a good idea.

(Of course, if would be even nicer if we redirected output to src/gallium/tools/trace/dump.py via pipe/fdopen but that's quite hard to do in a cross platform fashion)

----- Original Message -----
> ---
>  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
> 
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
> 


More information about the mesa-dev mailing list