Commit e8c5fe10 authored by Jiri Olsa's avatar Jiri Olsa Committed by Arnaldo Carvalho de Melo

perf c2c report: Setup browser after opening perf.data

Because of the early browser switch we won't get possible error
messages, as it will clear the screen right after showing the message,
e.g.:

Before:

   $ sudo perf c2c report -d lcl
   $

After:
   $ sudo perf c2c report -d lcl
   File perf.data not owned by current user or root (use -f to override)
   $
   $ ls -la perf.data
   -rw-------. 1 acme acme 26648 Nov 22 15:11 perf.data
   $
Signed-off-by: default avatarJiri Olsa <jolsa@redhat.com>
Tested-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Don Zickus <dzickus@redhat.com>
Cc: Joe Mario <jmario@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1479764011-10732-3-git-send-email-jolsa@kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 7b4b82bc
...@@ -2535,13 +2535,6 @@ static int perf_c2c__report(int argc, const char **argv) ...@@ -2535,13 +2535,6 @@ static int perf_c2c__report(int argc, const char **argv)
if (c2c.stats_only) if (c2c.stats_only)
c2c.use_stdio = true; c2c.use_stdio = true;
if (c2c.use_stdio)
use_browser = 0;
else
use_browser = 1;
setup_browser(false);
if (!input_name || !strlen(input_name)) if (!input_name || !strlen(input_name))
input_name = "perf.data"; input_name = "perf.data";
...@@ -2568,6 +2561,7 @@ static int perf_c2c__report(int argc, const char **argv) ...@@ -2568,6 +2561,7 @@ static int perf_c2c__report(int argc, const char **argv)
pr_debug("No memory for session\n"); pr_debug("No memory for session\n");
goto out; goto out;
} }
err = setup_nodes(session); err = setup_nodes(session);
if (err) { if (err) {
pr_err("Failed setup nodes\n"); pr_err("Failed setup nodes\n");
...@@ -2587,6 +2581,13 @@ static int perf_c2c__report(int argc, const char **argv) ...@@ -2587,6 +2581,13 @@ static int perf_c2c__report(int argc, const char **argv)
goto out_session; goto out_session;
} }
if (c2c.use_stdio)
use_browser = 0;
else
use_browser = 1;
setup_browser(false);
err = perf_session__process_events(session); err = perf_session__process_events(session);
if (err) { if (err) {
pr_err("failed to process sample\n"); pr_err("failed to process sample\n");
......
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