summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Salyzyn2017-05-10 17:50:39 -0500
committerMark Salyzyn2017-05-15 17:13:20 -0500
commit982ad208b5e4d83f966ee4c10ad4f606417bcda6 (patch)
treede8365df77930cb49825880a121e983f71f43f99
parent3d0186b97e0b559a2dbd75c558ff5834cc27cfc5 (diff)
downloadplatform-system-core-982ad208b5e4d83f966ee4c10ad4f606417bcda6.tar.gz
platform-system-core-982ad208b5e4d83f966ee4c10ad4f606417bcda6.tar.xz
platform-system-core-982ad208b5e4d83f966ee4c10ad4f606417bcda6.zip
logd: remove start filtration from flushTo
We have already searched for the start point, the start filter check is paranoia that removes out-of-order entries that we are undoubtably interested in. Out-of-order entries occur under reader pressure, as the writer gets pushed back from in-place sorted order and lands it at the end for the reader to pick it up. If this occurred during a batch run or a logger thread wakeup, the entry could be filtered out and never output to the reader. Found one case where logcat.tail_time* tests failed which was fixed with this adjustment. Test: gTest logd-unit-tests, liblog-unit-tests and logcat-unit-tests Bug: 38046067 Bug: 37791296 Change-Id: Icbde6b33dca7ab98348c3a872793aeef3997d460
-rw-r--r--logd/LogBuffer.cpp11
1 files changed, 3 insertions, 8 deletions
diff --git a/logd/LogBuffer.cpp b/logd/LogBuffer.cpp
index ded6c8cc7..fbed83b76 100644
--- a/logd/LogBuffer.cpp
+++ b/logd/LogBuffer.cpp
@@ -1142,10 +1142,6 @@ log_time LogBuffer::flushTo(SocketClient* reader, const log_time& start,
1142 continue; 1142 continue;
1143 } 1143 }
1144 1144
1145 if (element->getRealTime() <= start) {
1146 continue;
1147 }
1148
1149 // NB: calling out to another object with wrlock() held (safe) 1145 // NB: calling out to another object with wrlock() held (safe)
1150 if (filter) { 1146 if (filter) {
1151 int ret = (*filter)(element, arg); 1147 int ret = (*filter)(element, arg);
@@ -1172,11 +1168,10 @@ log_time LogBuffer::flushTo(SocketClient* reader, const log_time& start,
1172 unlock(); 1168 unlock();
1173 1169
1174 // range locking in LastLogTimes looks after us 1170 // range locking in LastLogTimes looks after us
1175 max = element->flushTo(reader, this, privileged, sameTid); 1171 log_time next = element->flushTo(reader, this, privileged, sameTid);
1176 1172
1177 if (max == element->FLUSH_ERROR) { 1173 if (next == element->FLUSH_ERROR) return next;
1178 return max; 1174 if (next > max) max = next;
1179 }
1180 1175
1181 skip = maxSkip; 1176 skip = maxSkip;
1182 rdlock(); 1177 rdlock();