dvm_lock_sample 解析
最近中在看art代码,看到这个函数的时候,想到logcat的events log中有大量的dvm_lock_sameple信息
进程名,主线程?,线程名字,锁等待时间,当前持有者的文件名,行号,上一个持有者文件名,行号,锁等待的百分比
- 打印此条LOG的时候,上一个锁的持有者已经释放锁,本线程为下一个锁的持有者,即将获取锁
- 上一个持有者的文件名,可能是“-”,表示与持有者是同一个文件。
dvm_lock_sample: [com.banyac.midrive.launcher,1,main,6,SourceFile,234,-,358,1]
art/runtime/monitor_android.cc
void Monitor::LogContentionEvent(Thread* self, uint32_t wait_ms, uint32_t sample_percent,