Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1208d25b authored by Mark Salyzyn's avatar Mark Salyzyn Committed by android-build-merger
Browse files

Merge "logd: pruning time horizon" into mnc-dr-dev

am: dfbe85ec

* commit 'dfbe85ec':
  logd: pruning time horizon
parents 88ae7e37 dfbe85ec
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -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) {