Android logd 與 logcat
以下整理出 Android Logd 背後的程式流程與原理。
LogReader: 監聽/dev/socket/logdr, 當client連接上則將buffer 訊息息寫入client. 所對應的執行緒名稱為"logd.reader"
LogListener: 監聽/dev/socket/logdw, 新日誌添加到LogBuffer, 並且LogReader發送更新給已連接的client. 所對的執行緒名稱為"logd.writer"
參考
Android logd日誌原理 - Gityuan博客 | 袁輝輝的技術博客
http://gityuan.com/2018/01/27/android-log/
原始碼分析,trace 的不錯
Android log 機制 - logd 如何接收 log 數據(上) | 程序員蝦餃
https://jekton.github.io/2018/05/16/logd-writing-part1/
Android log 機制 - logd 如何接收 log 數據(下) | 程序員蝦餃
https://jekton.github.io/2018/05/17/logd-writing-part2/
logd - platform/system/core - Git at Google
https://android.googlesource.com/platform/system/core/+/master/logd/main.cpp
https://android.googlesource.com/platform/system/core/+/master/logd/LogListener.cpp
https://android.googlesource.com/platform/system/core/+/master/logd/LogReader.cpp
https://android.googlesource.com/platform/system/core/+/master/logd/LogBuffer.cpp
LogReader: 監聽/dev/socket/logdr, 當client連接上則將buffer 訊息息寫入client. 所對應的執行緒名稱為"logd.reader"
LogListener: 監聽/dev/socket/logdw, 新日誌添加到LogBuffer, 並且LogReader發送更新給已連接的client. 所對的執行緒名稱為"logd.writer"
參考
Android logd日誌原理 - Gityuan博客 | 袁輝輝的技術博客
http://gityuan.com/2018/01/27/android-log/
原始碼分析,trace 的不錯
Android log 機制 - logd 如何接收 log 數據(上) | 程序員蝦餃
https://jekton.github.io/2018/05/16/logd-writing-part1/
Android log 機制 - logd 如何接收 log 數據(下) | 程序員蝦餃
https://jekton.github.io/2018/05/17/logd-writing-part2/
logd - platform/system/core - Git at Google
https://android.googlesource.com/platform/system/core/+/master/logd/main.cpp
https://android.googlesource.com/platform/system/core/+/master/logd/LogListener.cpp
https://android.googlesource.com/platform/system/core/+/master/logd/LogReader.cpp
https://android.googlesource.com/platform/system/core/+/master/logd/LogBuffer.cpp
留言
張貼留言