diff options
author | Mark Salyzyn <salyzyn@google.com> | 2015-10-12 13:45:51 -0700 |
---|---|---|
committer | The Android Automerger <android-build@google.com> | 2015-11-04 13:00:23 -0800 |
commit | a6116961338548409b14076eefbef211afc8c3fe (patch) | |
tree | 7a1655e2fd06dec8ab78ab95abcb96c5e2994196 | |
parent | eb88db4fd15f412c634cf1cbe58ccc94290a5ef5 (diff) | |
download | system_core-a6116961338548409b14076eefbef211afc8c3fe.zip system_core-a6116961338548409b14076eefbef211afc8c3fe.tar.gz system_core-a6116961338548409b14076eefbef211afc8c3fe.tar.bz2 |
logd: pruning time horizon
Estimate a time horizon of ten fold for worst UID pruning
Bug: 25453210
Bug: 24782000
Change-Id: I7118deb6d42531c68ed2ac2a59c57b0580b942cc
-rw-r--r-- | logd/LogBuffer.cpp | 5 |
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) { |