perf ui stdio: Add way to setup the color output mode selection
authorArnaldo Carvalho de Melo <acme@redhat.com>
Tue, 5 Jul 2016 14:05:24 +0000 (11:05 -0300)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Tue, 12 Jul 2016 03:00:39 +0000 (00:00 -0300)
commitc09615f29c70d4155986f55097a99ad8f2036ca1
treeff31479eaec303414f454c81a24c14b125d24708
parenta5051979f533afc65112cc42a20f25db08bf2272
perf ui stdio: Add way to setup the color output mode selection

In --stdio we turn off color output when the output is not a tty,
which is not always desirable, for instance, in:

  perf annotate | more

the 'more' tool is perfectly capable of processing the escape sequences
for colored output.

Allow using the existing logic for .perfconfig's "color.ui" to be used
from the command line by providing a stdio__config_color() helper, that
will be used by annotate and report in follow up patches.

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/n/tip-1u4wjdbcc41dxndsb4klpa9y@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/ui/setup.c
tools/perf/ui/ui.h