[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1431351983-27080-1-git-send-email-namhyung@kernel.org>
Date: Mon, 11 May 2015 22:46:23 +0900
From: Namhyung Kim <namhyung@...nel.org>
To: Arnaldo Carvalho de Melo <acme@...nel.org>
Cc: Ingo Molnar <mingo@...nel.org>,
Peter Zijlstra <a.p.zijlstra@...llo.nl>,
Jiri Olsa <jolsa@...hat.com>,
LKML <linux-kernel@...r.kernel.org>,
David Ahern <dsahern@...il.com>
Subject: [PATCH 4/3] perf report: Show error message for incompatible UI request
Currently --header, --header-only and --threads/-T options are supported
on stdio mode only. Show warning if user passes one of --tui or --gtk
option with these like below:
$ perf report -T --tui
Error: --threads option cannot be used with --tui
usage: perf report [<options>]
-T, --threads Show per-thread event counters
--tui Use the TUI interface
Requested-by: Arnaldo Carvalho de Melo <acme@...nel.org>
Signed-off-by: Namhyung Kim <namhyung@...nel.org>
---
tools/perf/builtin-report.c | 17 ++++++++++++++++-
1 file changed, 16 insertions(+), 1 deletion(-)
diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
index 08a4246d6b62..6ac2c7a01a63 100644
--- a/tools/perf/builtin-report.c
+++ b/tools/perf/builtin-report.c
@@ -815,9 +815,24 @@ repeat:
}
/* Force tty output for header output and per-thread stat. */
- if (report.header || report.header_only || report.show_threads)
+ if (report.header || report.header_only || report.show_threads) {
use_browser = 0;
+ if (report.use_tui || report.use_gtk) {
+ pr_err("Error: %s option cannot be used with %s\n",
+ report.header_only ? "--header-only" :
+ report.header ? "--header" : "--threads",
+ report.use_tui ? "--tui" : "--gtk");
+
+ parse_options_usage(report_usage, options,
+ report.header_only ? "header-only" :
+ report.header ? "header": "threads", 0);
+ parse_options_usage(NULL, options,
+ report.use_tui ? "tui" : "gtk", 0);
+ goto error;
+ }
+ }
+
if (strcmp(input_name, "-") != 0)
setup_browser(true);
else
--
2.4.0
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists