summaryrefslogtreecommitdiff
path: root/src/mongo/util/quick_exit.cpp
diff options
context:
space:
mode:
authorAndrew Morrow <acm@mongodb.com>2016-03-24 08:13:03 -0400
committerAndrew Morrow <acm@mongodb.com>2016-03-24 19:12:16 -0400
commit10b650835a78fbf7ebe9cf26926cc45556efd178 (patch)
tree41e2a43fd1096841e153e904803e90a3ee89f1af /src/mongo/util/quick_exit.cpp
parenta19406fdedac2bff515a0b162c8d496b11f4e455 (diff)
downloadmongo-10b650835a78fbf7ebe9cf26926cc45556efd178.tar.gz
SERVER-13476 Make the gperftools cpu profiler work again
Diffstat (limited to 'src/mongo/util/quick_exit.cpp')
-rw-r--r--src/mongo/util/quick_exit.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/mongo/util/quick_exit.cpp b/src/mongo/util/quick_exit.cpp
index e53c99420a4..586ccb0d4cd 100644
--- a/src/mongo/util/quick_exit.cpp
+++ b/src/mongo/util/quick_exit.cpp
@@ -62,6 +62,10 @@
#include <sanitizer/lsan_interface.h>
#endif
+#if defined(MONGO_CPU_PROFILER)
+#include <gperftools/profiler.h>
+#endif
+
#ifdef MONGO_GCOV
extern "C" void __gcov_flush();
#endif
@@ -78,6 +82,10 @@ void quickExit(int code) {
if (quickExitMutex)
quickExitMutex->lock();
+#if defined(MONGO_CPU_PROFILER)
+ ::ProfilerStop();
+#endif
+
#ifdef MONGO_GCOV
__gcov_flush();
#endif