summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYabin Cui <yabinc@google.com>2018-02-23 11:03:35 -0800
committerYabin Cui <yabinc@google.com>2018-02-23 11:03:35 -0800
commitccbd2262ddde5060f6746c6268da240a48c3cd10 (patch)
tree1541f38f2eecc4e207c68f70fdf3a1c0e1770cc7
parent6e7c4df7cc2374ba72996953c74541b5a0aa7a63 (diff)
downloadextras-ccbd2262ddde5060f6746c6268da240a48c3cd10.tar.gz
simpleperf: use quick_exit.
Bug: none Test: run simpleperf_unit_test. Test: run simpleperf manually. Change-Id: I5e7229c8d5bfc4d47a6b7e403e627137c7f36b55
-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;
}