summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYabin Cui <yabinc@google.com>2018-02-24 00:00:54 +0000
committerandroid-build-merger <android-build-merger@google.com>2018-02-24 00:00:54 +0000
commit455bdd3ae707763d3b13a4fc1e6d91d781bc5ce1 (patch)
tree60aa31d92ecfe1f0e98cce4e167525765f1ebddc
parentdc3119769017916abed2787045b6c297b8e39402 (diff)
parent0e995e4fb487f47edf404b438456dd5385b8fe7e (diff)
downloadextras-455bdd3ae707763d3b13a4fc1e6d91d781bc5ce1.tar.gz
Merge "simpleperf: use quick_exit." am: aa6d306692 am: 888a6f522e
am: 0e995e4fb4 Change-Id: I5910ee1d1c2ce870432bbe2a9a6f6ab78759c45e
-rw-r--r--simpleperf/command.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/simpleperf/command.cpp b/simpleperf/command.cpp
index 3d6c2d2c..314b9bc8 100644
--- a/simpleperf/command.cpp
+++ b/simpleperf/command.cpp
@@ -22,6 +22,7 @@
#include <vector>
#include <android-base/logging.h>
+#include <android-base/quick_exit.h>
#include "utils.h"
@@ -150,5 +151,7 @@ bool RunSimpleperfCmd(int argc, char** argv) {
bool result = command->Run(args);
LOG(DEBUG) << "command '" << command_name << "' "
<< (result ? "finished successfully" : "failed");
+ // Quick exit to avoid cost freeing memory and closing files.
+ android::base::quick_exit(result ? 0 : 1);
return result;
}