summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Salyzyn2017-04-17 14:46:12 -0500
committerMark Salyzyn2017-04-17 17:10:26 -0500
commit5836379b2114f47c53485b42ab157104c29b2c4e (patch)
tree7a1728529511862d750700e7cfdd1a16079f70e7 /logd/LogBuffer.h
parentffa38cfc1ea33de4ddddb291cc70cc507506b758 (diff)
downloadplatform-system-core-5836379b2114f47c53485b42ab157104c29b2c4e.tar.gz
platform-system-core-5836379b2114f47c53485b42ab157104c29b2c4e.tar.xz
platform-system-core-5836379b2114f47c53485b42ab157104c29b2c4e.zip
logd: regression in handling watermark boundary.
Deal with a regression introduced in commit 5a34d6ea43d28f3b5d27bf6dd5b9fa31ec033531 (logd: drop mSequence from LogBufferElement) where log_time was compared against nsec() time miscalculating the watermark boundary. When dealing with logcat -t/-T, or any tail reading, add a margin to prune to back off by a period of 3 seconds (pruneMargin). Test: gTest liblog-unit-tests logcat-unit-tests and logd-unit-tests Bug: 37378309 Change-Id: I72ea858e4e7b5fa91741ea84c40d2e7c3c4aa031
Diffstat (limited to 'logd/LogBuffer.h')
-rw-r--r--logd/LogBuffer.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/logd/LogBuffer.h b/logd/LogBuffer.h
index 19d11cb7f..1272c20f6 100644
--- a/logd/LogBuffer.h
+++ b/logd/LogBuffer.h
@@ -174,6 +174,7 @@ class LogBuffer {
174 private: 174 private:
175 static constexpr size_t minPrune = 4; 175 static constexpr size_t minPrune = 4;
176 static constexpr size_t maxPrune = 256; 176 static constexpr size_t maxPrune = 256;
177 static const log_time pruneMargin;
177 178
178 void maybePrune(log_id_t id); 179 void maybePrune(log_id_t id);
179 bool prune(log_id_t id, unsigned long pruneRows, uid_t uid = AID_ROOT); 180 bool prune(log_id_t id, unsigned long pruneRows, uid_t uid = AID_ROOT);