ADB Logcat时间戳如何工作

时间:2011-10-21 04:39:46

标签: android adb android-logcat

我正在试图找出AirPad上发生事件的时间,所以我发出了logcat命令:

adb logcat -v time -d -b radio -b events -b main -b system -b radio

然而,在查看时间戳时,每个缓冲区的第一个时间戳似乎在缓冲区的最后一个时间戳之后立即开始。

--------- beginning of /dev/log/radio

10-20 19:30:37.878 D/RILD    (   53): Do not switch user to radio

...

10-20 19:30:37.998 D/RIL     (   53): Wait device...

--------- beginning of /dev/log/events

10-20 19:30:39.608 I/boot_progress_start(   54): 9398

...


10-20 19:31:13.998 D/RIL     (   53): Wait device...

--------- beginning of /dev/log/system

10-20 19:31:15.008 D/ConnectivityService(   99): tearing down Mobile networks due to setting

...

10-20 19:32:28.418 V/ActivityManager(   99): Launching: HistoryRecord{408d6a00 com.amazon.kindle/com.amazon.kcp.reader.BookReaderActivity} icicle=null with results=null newIntents=null andResume=true

--------- beginning of /dev/log/main

10-20 19:32:28.428 D/VPU     (   55): VPU: vpu_power_on 01`

所以我的问题是,时间戳代表什么 - 它们代表事件发生的时间吗?如果是这样,为什么他们这样做?

2 个答案:

答案 0 :(得分:1)

时间戳是正确的。

当指定多个缓冲区时,logcat将它们全部交织在一起,并打印按时间排序的所有内容。 “......的开头”行只表示每个缓冲区的第一条消息的位置;他们文件分隔符。

答案 1 :(得分:0)

时间戳表示事件的时间。

logcat并不真正支持指定多个缓冲区。看起来确实如此,但如果省略“-d”,它将继续只显示一个缓冲区。

时间戳似乎不寻常,因为adb logcat首先显示(环)缓冲条目。您可以通过“-g”查看缓冲区大小。在我的手机上它的256kb。