diff options
-rw-r--r-- | logd/LogBuffer.cpp | 2 | ||||
-rw-r--r-- | logd/LogBufferElement.h | 4 | ||||
-rw-r--r-- | logd/LogStatistics.cpp | 2 |
3 files changed, 6 insertions, 2 deletions
diff --git a/logd/LogBuffer.cpp b/logd/LogBuffer.cpp index d8ffb02..260e237 100644 --- a/logd/LogBuffer.cpp +++ b/logd/LogBuffer.cpp @@ -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()) { diff --git a/logd/LogBufferElement.h b/logd/LogBufferElement.h index cc18378..7b6456d 100644 --- a/logd/LogBufferElement.h +++ b/logd/LogBufferElement.h @@ -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; diff --git a/logd/LogStatistics.cpp b/logd/LogStatistics.cpp index e0b8fd8..40fbfae 100644 --- a/logd/LogStatistics.cpp +++ b/logd/LogStatistics.cpp @@ -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); |