summaryrefslogtreecommitdiffstats
path: root/logd
diff options
context:
space:
mode:
authorMark Salyzyn <salyzyn@google.com>2015-09-01 20:11:11 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2015-09-01 20:11:11 +0000
commit3f5c5a1e6986a7cdafc4af10f17ddd631da83e40 (patch)
treee0819364e57314d811d14882646abc6471dac16b /logd
parentbd44f59f5b1b7d08b5643563b9ab9abfb375e67e (diff)
parentae26b4d948844ff3a86b6c369836a6658a87ca0d (diff)
downloadsystem_core-3f5c5a1e6986a7cdafc4af10f17ddd631da83e40.zip
system_core-3f5c5a1e6986a7cdafc4af10f17ddd631da83e40.tar.gz
system_core-3f5c5a1e6986a7cdafc4af10f17ddd631da83e40.tar.bz2
Merge "logd: worst uid record watermark part three" into mnc-dr-dev
Diffstat (limited to 'logd')
-rw-r--r--logd/LogBuffer.cpp23
1 files changed, 11 insertions, 12 deletions
diff --git a/logd/LogBuffer.cpp b/logd/LogBuffer.cpp
index e732b8e..9605ef8 100644
--- a/logd/LogBuffer.cpp
+++ b/logd/LogBuffer.cpp
@@ -413,6 +413,12 @@ void LogBuffer::prune(log_id_t id, unsigned long pruneRows, uid_t caller_uid) {
it = f->second;
}
}
+ static const timespec too_old = {
+ EXPIRE_HOUR_THRESHOLD * 60 * 60, 0
+ };
+ LogBufferElementCollection::iterator lastt;
+ lastt = mLogElements.end();
+ --lastt;
LogBufferElementLast last;
while (it != mLogElements.end()) {
LogBufferElement *e = *it;
@@ -464,6 +470,11 @@ void LogBuffer::prune(log_id_t id, unsigned long pruneRows, uid_t caller_uid) {
continue;
}
+ if ((e->getRealTime() < ((*lastt)->getRealTime() - too_old))
+ || (e->getRealTime() > (*lastt)->getRealTime())) {
+ break;
+ }
+
// unmerged drop message
if (dropped) {
last.add(e);
@@ -477,18 +488,6 @@ void LogBuffer::prune(log_id_t id, unsigned long pruneRows, uid_t caller_uid) {
}
if (e->getUid() != worst) {
- if (leading) {
- static const timespec too_old = {
- EXPIRE_HOUR_THRESHOLD * 60 * 60, 0
- };
- LogBufferElementCollection::iterator last;
- last = mLogElements.end();
- --last;
- if ((e->getRealTime() < ((*last)->getRealTime() - too_old))
- || (e->getRealTime() > (*last)->getRealTime())) {
- break;
- }
- }
leading = false;
last.clear(e);
++it;