summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Jeff Hao <jeffhao@google.com> 2013-09-09 16:44:02 -0700
committer Jeff Hao <jeffhao@google.com> 2013-09-09 17:03:37 -0700
commit08f2e7b59fab9df108d3d91e6eeb4bbccbb325d1 (patch)
treea41d65ab0753f4b0a84540c95feacd932c21e0fe
parent3b99337ec2a92ca5fc0b3bd1d44be40e5eb2a30f (diff)
Disable lock contention logging by default.
The verifier runs out of memory with lock contention logging on nakasi. Bug: 10646091 Change-Id: I8ddffdb48d779a20107bae7013cbe92d13dc8bdb
-rw-r--r--runtime/base/mutex-inl.h10
-rw-r--r--runtime/base/mutex.h4
2 files changed, 6 insertions, 8 deletions
diff --git a/runtime/base/mutex-inl.h b/runtime/base/mutex-inl.h
index a559d63f77..7e8365eaba 100644
--- a/runtime/base/mutex-inl.h
+++ b/runtime/base/mutex-inl.h
@@ -48,16 +48,14 @@ class ScopedContentionRecorder {
blocked_tid_(kLogLockContentions ? blocked_tid : 0),
owner_tid_(kLogLockContentions ? owner_tid : 0),
start_nano_time_(kLogLockContentions ? NanoTime() : 0) {
- if (kLogLockContentions) {
- std::string msg = StringPrintf("Lock contention on %s (owner tid: %llu)",
- mutex->GetName(), owner_tid);
- ATRACE_BEGIN(msg.c_str());
- }
+ std::string msg = StringPrintf("Lock contention on %s (owner tid: %llu)",
+ mutex->GetName(), owner_tid);
+ ATRACE_BEGIN(msg.c_str());
}
~ScopedContentionRecorder() {
+ ATRACE_END();
if (kLogLockContentions) {
- ATRACE_END();
uint64_t end_nano_time = NanoTime();
mutex_->RecordContention(blocked_tid_, owner_tid_, end_nano_time - start_nano_time_);
}
diff --git a/runtime/base/mutex.h b/runtime/base/mutex.h
index cec06cfaa9..ee37388f3b 100644
--- a/runtime/base/mutex.h
+++ b/runtime/base/mutex.h
@@ -51,8 +51,8 @@ const bool kDebugLocking = kIsDebugBuild;
// Record Log contention information, dumpable via SIGQUIT.
#ifdef ART_USE_FUTEXES
-// To disable lock contention logging, flip this to false.
-const bool kLogLockContentions = true;
+// To enable lock contention logging, set this to true.
+const bool kLogLockContentions = false;
#else
// Keep this false as lock contention logging is supported only with
// futex.