Fix remaining small issues with the lock sampling.
* Eliminate the now unused lockprofsample flag. The sample percentage
has been a function of the wait time an threshold since the previous
change.
* Eliminate some trailing whitespace that creeped into the previous
change.
* Eliminate the trailing newline from the event buffer. Because the
buffer pointer was not incremented this character was not seen in
the event log anyway.
* Document the lockProfThreshold global.
Change-Id: Ia1c1fcf862d76f5631601e05e7941e5171fab097
diff --git a/vm/Sync.c b/vm/Sync.c
index 7afe514..1405315 100644
--- a/vm/Sync.c
+++ b/vm/Sync.c
@@ -418,9 +418,6 @@
/* Emit the sample percentage, 5 bytes. */
cp = logWriteInt(cp, samplePercent);
- /* Emit a trailing newline, apparently the EVENT_TYPE_LIST convention. */
- *cp = '\n';
-
assert((size_t)(cp - eventBuffer) <= sizeof(eventBuffer));
android_btWriteLog(EVENT_LOG_TAG_dvm_lock_sample,
EVENT_TYPE_LIST,
@@ -460,7 +457,7 @@
} else {
samplePercent = 100 * waitMs / waitThreshold;
}
- if (samplePercent != 0 && ((u4)rand() % 100 < samplePercent)) {
+ if (samplePercent != 0 && ((u4)rand() % 100 < samplePercent)) {
logContentionEvent(self, waitMs, samplePercent);
}
}
@@ -525,7 +522,7 @@
*/
dvmThrowExceptionFmt("Ljava/lang/IllegalMonitorStateException;",
"unlock of unowned monitor, self=%d owner=%d",
- self->threadId,
+ self->threadId,
mon->owner ? mon->owner->threadId : 0);
return false;
}