You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
hmz007 36ed224bac
Rockchip Anroid14_SDK 20240628-rkr5 (2556df1a)
1 year ago
..
binder/android/os Rockchip Anroid14_SDK 20240628-rkr5 (2556df1a) 1 year ago
doc_images Rockchip Anroid14_SDK 20240628-rkr5 (2556df1a) 1 year ago
fuzz Rockchip Anroid14_SDK 20240628-rkr5 (2556df1a) 1 year ago
integration_test Rockchip Anroid14_SDK 20240628-rkr5 (2556df1a) 1 year ago
.clang-format Rockchip Anroid14_SDK 20240628-rkr5 (2556df1a) 1 year ago
Android.bp Rockchip Anroid14_SDK 20240628-rkr5 (2556df1a) 1 year ago
CommandListener.cpp Rockchip Anroid14_SDK 20240628-rkr5 (2556df1a) 1 year ago
CommandListener.h Rockchip Anroid14_SDK 20240628-rkr5 (2556df1a) 1 year ago
CompressionEngine.cpp Rockchip Anroid14_SDK 20240628-rkr5 (2556df1a) 1 year ago
CompressionEngine.h Rockchip Anroid14_SDK 20240628-rkr5 (2556df1a) 1 year ago
LogAudit.cpp Rockchip Anroid14_SDK 20240628-rkr5 (2556df1a) 1 year ago
LogAudit.h Rockchip Anroid14_SDK 20240628-rkr5 (2556df1a) 1 year ago
LogBuffer.h Rockchip Anroid14_SDK 20240628-rkr5 (2556df1a) 1 year ago
LogBufferElement.cpp Rockchip Anroid14_SDK 20240628-rkr5 (2556df1a) 1 year ago
LogBufferElement.h Rockchip Anroid14_SDK 20240628-rkr5 (2556df1a) 1 year ago
LogBufferTest.cpp Rockchip Anroid14_SDK 20240628-rkr5 (2556df1a) 1 year ago
LogBufferTest.h Rockchip Anroid14_SDK 20240628-rkr5 (2556df1a) 1 year ago
LogKlog.cpp Rockchip Anroid14_SDK 20240628-rkr5 (2556df1a) 1 year ago
LogKlog.h Rockchip Anroid14_SDK 20240628-rkr5 (2556df1a) 1 year ago
LogListener.cpp Rockchip Anroid14_SDK 20240628-rkr5 (2556df1a) 1 year ago
LogListener.h Rockchip Anroid14_SDK 20240628-rkr5 (2556df1a) 1 year ago
LogPermissions.cpp Rockchip Anroid14_SDK 20240628-rkr5 (2556df1a) 1 year ago
LogPermissions.h Rockchip Anroid14_SDK 20240628-rkr5 (2556df1a) 1 year ago
LogReader.cpp Rockchip Anroid14_SDK 20240628-rkr5 (2556df1a) 1 year ago
LogReader.h Rockchip Anroid14_SDK 20240628-rkr5 (2556df1a) 1 year ago
LogReaderList.cpp Rockchip Anroid14_SDK 20240628-rkr5 (2556df1a) 1 year ago
LogReaderList.h Rockchip Anroid14_SDK 20240628-rkr5 (2556df1a) 1 year ago
LogReaderThread.cpp Rockchip Anroid14_SDK 20240628-rkr5 (2556df1a) 1 year ago
LogReaderThread.h Rockchip Anroid14_SDK 20240628-rkr5 (2556df1a) 1 year ago
LogSize.cpp Rockchip Anroid14_SDK 20240628-rkr5 (2556df1a) 1 year ago
LogSize.h Rockchip Anroid14_SDK 20240628-rkr5 (2556df1a) 1 year ago
LogStatistics.cpp Rockchip Anroid14_SDK 20240628-rkr5 (2556df1a) 1 year ago
LogStatistics.h Rockchip Anroid14_SDK 20240628-rkr5 (2556df1a) 1 year ago
LogTags.cpp Rockchip Anroid14_SDK 20240628-rkr5 (2556df1a) 1 year ago
LogTags.h Rockchip Anroid14_SDK 20240628-rkr5 (2556df1a) 1 year ago
LogUtils.h Rockchip Anroid14_SDK 20240628-rkr5 (2556df1a) 1 year ago
LogWriter.h Rockchip Anroid14_SDK 20240628-rkr5 (2556df1a) 1 year ago
LogdLock.cpp Rockchip Anroid14_SDK 20240628-rkr5 (2556df1a) 1 year ago
LogdLock.h Rockchip Anroid14_SDK 20240628-rkr5 (2556df1a) 1 year ago
LogdNativeService.cpp Rockchip Anroid14_SDK 20240628-rkr5 (2556df1a) 1 year ago
LogdNativeService.h Rockchip Anroid14_SDK 20240628-rkr5 (2556df1a) 1 year ago
PkgIds.cpp Rockchip Anroid14_SDK 20240628-rkr5 (2556df1a) 1 year ago
PruneList.cpp Rockchip Anroid14_SDK 20240628-rkr5 (2556df1a) 1 year ago
PruneList.h Rockchip Anroid14_SDK 20240628-rkr5 (2556df1a) 1 year ago
README.auditd Rockchip Anroid14_SDK 20240628-rkr5 (2556df1a) 1 year ago
README.compression.md Rockchip Anroid14_SDK 20240628-rkr5 (2556df1a) 1 year ago
README.property Rockchip Anroid14_SDK 20240628-rkr5 (2556df1a) 1 year ago
README.replay.md Rockchip Anroid14_SDK 20240628-rkr5 (2556df1a) 1 year ago
RecordedLogMessage.h Rockchip Anroid14_SDK 20240628-rkr5 (2556df1a) 1 year ago
RecordingLogBuffer.cpp Rockchip Anroid14_SDK 20240628-rkr5 (2556df1a) 1 year ago
RecordingLogBuffer.h Rockchip Anroid14_SDK 20240628-rkr5 (2556df1a) 1 year ago
ReplayMessages.cpp Rockchip Anroid14_SDK 20240628-rkr5 (2556df1a) 1 year ago
SerializedData.h Rockchip Anroid14_SDK 20240628-rkr5 (2556df1a) 1 year ago
SerializedFlushToState.cpp Rockchip Anroid14_SDK 20240628-rkr5 (2556df1a) 1 year ago
SerializedFlushToState.h Rockchip Anroid14_SDK 20240628-rkr5 (2556df1a) 1 year ago
SerializedFlushToStateTest.cpp Rockchip Anroid14_SDK 20240628-rkr5 (2556df1a) 1 year ago
SerializedLogBuffer.cpp Rockchip Anroid14_SDK 20240628-rkr5 (2556df1a) 1 year ago
SerializedLogBuffer.h Rockchip Anroid14_SDK 20240628-rkr5 (2556df1a) 1 year ago
SerializedLogBufferTest.cpp Rockchip Anroid14_SDK 20240628-rkr5 (2556df1a) 1 year ago
SerializedLogChunk.cpp Rockchip Anroid14_SDK 20240628-rkr5 (2556df1a) 1 year ago
SerializedLogChunk.h Rockchip Anroid14_SDK 20240628-rkr5 (2556df1a) 1 year ago
SerializedLogChunkTest.cpp Rockchip Anroid14_SDK 20240628-rkr5 (2556df1a) 1 year ago
SerializedLogEntry.h Rockchip Anroid14_SDK 20240628-rkr5 (2556df1a) 1 year ago
SimpleLogBuffer.cpp Rockchip Anroid14_SDK 20240628-rkr5 (2556df1a) 1 year ago
SimpleLogBuffer.h Rockchip Anroid14_SDK 20240628-rkr5 (2556df1a) 1 year ago
TrustyLog.cpp Rockchip Anroid14_SDK 20240628-rkr5 (2556df1a) 1 year ago
TrustyLog.h Rockchip Anroid14_SDK 20240628-rkr5 (2556df1a) 1 year ago
auditctl.cpp Rockchip Anroid14_SDK 20240628-rkr5 (2556df1a) 1 year ago
device_test_config.xml Rockchip Anroid14_SDK 20240628-rkr5 (2556df1a) 1 year ago
event.logtags Rockchip Anroid14_SDK 20240628-rkr5 (2556df1a) 1 year ago
libaudit.cpp Rockchip Anroid14_SDK 20240628-rkr5 (2556df1a) 1 year ago
libaudit.h Rockchip Anroid14_SDK 20240628-rkr5 (2556df1a) 1 year ago
logd.rc Rockchip Anroid14_SDK 20240628-rkr5 (2556df1a) 1 year ago
logd_test.cpp Rockchip Anroid14_SDK 20240628-rkr5 (2556df1a) 1 year ago
logtagd.rc Rockchip Anroid14_SDK 20240628-rkr5 (2556df1a) 1 year ago
main.cpp Rockchip Anroid14_SDK 20240628-rkr5 (2556df1a) 1 year ago

