diff options
author | Mark Salyzyn <salyzyn@google.com> | 2015-03-17 17:17:25 -0700 |
---|---|---|
committer | Mark Salyzyn <salyzyn@google.com> | 2015-04-10 15:45:10 -0700 |
commit | ae769238391f7f9fa5c03a436d5f1fd73130e6bd (patch) | |
tree | 2c148b708513ffe6f8d87c4bb447f489ca088d82 | |
parent | 1a01f963ff4c439e281b88aefb881935c697a0db (diff) | |
download | system_core-ae769238391f7f9fa5c03a436d5f1fd73130e6bd.zip system_core-ae769238391f7f9fa5c03a436d5f1fd73130e6bd.tar.gz system_core-ae769238391f7f9fa5c03a436d5f1fd73130e6bd.tar.bz2 |
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
-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); |