1
0
Fork 0
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 6d24f2138b
Rockchip Anroid12_SDK 20220721-rkr10 (e1522e56)
3 years ago
..
doc_images Rockchip Anroid12_SDK 20220721-rkr10 (e1522e56) 3 years ago
fuzz Rockchip Anroid12_SDK 20220721-rkr10 (e1522e56) 3 years ago
.clang-format Rockchip Anroid12_SDK 20220721-rkr10 (e1522e56) 3 years ago
Android.bp Rockchip Anroid12_SDK 20220721-rkr10 (e1522e56) 3 years ago
ChattyLogBuffer.cpp Rockchip Anroid12_SDK 20220721-rkr10 (e1522e56) 3 years ago
ChattyLogBuffer.h Rockchip Anroid12_SDK 20220721-rkr10 (e1522e56) 3 years ago
ChattyLogBufferTest.cpp Rockchip Anroid12_SDK 20220721-rkr10 (e1522e56) 3 years ago
CommandListener.cpp Rockchip Anroid12_SDK 20220721-rkr10 (e1522e56) 3 years ago
CommandListener.h Rockchip Anroid12_SDK 20220721-rkr10 (e1522e56) 3 years ago
CompressionEngine.cpp Rockchip Anroid12_SDK 20220721-rkr10 (e1522e56) 3 years ago
CompressionEngine.h Rockchip Anroid12_SDK 20220721-rkr10 (e1522e56) 3 years ago
LogAudit.cpp Rockchip Anroid12_SDK 20220721-rkr10 (e1522e56) 3 years ago
LogAudit.h Rockchip Anroid12_SDK 20220721-rkr10 (e1522e56) 3 years ago
LogBuffer.h Rockchip Anroid12_SDK 20220721-rkr10 (e1522e56) 3 years ago
LogBufferElement.cpp Rockchip Anroid12_SDK 20220721-rkr10 (e1522e56) 3 years ago
LogBufferElement.h Rockchip Anroid12_SDK 20220721-rkr10 (e1522e56) 3 years ago
LogBufferTest.cpp Rockchip Anroid12_SDK 20220721-rkr10 (e1522e56) 3 years ago
LogBufferTest.h Rockchip Anroid12_SDK 20220721-rkr10 (e1522e56) 3 years ago
LogKlog.cpp Rockchip Anroid12_SDK 20220721-rkr10 (e1522e56) 3 years ago
LogKlog.h Rockchip Anroid12_SDK 20220721-rkr10 (e1522e56) 3 years ago
LogListener.cpp Rockchip Anroid12_SDK 20220721-rkr10 (e1522e56) 3 years ago
LogListener.h Rockchip Anroid12_SDK 20220721-rkr10 (e1522e56) 3 years ago
LogPermissions.cpp Rockchip Anroid12_SDK 20220721-rkr10 (e1522e56) 3 years ago
LogPermissions.h Rockchip Anroid12_SDK 20220721-rkr10 (e1522e56) 3 years ago
LogReader.cpp Rockchip Anroid12_SDK 20220721-rkr10 (e1522e56) 3 years ago
LogReader.h Rockchip Anroid12_SDK 20220721-rkr10 (e1522e56) 3 years ago
LogReaderList.cpp Rockchip Anroid12_SDK 20220721-rkr10 (e1522e56) 3 years ago
LogReaderList.h Rockchip Anroid12_SDK 20220721-rkr10 (e1522e56) 3 years ago
LogReaderThread.cpp Rockchip Anroid12_SDK 20220721-rkr10 (e1522e56) 3 years ago
LogReaderThread.h Rockchip Anroid12_SDK 20220721-rkr10 (e1522e56) 3 years ago
LogSize.cpp Rockchip Anroid12_SDK 20220721-rkr10 (e1522e56) 3 years ago
LogSize.h Rockchip Anroid12_SDK 20220721-rkr10 (e1522e56) 3 years ago
LogStatistics.cpp Rockchip Anroid12_SDK 20220721-rkr10 (e1522e56) 3 years ago
LogStatistics.h Rockchip Anroid12_SDK 20220721-rkr10 (e1522e56) 3 years ago
LogTags.cpp Rockchip Anroid12_SDK 20220721-rkr10 (e1522e56) 3 years ago
LogTags.h Rockchip Anroid12_SDK 20220721-rkr10 (e1522e56) 3 years ago
LogUtils.h Rockchip Anroid12_SDK 20220721-rkr10 (e1522e56) 3 years ago
LogWriter.h Rockchip Anroid12_SDK 20220721-rkr10 (e1522e56) 3 years ago
LogdLock.cpp Rockchip Anroid12_SDK 20220721-rkr10 (e1522e56) 3 years ago
LogdLock.h Rockchip Anroid12_SDK 20220721-rkr10 (e1522e56) 3 years ago
OWNERS Rockchip Anroid12_SDK 20220721-rkr10 (e1522e56) 3 years ago
PkgIds.cpp Rockchip Anroid12_SDK 20220721-rkr10 (e1522e56) 3 years ago
PruneList.cpp Rockchip Anroid12_SDK 20220721-rkr10 (e1522e56) 3 years ago
PruneList.h Rockchip Anroid12_SDK 20220721-rkr10 (e1522e56) 3 years ago
README.auditd Rockchip Anroid12_SDK 20220721-rkr10 (e1522e56) 3 years ago
README.compression.md Rockchip Anroid12_SDK 20220721-rkr10 (e1522e56) 3 years ago
README.property Rockchip Anroid12_SDK 20220721-rkr10 (e1522e56) 3 years ago
README.replay.md Rockchip Anroid12_SDK 20220721-rkr10 (e1522e56) 3 years ago
RecordedLogMessage.h Rockchip Anroid12_SDK 20220721-rkr10 (e1522e56) 3 years ago
RecordingLogBuffer.cpp Rockchip Anroid12_SDK 20220721-rkr10 (e1522e56) 3 years ago
RecordingLogBuffer.h Rockchip Anroid12_SDK 20220721-rkr10 (e1522e56) 3 years ago
ReplayMessages.cpp Rockchip Anroid12_SDK 20220721-rkr10 (e1522e56) 3 years ago
SerializedData.h Rockchip Anroid12_SDK 20220721-rkr10 (e1522e56) 3 years ago
SerializedFlushToState.cpp Rockchip Anroid12_SDK 20220721-rkr10 (e1522e56) 3 years ago
SerializedFlushToState.h Rockchip Anroid12_SDK 20220721-rkr10 (e1522e56) 3 years ago
SerializedFlushToStateTest.cpp Rockchip Anroid12_SDK 20220721-rkr10 (e1522e56) 3 years ago
SerializedLogBuffer.cpp Rockchip Anroid12_SDK 20220721-rkr10 (e1522e56) 3 years ago
SerializedLogBuffer.h Rockchip Anroid12_SDK 20220721-rkr10 (e1522e56) 3 years ago
SerializedLogBufferTest.cpp Rockchip Anroid12_SDK 20220721-rkr10 (e1522e56) 3 years ago
SerializedLogChunk.cpp Rockchip Anroid12_SDK 20220721-rkr10 (e1522e56) 3 years ago
SerializedLogChunk.h Rockchip Anroid12_SDK 20220721-rkr10 (e1522e56) 3 years ago
SerializedLogChunkTest.cpp Rockchip Anroid12_SDK 20220721-rkr10 (e1522e56) 3 years ago
SerializedLogEntry.h Rockchip Anroid12_SDK 20220721-rkr10 (e1522e56) 3 years ago
SimpleLogBuffer.cpp Rockchip Anroid12_SDK 20220721-rkr10 (e1522e56) 3 years ago
SimpleLogBuffer.h Rockchip Anroid12_SDK 20220721-rkr10 (e1522e56) 3 years ago
auditctl.cpp Rockchip Anroid12_SDK 20220721-rkr10 (e1522e56) 3 years ago
device_test_config.xml Rockchip Anroid12_SDK 20220721-rkr10 (e1522e56) 3 years ago
event.logtags Rockchip Anroid12_SDK 20220721-rkr10 (e1522e56) 3 years ago
libaudit.cpp Rockchip Anroid12_SDK 20220721-rkr10 (e1522e56) 3 years ago
libaudit.h Rockchip Anroid12_SDK 20220721-rkr10 (e1522e56) 3 years ago
logd.rc Rockchip Anroid12_SDK 20220721-rkr10 (e1522e56) 3 years ago
logd_test.cpp Rockchip Anroid12_SDK 20220721-rkr10 (e1522e56) 3 years ago
logtagd.rc Rockchip Anroid12_SDK 20220721-rkr10 (e1522e56) 3 years ago
main.cpp Rockchip Anroid12_SDK 20220721-rkr10 (e1522e56) 3 years 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, chatty, 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, which is particularly useful since it will show the chatty pruning messages at that point. 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.