summaryrefslogtreecommitdiff
path: root/libmodprobe/libmodprobe_ext.cpp
diff options
context:
space:
mode:
authorTom Cherry <tomcherry@google.com>2020-05-28 20:02:42 -0700
committerTom Cherry <tomcherry@google.com>2020-06-02 13:26:48 -0700
commitb3e163399a9038175d46c9dbd9262d009e87ceb6 (patch)
treecb63225fcd72980db33138e17d98e6f682a25e45 /libmodprobe/libmodprobe_ext.cpp
parent4ab0bc414d8a01df2013ea70f8e10f5daa12bec4 (diff)
logd: move leading_dropped logic into FlushTo()
This logic isn't generic, so it should not be in the generic LogReaderThread. Moreover, it's currently broken in essentially every case except when filtering by UID, because it runs as in the filter functions before the actual filtering by pid/etc takes place. For example, when filtering by pid, it's possible to get leading chatty messages. The newly added test was failing previously but is fixed by this change. It's fundamentally broken in the tail case. Take this example: 1: Normal message 2: Chatty message 3: Normal message 4: Normal message If you read that log buffer with a tail value of 3, there are three possible outcomes: 1) Messages #2-4, however this would include a leading chatty message, which is not allowed. 2) Messages #3-4, however this is only 2, not 3 messages. 3) Messages #1-4, however this is 4, more than the 3 requested messages. This code chooses 2) as the correct solution, in this case, we don't need to account for leading chatty messages when counting the total logs in the buffer. A test is added for this case as well. Test: new unit test Change-Id: Id02eb81a8e77390aba4f85aac659c6cab498dbcd
Diffstat (limited to 'libmodprobe/libmodprobe_ext.cpp')
0 files changed, 0 insertions, 0 deletions