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

Commit ae769238 authored by Mark Salyzyn's avatar Mark Salyzyn
Browse files

logd: disable worst uid prune for events buffer

There is some usage statistics that would be hurt by pruning by UID,
since _all_ usage statistics come from system_server. In other words
we expect it to be chatty. Until we formulate and evaluate a better
(eg: per-tag?) filtration mechanism, lets hold off pruning by UID.

Bug: 19608965
Change-Id: Iddd45a671e13bdcf3394c20919ad1f2e4ef36616
parent 1a01f963
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -279,7 +279,7 @@ void LogBuffer::prune(log_id_t id, unsigned long pruneRows, uid_t caller_uid) {
        size_t worst_sizes = 0;
        size_t second_worst_sizes = 0;

        if ((id != LOG_ID_CRASH) && mPrune.worstUidEnabled()) {
        if (worstUidEnabledForLogid(id) && mPrune.worstUidEnabled()) {
            std::unique_ptr<const UidEntry *[]> sorted = stats.sort(2, id);

            if (sorted.get()) {
+4 −0
Original line number Diff line number Diff line
@@ -33,6 +33,10 @@ char *uidToName(uid_t uid);

}

static inline bool worstUidEnabledForLogid(log_id_t id) {
    return (id != LOG_ID_CRASH) && (id != LOG_ID_EVENTS);
}

class LogBufferElement {
    const log_id_t mLogId;
    const uid_t mUid;
+1 −1
Original line number Diff line number Diff line
@@ -340,7 +340,7 @@ void LogStatistics::format(char **buf, uid_t uid, unsigned int logMask) {
                android::String8 name("UID");
                android::String8 size("Size");
                android::String8 pruned("Pruned");
                if (id == LOG_ID_CRASH) {
                if (!worstUidEnabledForLogid(id)) {
                    pruned.setTo("");
                }
                format_line(output, name, size, pruned);