summaryrefslogtreecommitdiff
path: root/trusty/coverage/coverage.cpp
diff options
context:
space:
mode:
authorTom Cherry <tomcherry@google.com>2020-08-12 09:36:15 -0700
committerTom Cherry <tomcherry@google.com>2020-08-12 12:49:56 -0700
commit3932a9c0747b6aece517652ea0aba4be6c8df9b6 (patch)
tree868eeaedd0f437366a9173ba0351bd120d627c7b /trusty/coverage/coverage.cpp
parentd0e8451d59e41a8435daaca6c1702154f3d418de (diff)
logd: SerializedLogBuffer: never wait for a reader during prune/clear
Previously, chatty had logic that would skip a certain number of log entries to satify pruning, but otherwise keep the reader connected. This was a best-effort attempt at helping pruning and had additional logic that handled further disruptions, if logd's memory was 2x the allotted memory. The new logic has two components: 1) memcpy() each individual log message in FlushTo() such that there are no references to the underlying log data without a lock held. Note, that this memcpy is completely negligible for performance. 2) In Prune(), immediately delete all log chunks required to reduce memory to the allotted amount, which is now safe given 1). If readers will lose logs, continue to print a warning. This additionally makes the Clear() logic deterministic. It was previously best effort in chatty, but will immediately and always clear all logs for SerializedLogBuffer. Bug: 163617910 Test: logging unit tests Test: Prune() immediately frees buffers during high log pressure Test: Clear() immediately frees buffers during high log pressure Change-Id: I40fe9b791312af3dc256b166e5c34425f4ca51ac
Diffstat (limited to 'trusty/coverage/coverage.cpp')
0 files changed, 0 insertions, 0 deletions