[igt-dev] [IGT 2/2] tools/intel_gpu_top: Add file output capability

Chris Wilson chris at chris-wilson.co.uk
Fri Feb 8 12:14:51 UTC 2019


Quoting Tvrtko Ursulin (2019-02-08 12:03:51)
> From: Tvrtko Ursulin <tvrtko.ursulin at intel.com>
> 
> A new -o command switch enables logging to a file.
> 
> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin at intel.com>
> References: https://bugs.freedesktop.org/show_bug.cgi?id=108689
> Cc: Eero Tamminen <eero.t.tamminen at intel.com>
> Cc: 3.14pi at ukr.net
> Cc: Chris Wilson <chris at chris-wilson.co.uk>

> -       if (output_mode == INTERACTIVE && isatty(1) != 1)
> +       if (output_mode == INTERACTIVE && (output_path || isatty(1) != 1))
>                 output_mode = STDOUT;
>  
> +       if (output_path) {

if (output_path && strcmp(output_path, "-")) { ?

"-o -" is common enough for forcing output even on the terminal.

Reviewed-by: Chris Wilson <chris at chris-wilson.co.uk>
-Chris


More information about the igt-dev mailing list