summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Salyzyn <salyzyn@google.com>2015-11-04 18:41:13 +0000
committerandroid-build-merger <android-build-merger@google.com>2015-11-04 18:41:13 +0000
commit1208d25b182f0de129022a6a6d67bc2a35f90e9c (patch)
tree1a7a04797f74552a4d2e823a672d76ae68b11362
parent88ae7e37219e489fa00fe4ee89027c9c9b5bf772 (diff)
parentdfbe85ec8bc9fee87d7eb3378253bc7cf9890199 (diff)
downloadsystem_core-1208d25b182f0de129022a6a6d67bc2a35f90e9c.zip
system_core-1208d25b182f0de129022a6a6d67bc2a35f90e9c.tar.gz
system_core-1208d25b182f0de129022a6a6d67bc2a35f90e9c.tar.bz2
Merge "logd: pruning time horizon" into mnc-dr-dev
am: dfbe85ec8b * commit 'dfbe85ec8bc9fee87d7eb3378253bc7cf9890199': logd: pruning time horizon
-rw-r--r--logd/LogBuffer.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/logd/LogBuffer.cpp b/logd/LogBuffer.cpp
index 559fa2e..d72a78c 100644
--- a/logd/LogBuffer.cpp
+++ b/logd/LogBuffer.cpp
@@ -435,7 +435,10 @@ void LogBuffer::prune(log_id_t id, unsigned long pruneRows, uid_t caller_uid) {
worst_sizes = sorted[0]->getSizes();
// Calculate threshold as 12.5% of available storage
size_t threshold = log_buffer_size(id) / 8;
- if (worst_sizes > threshold) {
+ if ((worst_sizes > threshold)
+ // Allow time horizon to extend roughly tenfold, assume
+ // average entry length is 100 characters.
+ && (worst_sizes > (10 * sorted[0]->getDropped()))) {
worst = sorted[0]->getKey();
second_worst_sizes = sorted[1]->getSizes();
if (second_worst_sizes < threshold) {