diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2010-08-21 09:38:16 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2010-08-21 09:49:46 -0400 |
commit | 8b9e74eb8af808807192d16b76565c27154ae7ed (patch) | |
tree | 699863e988c6b373402f473298529715cce35fdf /tools/perf/builtin-report.c | |
parent | ed8052616680e72f58bca678d4d1678cb12a7e47 (diff) |
perf tools: Add --tui and --stdio to choose the UI
Relying just on ~/.perfconfig or rebuilding the tool disabling support
for the TUI is too cumbersome, so allow specifying which UI to use and
make the command line switch override whatever is in ~/.perfconfig.
Suggested-by: Christoph Hellwig <hch@infradead.org>
Cc: Christoph Hellwig <hch@infradead.org>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
LKML-Reference: <new-submission>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/builtin-report.c')
-rw-r--r-- | tools/perf/builtin-report.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c index 55fc1f46892a..7d35a719c950 100644 --- a/tools/perf/builtin-report.c +++ b/tools/perf/builtin-report.c | |||
@@ -32,7 +32,7 @@ | |||
32 | 32 | ||
33 | static char const *input_name = "perf.data"; | 33 | static char const *input_name = "perf.data"; |
34 | 34 | ||
35 | static bool force; | 35 | static bool force, use_tui, use_stdio; |
36 | static bool hide_unresolved; | 36 | static bool hide_unresolved; |
37 | static bool dont_use_callchains; | 37 | static bool dont_use_callchains; |
38 | 38 | ||
@@ -450,6 +450,8 @@ static const struct option options[] = { | |||
450 | "Show per-thread event counters"), | 450 | "Show per-thread event counters"), |
451 | OPT_STRING(0, "pretty", &pretty_printing_style, "key", | 451 | OPT_STRING(0, "pretty", &pretty_printing_style, "key", |
452 | "pretty printing style key: normal raw"), | 452 | "pretty printing style key: normal raw"), |
453 | OPT_BOOLEAN(0, "tui", &use_tui, "Use the TUI interface"), | ||
454 | OPT_BOOLEAN(0, "stdio", &use_stdio, "Use the stdio interface"), | ||
453 | OPT_STRING('s', "sort", &sort_order, "key[,key2...]", | 455 | OPT_STRING('s', "sort", &sort_order, "key[,key2...]", |
454 | "sort by key(s): pid, comm, dso, symbol, parent"), | 456 | "sort by key(s): pid, comm, dso, symbol, parent"), |
455 | OPT_BOOLEAN(0, "showcpuutilization", &symbol_conf.show_cpu_utilization, | 457 | OPT_BOOLEAN(0, "showcpuutilization", &symbol_conf.show_cpu_utilization, |
@@ -482,8 +484,15 @@ int cmd_report(int argc, const char **argv, const char *prefix __used) | |||
482 | { | 484 | { |
483 | argc = parse_options(argc, argv, options, report_usage, 0); | 485 | argc = parse_options(argc, argv, options, report_usage, 0); |
484 | 486 | ||
487 | if (use_stdio) | ||
488 | use_browser = 0; | ||
489 | else if (use_tui) | ||
490 | use_browser = 1; | ||
491 | |||
485 | if (strcmp(input_name, "-") != 0) | 492 | if (strcmp(input_name, "-") != 0) |
486 | setup_browser(); | 493 | setup_browser(); |
494 | else | ||
495 | use_browser = 0; | ||
487 | /* | 496 | /* |
488 | * Only in the newt browser we are doing integrated annotation, | 497 | * Only in the newt browser we are doing integrated annotation, |
489 | * so don't allocate extra space that won't be used in the stdio | 498 | * so don't allocate extra space that won't be used in the stdio |