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

Chris Wilson
2019-02-08T12:14:51Z

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