aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNamhyung Kim <namhyung.kim@lge.com>2013-11-01 03:33:12 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2013-11-04 10:54:32 -0500
commit4bceffbc26fab2444742db59c6f8124c29e41369 (patch)
tree9ffed85ec540f698d9355d7642f5948e4f337106
parentac6976255076d4bf761abfbecb19d46af5b88046 (diff)
perf report: Postpone setting up browser after parsing options
If setup_browser() called earlier than option parsing, the actual error message can be discarded during the terminal reset. So move it after setup_sorting() checks whether the sort keys are valid. Signed-off-by: Namhyung Kim <namhyung@kernel.org> Acked-by: Ingo Molnar <mingo@kernel.org> Reviewed-by: Ingo Molnar <mingo@kernel.org> Enthusiastically-Supported-by: Ingo Molnar <mingo@kernel.org> Cc: David Ahern <dsahern@gmail.com> Cc: Ingo Molnar <mingo@kernel.org> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Link: http://lkml.kernel.org/r/1383291195-24386-3-git-send-email-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
-rw-r--r--tools/perf/builtin-report.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
index 98d3891392e2..4df3161c7df2 100644
--- a/tools/perf/builtin-report.c
+++ b/tools/perf/builtin-report.c
@@ -905,13 +905,6 @@ int cmd_report(int argc, const char **argv, const char *prefix __maybe_unused)
905 input_name = "perf.data"; 905 input_name = "perf.data";
906 } 906 }
907 907
908 if (strcmp(input_name, "-") != 0)
909 setup_browser(true);
910 else {
911 use_browser = 0;
912 perf_hpp__init();
913 }
914
915 file.path = input_name; 908 file.path = input_name;
916 file.force = report.force; 909 file.force = report.force;
917 910
@@ -957,6 +950,18 @@ repeat:
957 if (setup_sorting() < 0) 950 if (setup_sorting() < 0)
958 usage_with_options(report_usage, options); 951 usage_with_options(report_usage, options);
959 952
953 if (parent_pattern != default_parent_pattern) {
954 if (sort_dimension__add("parent") < 0)
955 goto error;
956 }
957
958 if (strcmp(input_name, "-") != 0)
959 setup_browser(true);
960 else {
961 use_browser = 0;
962 perf_hpp__init();
963 }
964
960 /* 965 /*
961 * Only in the TUI browser we are doing integrated annotation, 966 * Only in the TUI browser we are doing integrated annotation,
962 * so don't allocate extra space that won't be used in the stdio 967 * so don't allocate extra space that won't be used in the stdio
@@ -986,11 +991,6 @@ repeat:
986 if (symbol__init() < 0) 991 if (symbol__init() < 0)
987 goto error; 992 goto error;
988 993
989 if (parent_pattern != default_parent_pattern) {
990 if (sort_dimension__add("parent") < 0)
991 goto error;
992 }
993
994 if (argc) { 994 if (argc) {
995 /* 995 /*
996 * Special case: if there's an argument left then assume that 996 * Special case: if there's an argument left then assume that