perf top: Move UI initialization ahead of sort setup

The ui initialization changes hpp format callbacks, based on the used
browser. Thus we need this init being processed before setup_sorting.

Replica of a patch by Jiri for 'perf report'.

Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1453109064-1026-9-git-send-email-jolsa@kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 9887804d
...@@ -1245,6 +1245,13 @@ int cmd_top(int argc, const char **argv, const char *prefix __maybe_unused) ...@@ -1245,6 +1245,13 @@ int cmd_top(int argc, const char **argv, const char *prefix __maybe_unused)
/* display thread wants entries to be collapsed in a different tree */ /* display thread wants entries to be collapsed in a different tree */
sort__need_collapse = 1; sort__need_collapse = 1;
if (top.use_stdio)
use_browser = 0;
else if (top.use_tui)
use_browser = 1;
setup_browser(false);
if (setup_sorting(top.evlist) < 0) { if (setup_sorting(top.evlist) < 0) {
if (sort_order) if (sort_order)
parse_options_usage(top_usage, options, "s", 1); parse_options_usage(top_usage, options, "s", 1);
...@@ -1254,13 +1261,6 @@ int cmd_top(int argc, const char **argv, const char *prefix __maybe_unused) ...@@ -1254,13 +1261,6 @@ int cmd_top(int argc, const char **argv, const char *prefix __maybe_unused)
goto out_delete_evlist; goto out_delete_evlist;
} }
if (top.use_stdio)
use_browser = 0;
else if (top.use_tui)
use_browser = 1;
setup_browser(false);
status = target__validate(target); status = target__validate(target);
if (status) { if (status) {
target__strerror(target, status, errbuf, BUFSIZ); target__strerror(target, status, errbuf, BUFSIZ);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment