summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Salyzyn2015-06-04 15:35:30 -0500
committerMark Salyzyn2015-06-05 10:05:05 -0500
commit047cc0729fd837a03b99db901941c1421ef15f96 (patch)
tree48885b6c1408869a0e317c1a397b8145af48444c /logd/LogTimes.cpp
parentf9ae390f63aa7bfc4e93ba1e18240aa1e05d122b (diff)
downloadplatform-system-core-047cc0729fd837a03b99db901941c1421ef15f96.tar.gz
platform-system-core-047cc0729fd837a03b99db901941c1421ef15f96.tar.xz
platform-system-core-047cc0729fd837a03b99db901941c1421ef15f96.zip
logd: filters remove leading expire messages and rate
- Cleanup resulting from experience and feedback - When filtering inside logd, drop any leading expire messages, they are cluttering up leading edge of tombstones (which filter by pid) - Increase and introduce EXPIRE_RATELIMIT from 1 to 10 seconds - Increase EXPIRE_THRESHOLD from 4 to 10 count - Improve the expire messages from: logd : uid=1000(system) too chatty comm=com.google.android.phone, expire 2800 lines change tag to be more descriptive, and reduce accusatory tone to: chatty : uid=1000(system) com.google.android.phone expire 2800 lines - if the UID name forms a prefix for comm name, then drop UID name Change-Id: Ied7cc04c0ab3ae02167649a0b97378e44ef7b588
Diffstat (limited to 'logd/LogTimes.cpp')
-rw-r--r--logd/LogTimes.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/logd/LogTimes.cpp b/logd/LogTimes.cpp
index ec67c07e8..68a068008 100644
--- a/logd/LogTimes.cpp
+++ b/logd/LogTimes.cpp
@@ -31,6 +31,7 @@ LogTimeEntry::LogTimeEntry(LogReader &reader, SocketClient *client,
31 mRelease(false), 31 mRelease(false),
32 mError(false), 32 mError(false),
33 threadRunning(false), 33 threadRunning(false),
34 leadingDropped(false),
34 mReader(reader), 35 mReader(reader),
35 mLogMask(logMask), 36 mLogMask(logMask),
36 mPid(pid), 37 mPid(pid),
@@ -123,6 +124,8 @@ void *LogTimeEntry::threadStart(void *obj) {
123 124
124 bool privileged = FlushCommand::hasReadLogs(client); 125 bool privileged = FlushCommand::hasReadLogs(client);
125 126
127 me->leadingDropped = true;
128
126 lock(); 129 lock();
127 130
128 while (me->threadRunning && !me->isError_Locked()) { 131 while (me->threadRunning && !me->isError_Locked()) {
@@ -132,6 +135,7 @@ void *LogTimeEntry::threadStart(void *obj) {
132 135
133 if (me->mTail) { 136 if (me->mTail) {
134 logbuf.flushTo(client, start, privileged, FilterFirstPass, me); 137 logbuf.flushTo(client, start, privileged, FilterFirstPass, me);
138 me->leadingDropped = true;
135 } 139 }
136 start = logbuf.flushTo(client, start, privileged, FilterSecondPass, me); 140 start = logbuf.flushTo(client, start, privileged, FilterSecondPass, me);
137 141
@@ -163,6 +167,14 @@ int LogTimeEntry::FilterFirstPass(const LogBufferElement *element, void *obj) {
163 167
164 LogTimeEntry::lock(); 168 LogTimeEntry::lock();
165 169
170 if (me->leadingDropped) {
171 if (element->getDropped()) {
172 LogTimeEntry::unlock();
173 return false;
174 }
175 me->leadingDropped = false;
176 }
177
166 if (me->mCount == 0) { 178 if (me->mCount == 0) {
167 me->mStart = element->getSequence(); 179 me->mStart = element->getSequence();
168 } 180 }
@@ -190,6 +202,13 @@ int LogTimeEntry::FilterSecondPass(const LogBufferElement *element, void *obj) {
190 goto skip; 202 goto skip;
191 } 203 }
192 204
205 if (me->leadingDropped) {
206 if (element->getDropped()) {
207 goto skip;
208 }
209 me->leadingDropped = false;
210 }
211
193 // Truncate to close race between first and second pass 212 // Truncate to close race between first and second pass
194 if (me->mNonBlock && me->mTail && (me->mIndex >= me->mCount)) { 213 if (me->mNonBlock && me->mTail && (me->mIndex >= me->mCount)) {
195 goto stop; 214 goto stop;