perf stat: Better report failure to collect system wide stats
[firefly-linux-kernel-4.4.55.git] / tools / perf / perf.c
index 9ff186b57cb7715f5d9cfdae8e7590543038ffce..2826e702986e0da3c6fd4ce118a14454a9b2fe00 100644 (file)
@@ -16,6 +16,8 @@
 #include "util/string.h"
 #include "util/debugfs.h"
 
+bool use_browser;
+
 const char perf_usage_string[] =
        "perf [--version] [--help] COMMAND [ARGS]";
 
@@ -262,11 +264,11 @@ static int run_builtin(struct cmd_struct *p, int argc, const char **argv)
        set_debugfs_path();
 
        status = p->fn(argc, argv, prefix);
+       exit_browser(status);
+
        if (status)
                return status & 0xff;
 
-       exit_browser();
-
        /* Somebody closed stdout? */
        if (fstat(fileno(stdout), &st))
                return 0;
@@ -447,7 +449,7 @@ int main(int argc, const char **argv)
 
        /*
         * We use PATH to find perf commands, but we prepend some higher
-        * precidence paths: the "--exec-path" option, the PERF_EXEC_PATH
+        * precedence paths: the "--exec-path" option, the PERF_EXEC_PATH
         * environment, and the $(perfexecdir) from the Makefile at build
         * time.
         */