README.replay.md

logd can record and replay log messages for offline analysis.

Recording Messages

logd has a RecordingLogBuffer buffer that records messages to /data/misc/logd/recorded-messages. It stores messages in memory until that file is accessible, in order to capture all messages since the beginning of boot. It is only meant for logging developers to use and must be manually enabled in by adding RecordingLogBuffer.cpp to Android.bp and setting log_buffer = new SimpleLogBuffer(&reader_list, &log_tags, &log_statistics); in main.cpp.

Recording messages may delay the Log() function from completing and it is highly recommended to make the logd socket in liblog blocking, by removing SOCK_NONBLOCK from the socket() call in liblog/logd_writer.cpp.

Replaying Messages

Recorded messages can be replayed offline with the replay_messages tool. It runs on host and device and supports the following options:

  1. interesting - this prints 'interesting' statistics for each of the log buffer types (simple, serialized). The statistics are:
    1. Log Entry Count
    2. Size (the uncompressed size of the log messages in bytes)
    3. Overhead (the total cost of the log messages in memory in bytes)
    4. Range (the range of time that the logs cover in seconds)
  2. memory_usage BUFFER_TYPE - this prints the memory usage (sum of private dirty pages of the replay_messages process). Note that the input file is mmap()'ed as RO/Shared so it does not appear in these dirty pages, and a baseline is taken before allocating the log buffers, so only their contributions are measured. The tool outputs the memory usage every 100,000 messages.
  3. latency BUFFER_TYPE - this prints statistics of the latency of the Log() function for the given buffer type. It specifically prints the 1st, 2nd, and 3rd quartiles; the 95th, 99th, and 99.99th percentiles; and the maximum latency.
  4. print_logs BUFFER_TYPE [buffers] [print_point] - this prints the logs as processed by the given buffer_type from the buffers specified by buffers starting after the number of logs specified by print_point have been logged. This acts as if a user called logcat immediately after the specified logs have been logged. It additionally prints the statistics from logcat -S after the logs. buffers is a comma separated list of the numeric buffer id values from <android/log.h>. For example, 0,1,3 represents the main, radio, and system buffers. It can can also be all. print_point is an positive integer. If it is unspecified, logs are printed after the entire input file is consumed.
  5. nothing BUFFER_TYPE - this does nothing other than read the input file and call Log() for the given buffer type. This is used for profiling CPU usage of strictly the log buffer.