summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Salyzyn <salyzyn@google.com>2015-08-24 13:43:27 -0700
committerMark Salyzyn <salyzyn@google.com>2015-08-31 13:55:54 -0700
commitaa58a86275158c563e37e0482d49e9927a742e19 (patch)
tree3de019991d211023445d2ee38707ce76a0a6fe0b
parent8bc53c125ab739db7bd34bd3b5c496c3f3a542f9 (diff)
downloadsystem_core-aa58a86275158c563e37e0482d49e9927a742e19.tar.gz
system_core-aa58a86275158c563e37e0482d49e9927a742e19.tar.bz2
system_core-aa58a86275158c563e37e0482d49e9927a742e19.zip
logd: worst uid record watermark part deux
(cherry pick from commit 49afe0d00fdc163e5b8a1ab2f859c4688613d5b8) Only record watermark if not known, or represents the worst UID currently under focus. This has resulted in a halving of the average prune time in the face of heavy spam because we get less processing spikes. Bug: 23327476 Bug: 23681639 Bug: 23685592 Change-Id: I19f297042b9fc2c98d902695c1c36df1bf5cd6f6
-rw-r--r--logd/LogBuffer.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/logd/LogBuffer.cpp b/logd/LogBuffer.cpp
index db3f26c72..e732b8ebf 100644
--- a/logd/LogBuffer.cpp
+++ b/logd/LogBuffer.cpp
@@ -467,7 +467,11 @@ void LogBuffer::prune(log_id_t id, unsigned long pruneRows, uid_t caller_uid) {
// unmerged drop message
if (dropped) {
last.add(e);
- mLastWorstUid[id][e->getUid()] = it;
+ if ((e->getUid() == worst)
+ || (mLastWorstUid[id].find(e->getUid())
+ == mLastWorstUid[id].end())) {
+ mLastWorstUid[id][e->getUid()] = it;
+ }
++it;
continue;
}