diff options
author | Christopher Ferris <cferris@google.com> | 2019-04-01 19:31:26 -0700 |
---|---|---|
committer | Christopher Ferris <cferris@google.com> | 2019-04-02 10:55:21 -0700 |
commit | c328e4465d12d760f5fbcb2daddf5fa4138f50b1 (patch) | |
tree | fd91c386332bbe1198cb0bedc11505b76d146057 /libc/malloc_debug/PointerData.cpp | |
parent | 4699cf61746d37fc11c8eb8bdfc7eb296a476e4b (diff) |
Disable info messages by default for malloc debug.
Add a new option verbose for malloc debug that is not enabled by default.
This disables all of the info log messages. It turns out these log
messages can add a measurable amount of time and can change the boot up.
Bug: 129239269
Test: Adjusted unit tests pass.
Test: Verified no messages unless verbose option used.
Change-Id: I805cb7c8ecb44de88119574e59d784877cacc383
Diffstat (limited to 'libc/malloc_debug/PointerData.cpp')
-rw-r--r-- | libc/malloc_debug/PointerData.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/libc/malloc_debug/PointerData.cpp b/libc/malloc_debug/PointerData.cpp index 6c7d8fa15..617d128c7 100644 --- a/libc/malloc_debug/PointerData.cpp +++ b/libc/malloc_debug/PointerData.cpp @@ -105,8 +105,10 @@ bool PointerData::Initialize(const Config& config) NO_THREAD_SAFETY_ANALYSIS { error_log("Unable to set up backtrace signal enable function: %s", strerror(errno)); return false; } - info_log("%s: Run: 'kill -%d %d' to enable backtracing.", getprogname(), - config.backtrace_signal(), getpid()); + if (config.options() & VERBOSE) { + info_log("%s: Run: 'kill -%d %d' to enable backtracing.", getprogname(), + config.backtrace_signal(), getpid()); + } } if (config.options() & BACKTRACE) { @@ -117,8 +119,10 @@ bool PointerData::Initialize(const Config& config) NO_THREAD_SAFETY_ANALYSIS { error_log("Unable to set up backtrace dump signal function: %s", strerror(errno)); return false; } - info_log("%s: Run: 'kill -%d %d' to dump the backtrace.", getprogname(), - config.backtrace_dump_signal(), getpid()); + if (config.options() & VERBOSE) { + info_log("%s: Run: 'kill -%d %d' to dump the backtrace.", getprogname(), + config.backtrace_dump_signal(), getpid()); + } } backtrace_dump_ = false; |