No description
65ab7fed70
Logs in logd's buffer are not in time order. If a client connects and requests logs from a given timestamp, we start at the beginning of the buffer and find the first entry that has happened since that timestamp and use its sequence number to flush logs from. This ensures that we get all logs accumulated in the buffer since that time stamp and not just the most recent. However there may be other logs in the buffer that happened before the timestamp and have likely been already served to the client, therefore we do not flush those. We only do this for the first flush, since once we have flushed all of the logs in the buffer, if another log comes in with a timestamp earlier than the requested timestamp, it must be out of order and not seen yet, since it is new even to logd. Note! This is still broken. There is a race that logs before the timestamp may come in out of order since the last time the client disconnected and before it reconnects. The *only* solution to this problem is that clients need to request logs after a given sequence number. That will be done as a separate liblog API change, while these changes put in the ground work to make that possible. Note 2: the security log implementation, which is one of the most important users of this, already captures logs from seconds before the last previous log to work around issues with timestamps. That workaround mitigates the above issue. Test: logs work with logcat -t Change-Id: If1a62a90c082d98c4cf2eb5c92ae3b7e89850cf2 |
||
---|---|---|
adb | ||
base | ||
bootstat | ||
cli-test | ||
code_coverage | ||
cpio | ||
debuggerd | ||
deprecated-adf | ||
diagnose_usb | ||
fastboot | ||
fs_mgr | ||
gatekeeperd | ||
healthd | ||
include | ||
init | ||
janitors | ||
libappfuse | ||
libasyncio | ||
libbacktrace | ||
libbinderwrapper | ||
libcrypto_utils | ||
libcutils | ||
libdiskconfig | ||
libgrallocusage | ||
libkeyutils | ||
liblog | ||
libmodprobe | ||
libnetutils | ||
libpackagelistparser | ||
libpixelflinger | ||
libprocessgroup | ||
libprocinfo | ||
libqtaguid | ||
libsparse | ||
libstats | ||
libsuspend | ||
libsync | ||
libsystem | ||
libsysutils | ||
libunwindstack | ||
libusbhost | ||
libutils | ||
libvndksupport | ||
libziparchive | ||
llkd | ||
logcat | ||
logd | ||
logwrapper | ||
property_service | ||
qemu_pipe | ||
reboot | ||
rootdir | ||
run-as | ||
sdcard | ||
set-verity-state | ||
shell_and_utilities | ||
storaged | ||
toolbox | ||
trusty | ||
usbd | ||
watchdogd | ||
.clang-format | ||
.clang-format-2 | ||
.clang-format-4 | ||
.gitignore | ||
Android.bp | ||
CleanSpec.mk | ||
MODULE_LICENSE_APACHE2 | ||
NOTICE | ||
OWNERS | ||
PREUPLOAD.cfg | ||
TEST_MAPPING |