android event log

cat /system/etc/event-log-tags
frameworks/base/services/core/java/com/android/server/am/EventLogTags.logtags

cpu

2721 cpu (total|1|6),(user|1|6),(system|1|6),(iowait|1|6),(irq|1|6),(softirq|1|6)
05-12 19:39:29.354 1562 1792 I cpu : [98,1,91,5,0,0]

总运行时间98,用户空间1,system空间91,iowait 5,irq 0, softirq 0.

binder_sample

监控每个进程的主线程的binder transaction的耗时情况, 当超过阈值时,则输出相应的目标调用信息.
52004 binder_sample (descriptor|3),(method_num|1|5),(time|1|3),(blocking_package|3),(sample_percent|1|6)
05-12 19:39:35.682 7185 7185 I binder_sample: [android.app.IActivityManager,26,52234,android.process.media,100]
执行android.app.IActivityManager接口,code=26,耗时52234ms,block在android.process.media进程,百分比100%

dvm_lock_sample

print at art/runtime/monitor.cc
当某个线程等待lock的时间blocked超过阈值,则输出当前的持锁状态 ;
20003 dvm_lock_sample (process|3),(main|1|5),(thread|3),(time|1|3),(file|3),(line|1|5),(ownerfile|3),(ownerline|1|5),(sample_percent|1|6)
05-12 19:40:52.959 1562 2100 I dvm_lock_sample: [system_server,0,WifiStateMachine,12203,ActivityManagerService.java,20291,PendingIntentRecord.java,253,0]

system_server进程,非主线程,线程WifiStateMachine,等锁12203ms,ActivityManagerService.java行20291,该锁被PendingIntentRecord.java 253持有,百分比0

am_lifecycle_sample

当app在主线程的生命周期回调方法执行时间超过阈值,则输出相应信息;
30100 am_lifecycle_sample (User|1|5),(Process Name|3),(MessageCode|1|5),(time|1|3)
05-12 19:40:52.999 21104 21104 I am_lifecycle_sample: [0,com.tencent.wework,115,11917]

发表评论

电子邮件地址不会被公开。 必填项已用*标注