From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751165AbcGMHDk (ORCPT ); Wed, 13 Jul 2016 03:03:40 -0400 Received: from terminus.zytor.com ([198.137.202.10]:40368 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750780AbcGMHDa (ORCPT ); Wed, 13 Jul 2016 03:03:30 -0400 Date: Wed, 13 Jul 2016 00:02:56 -0700 From: tip-bot for Arnaldo Carvalho de Melo Message-ID: Cc: mingo@kernel.org, dsahern@gmail.com, adrian.hunter@intel.com, namhyung@kernel.org, acme@redhat.com, wangnan0@huawei.com, peterz@infradead.org, hpa@zytor.com, jolsa@kernel.org, tglx@linutronix.de, linux-kernel@vger.kernel.org Reply-To: adrian.hunter@intel.com, dsahern@gmail.com, mingo@kernel.org, tglx@linutronix.de, linux-kernel@vger.kernel.org, jolsa@kernel.org, peterz@infradead.org, wangnan0@huawei.com, hpa@zytor.com, namhyung@kernel.org, acme@redhat.com To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/core] perf report: Introduce --stdio-color to setup the color output mode selection Git-Commit-ID: 175b968b81ba3bef0b39618714eb23d6675a935c X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 175b968b81ba3bef0b39618714eb23d6675a935c Gitweb: http://git.kernel.org/tip/175b968b81ba3bef0b39618714eb23d6675a935c Author: Arnaldo Carvalho de Melo AuthorDate: Tue, 5 Jul 2016 11:14:38 -0300 Committer: Arnaldo Carvalho de Melo CommitDate: Tue, 12 Jul 2016 00:00:39 -0300 perf report: Introduce --stdio-color to setup the color output mode selection 'perf report --stdio' will colorize entries with most hits and possibly some other aspects of its output, but those colors gets suppressed if we redirect the output to a non-tty, allow keeping the colors by adding a new option, --stdio-color, now this use case will also output escape sequences for colors: $ perf annotate --stdio-color | more Cc: Adrian Hunter Cc: David Ahern Cc: Jiri Olsa Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Wang Nan Link: http://lkml.kernel.org/n/tip-3iuawqjldu4i8gziot7e3d5n@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/Documentation/perf-report.txt | 7 +++++++ tools/perf/builtin-report.c | 3 +++ 2 files changed, 10 insertions(+) diff --git a/tools/perf/Documentation/perf-report.txt b/tools/perf/Documentation/perf-report.txt index 9cbddc2..2d17462 100644 --- a/tools/perf/Documentation/perf-report.txt +++ b/tools/perf/Documentation/perf-report.txt @@ -265,6 +265,13 @@ OPTIONS --stdio:: Use the stdio interface. +--stdio-color:: + 'always', 'never' or 'auto', allowing configuring color output + via the command line, in addition to via "color.ui" .perfconfig. + Use '--stdio-color always' to generate color even when redirecting + to a pipe or file. Using just '--stdio-color' is equivalent to + using 'always'. + --tui:: Use the TUI interface, that is integrated with annotate and allows zooming into DSOs or threads, among other features. Use of --tui requires a tty, if one is not present, as when piping to other diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c index f6cb35798..949e5a1 100644 --- a/tools/perf/builtin-report.c +++ b/tools/perf/builtin-report.c @@ -817,6 +817,9 @@ int cmd_report(int argc, const char **argv, const char *prefix __maybe_unused) "Show raw trace event output (do not use print fmt or plugins)"), OPT_BOOLEAN(0, "hierarchy", &symbol_conf.report_hierarchy, "Show entries in a hierarchy"), + OPT_CALLBACK_DEFAULT(0, "stdio-color", NULL, "mode", + "'always' (default), 'never' or 'auto' only applicable to --stdio mode", + stdio__config_color, "always"), OPT_END() }; struct perf_data_file file = {