summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Salyzyn <salyzyn@google.com>2015-04-23 15:01:07 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2015-04-23 15:01:07 +0000
commitef9a093fddd989bc555485e169bc8cc8a2643a7e (patch)
tree48d436d32ab4b267c1ac818532aa552a6e266334
parent92391131c43ec59d174d95ccfab6944832d1cee7 (diff)
parent2766099959799434b114f6272107df04f55493d8 (diff)
downloadsystem_core-ef9a093fddd989bc555485e169bc8cc8a2643a7e.zip
system_core-ef9a093fddd989bc555485e169bc8cc8a2643a7e.tar.gz
system_core-ef9a093fddd989bc555485e169bc8cc8a2643a7e.tar.bz2
am 27660999: am 653f9581: Merge "logd: per UID less aggressive 12.5% threshold"
* commit '2766099959799434b114f6272107df04f55493d8': logd: per UID less aggressive 12.5% threshold
-rw-r--r--logd/LogBuffer.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/logd/LogBuffer.cpp b/logd/LogBuffer.cpp
index 83a6b1d..1dced11 100644
--- a/logd/LogBuffer.cpp
+++ b/logd/LogBuffer.cpp
@@ -365,9 +365,16 @@ void LogBuffer::prune(log_id_t id, unsigned long pruneRows, uid_t caller_uid) {
if (sorted.get()) {
if (sorted[0] && sorted[1]) {
- worst = sorted[0]->getKey();
worst_sizes = sorted[0]->getSizes();
- second_worst_sizes = sorted[1]->getSizes();
+ // Calculate threshold as 12.5% of available storage
+ size_t threshold = log_buffer_size(id) / 8;
+ if (worst_sizes > threshold) {
+ worst = sorted[0]->getKey();
+ second_worst_sizes = sorted[1]->getSizes();
+ if (second_worst_sizes < threshold) {
+ second_worst_sizes = threshold;
+ }
+ }
}
}
}