summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Morrow <acm@mongodb.com>2016-12-17 22:59:58 -0500
committerAndrew Morrow <acm@mongodb.com>2016-12-21 18:49:51 -0500
commit79631667e6a9371c0a664898256c863afa0f7dd7 (patch)
treeb3c9d24c4fcf00c07261520e6056114fc081b9bf
parentba15d5ba13359ba0aedbb58ee10cfc919fd9e0f6 (diff)
downloadmongo-79631667e6a9371c0a664898256c863afa0f7dd7.tar.gz
SERVER-27451 Allow tcmalloc stack sample capture in debug builds
-rw-r--r--src/third_party/gperftools-2.5/SConscript10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/third_party/gperftools-2.5/SConscript b/src/third_party/gperftools-2.5/SConscript
index f18a43a8ad9..e2696c7d545 100644
--- a/src/third_party/gperftools-2.5/SConscript
+++ b/src/third_party/gperftools-2.5/SConscript
@@ -84,15 +84,21 @@ env = conf.Finish()
env.Append(CPPPATH=["build_" + env["TARGET_OS"] + "_" + env["TARGET_ARCH"]])
-env.Append( CPPDEFINES=[ "NO_TCMALLOC_SAMPLES", "NO_HEAP_CHECK"] )
+env.Append(
+ CPPDEFINES=["NO_HEAP_CHECK"],
+)
# The build system doesn't define NDEBUG globally for historical reasons, however, TCMalloc
# expects that NDEBUG is used to select between preferring the mmap or the sbrk allocator. For
# non-debug builds, we want to prefer the sbrk allocator since this is TCMallocs preferred
# production deployment configuration. See the use of NDEBUG and kDebugMode in
# src/system-alloc.cc for more details.
+#
+# Additionally, for debug builds we do want to capture stacks during (de)allocations, but we don't
+# want to pay that cost for release builds. For non-debug builds we use NO_TCMALLOC_SAMPLES to
+# disable the stack trace collection.
if not debugBuild:
- env.Append( CPPDEFINES=["NDEBUG"] )
+ env.Append( CPPDEFINES=["NDEBUG", "NO_TCMALLOC_SAMPLES"] )
env.Prepend( CPPPATH=["src/"] )