diff options
author | Mark Salyzyn | 2016-07-14 17:34:30 -0500 |
---|---|---|
committer | Mark Salyzyn | 2016-07-15 16:58:17 -0500 |
commit | 6a06694a610d103afdf424b0bb69dc8f7f2b8e5a (patch) | |
tree | 9b6a836c45e52d9326476f295017185b1a5e0a9e /logd/LogStatistics.cpp | |
parent | 47684ca59147a3f5de71bf4f2fe6a647bdc6c60e (diff) | |
download | platform-system-core-6a06694a610d103afdf424b0bb69dc8f7f2b8e5a.tar.gz platform-system-core-6a06694a610d103afdf424b0bb69dc8f7f2b8e5a.tar.xz platform-system-core-6a06694a610d103afdf424b0bb69dc8f7f2b8e5a.zip |
logd: Worst Tag filter enabled for events buffer
- Add drop logistics to TagTable
- replace uid references to a key reference since it
is an UID for most buffers, but a TAG for the
events and security buffer
- template the find worst entry mechanics into LogFindWorst class
Bug: 30118730
Change-Id: Ibea4be2c50d6ff4b39039e371365fed2453f17a2
Diffstat (limited to 'logd/LogStatistics.cpp')
-rw-r--r-- | logd/LogStatistics.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/logd/LogStatistics.cpp b/logd/LogStatistics.cpp index a2d2aa525..86d33b26d 100644 --- a/logd/LogStatistics.cpp +++ b/logd/LogStatistics.cpp | |||
@@ -152,6 +152,15 @@ void LogStatistics::drop(LogBufferElement *element) { | |||
152 | 152 | ||
153 | pidTable.drop(element->getPid(), element); | 153 | pidTable.drop(element->getPid(), element); |
154 | tidTable.drop(element->getTid(), element); | 154 | tidTable.drop(element->getTid(), element); |
155 | |||
156 | uint32_t tag = element->getTag(); | ||
157 | if (tag) { | ||
158 | if (log_id == LOG_ID_SECURITY) { | ||
159 | securityTagTable.drop(tag, element); | ||
160 | } else { | ||
161 | tagTable.drop(tag, element); | ||
162 | } | ||
163 | } | ||
155 | } | 164 | } |
156 | 165 | ||
157 | // caller must own and free character string | 166 | // caller must own and free character string |
@@ -438,6 +447,10 @@ std::string TagEntry::format(const LogStatistics & /* stat */, log_id_t /* id */ | |||
438 | getSizes()); | 447 | getSizes()); |
439 | 448 | ||
440 | std::string pruned = ""; | 449 | std::string pruned = ""; |
450 | size_t dropped = getDropped(); | ||
451 | if (dropped) { | ||
452 | pruned = android::base::StringPrintf("%zu", dropped); | ||
453 | } | ||
441 | 454 | ||
442 | return formatLine(name, size, pruned); | 455 | return formatLine(name, size, pruned); |
443 | } | 456 | } |