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

Commit 49afe0d0 authored by Mark Salyzyn's avatar Mark Salyzyn
Browse files

logd: worst uid record watermark part deux

Only record watermark if not known, or represents the worst UID
currently under focus. This has resulted in a halving of the average
prune time in the face of heavy spam because we get less processing
spikes.

Bug: 23327476
Change-Id: I19f297042b9fc2c98d902695c1c36df1bf5cd6f6
parent 186f1dee
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -467,7 +467,11 @@ void LogBuffer::prune(log_id_t id, unsigned long pruneRows, uid_t caller_uid) {
            // unmerged drop message
            if (dropped) {
                last.add(e);
                if ((e->getUid() == worst)
                        || (mLastWorstUid[id].find(e->getUid())
                            == mLastWorstUid[id].end())) {
                    mLastWorstUid[id][e->getUid()] = it;
                }
                ++it;
                continue;
            }