util: workaround an Android Logger driver bug 07/171107/1
authorMichal Bloch <m.bloch@samsung.com>
Mon, 26 Feb 2018 13:35:59 +0000 (14:35 +0100)
committerMichal Bloch <m.bloch@samsung.com>
Mon, 26 Feb 2018 13:46:21 +0000 (14:46 +0100)
commitb11bdd9ab3d2ef8dd54c7be834f9ddf0269e52d4
tree435112ed91595f5cfb8085414201ca6ecbef662e
parentf81b1058969ecaac6c5ec2570fb5387cbfdfa789
util: workaround an Android Logger driver bug

GET_LOG_LEN always returns as if the connection were using protocol version 2,
even if the connection is actually using version 1. Since read does not suffer
from this problem, there is a mismatch between the total sum accumulated over
multiple reads and value reported by GET_LOG_LEN, which results in more logs
being read than is necessary. The reason it appears to work correctly when no
extra logs are present to make up the difference is that util also ends when
epoll returns zero ready file descriptors, which is an incorrect behaviour as
it can happen even with more data awaiting, for example when dlog_logger daemon
cannot keep up and fills a pipe slower than util can read it.

Change-Id: I3e48cedbc4a73d778316c1ebfeb555aa97e7d8b3
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
src/logutil/fdi_logger.c