ANR问题的[tombstoned] log查看分析方法

如何查看’[tombstoned]’ log

issue:

测试中发现一例chrome无响应

09-07 09:45:06.580 I/cr_media(11809): Provisioning origin ID 7638CB090F8C8B0C66D9FCFB168A3509
09-07 09:45:06.625 I/InputDispatcher( 1393): Window 'Window{7186472 u0 com.android.chrome/com.google.android.apps.chrome.Main}' spent 3562.0ms processing the last input event: MotionEvent
09-07 09:45:06.627 I/InputDispatcher( 1393): Window 'Window{7186472 u0 com.android.chrome/com.google.android.apps.chrome.Main}' spent 3558.7ms processing the last input event: MotionEvent
09-07 09:45:06.628 I/InputDispatcher( 1393): Window 'Window{7186472 u0 com.android.chrome/com.google.android.apps.chrome.Main}' spent 3550.7ms processing the last input event: MotionEvent
09-07 09:45:06.628 I/InputDispatcher( 1393): Window 'Window{7186472 u0 com.android.chrome/com.google.android.apps.chrome.Main}' spent 3541.8ms processing the last input event: MotionEvent
09-07 09:45:06.628 I/InputDispatcher( 1393): Window 'Window{7186472 u0 com.android.chrome/com.google.android.apps.chrome.Main}' spent 3532.9ms processing the last input event: MotionEvent
09-07 09:45:06.628 I/InputDispatcher( 1393): Window 'Window{7186472 u0 com.android.chrome/com.google.android.apps.chrome.Main}' spent 3524.1ms processing the last input event: MotionEvent
09-07 09:45:06.628 I/InputDispatcher( 1393): Window 'Window{7186472 u0 com.android.chrome/com.google.android.apps.chrome.Main}' spent 3515.6ms processing the last input event: MotionEvent
09-07 09:45:06.628 I/InputDispatcher( 1393): Window 'Window{7186472 u0 com.android.chrome/com.google.android.apps.chrome.Main}' spent 3506.8ms processing the last input event: MotionEvent
09-07 09:45:06.628 I/InputDispatcher( 1393): Window 'Window{7186472 u0 com.android.chrome/com.google.android.apps.chrome.Main}' spent 3498.0ms processing the last input event: MotionEvent
09-07 09:45:06.628 I/InputDispatcher( 1393): Window 'Window{7186472 u0 com.android.chrome/com.google.android.apps.chrome.Main}' spent 3489.1ms processing the last input event: MotionEvent
09-07 09:45:06.628 I/InputDispatcher( 1393): Window 'Window{7186472 u0 com.android.chrome/com.google.android.apps.chrome.Main}' spent 3480.5ms processing the last input event: MotionEvent
09-07 09:45:06.628 I/InputDispatcher( 1393): Window 'Window{7186472 u0 com.android.chrome/com.google.android.apps.chrome.Main}' spent 3471.6ms processing the last input event: MotionEvent
09-07 09:45:06.628 I/InputDispatcher( 1393): Window 'Window{7186472 u0 com.android.chrome/com.google.android.apps.chrome.Main}' spent 3459.3ms processing the last input event: MotionEvent
09-07 09:45:06.628 I/InputDispatcher( 1393): Window 'Window{7186472 u0 com.android.chrome/com.google.android.apps.chrome.Main}' spent 3452.1ms processing the last input event: MotionEvent
09-07 09:45:06.628 I/InputDispatcher( 1393): Window 'Window{7186472 u0 com.android.chrome/com.google.android.apps.chrome.Main}' spent 3442.7ms processing the last input event: MotionEvent
09-07 09:45:06.628 I/InputDispatcher( 1393): Window 'Window{7186472 u0 com.android.chrome/com.google.android.apps.chrome.Main}' spent 3433.0ms processing the last input event: MotionEvent
09-07 09:45:06.628 I/InputDispatcher( 1393): Window 'Window{7186472 u0 com.android.chrome/com.google.android.apps.chrome.Main}' spent 3427.5ms processing the last input event: MotionEvent
09-07 09:45:06.628 I/InputDispatcher( 1393): Window 'Window{7186472 u0 com.android.chrome/com.google.android.apps.chrome.Main}' spent 3417.9ms processing the last input event: MotionEvent
09-07 09:45:06.628 I/InputDispatcher( 1393): Window 'Window{7186472 u0 com.android.chrome/com.google.android.apps.chrome.Main}' spent 3406.6ms processing the last input event: MotionEvent
09-07 09:45:06.628 I/InputDispatcher( 1393): Window 'Window{7186472 u0 com.android.chrome/com.google.android.apps.chrome.Main}' spent 3398.0ms processing the last input event: MotionEvent
09-07 09:45:06.628 I/InputDispatcher( 1393): Window 'Window{7186472 u0 com.android.chrome/com.google.android.apps.chrome.Main}' spent 3391.1ms processing the last input event: MotionEvent
09-07 09:45:06.628 I/InputDispatcher( 1393): Window 'Window{7186472 u0 com.android.chrome/com.google.android.apps.chrome.Main}' spent 3384.0ms processing the last input event: MotionEvent
09-07 09:45:06.628 I/InputDispatcher( 1393): Window 'Window{7186472 u0 com.android.chrome/com.google.android.apps.chrome.Main}' spent 3373.1ms processing the last input event: MotionEvent
09-07 09:45:06.628 I/InputDispatcher( 1393): Window 'Window{7186472 u0 com.android.chrome/com.google.android.apps.chrome.Main}' spent 3363.8ms processing the last input event: MotionEvent
09-07 09:45:06.628 I/InputDispatcher( 1393): Window 'Window{7186472 u0 com.android.chrome/com.google.android.apps.chrome.Main}' spent 3355.2ms processing the last input event: MotionEvent
09-07 09:45:06.628 I/InputDispatcher( 1393): Window 'Window{7186472 u0 com.android.chrome/com.google.android.apps.chrome.Main}' spent 3348.3ms processing the last input event: MotionEvent
09-07 09:45:06.628 I/InputDispatcher( 1393): Window 'Window{7186472 u0 com.android.chrome/com.google.android.apps.chrome.Main}' spent 3336.4ms processing the last input event: MotionEvent
09-07 09:45:06.628 I/InputDispatcher( 1393): Window 'Window{7186472 u0 com.android.chrome/com.google.android.apps.chrome.Main}' spent 3330.8ms processing the last input event: MotionEvent
09-07 09:45:06.628 I/InputDispatcher( 1393): Window 'Window{7186472 u0 com.android.chrome/com.google.android.apps.chrome.Main}' spent 3322.6ms processing the last input event: MotionEvent
09-07 09:45:06.628 I/InputDispatcher( 1393): Window 'Window{7186472 u0 com.android.chrome/com.google.android.apps.chrome.Main}' spent 3314.1ms processing the last input event: MotionEvent
09-07 09:45:06.628 I/InputDispatcher( 1393): Window 'Window{7186472 u0 com.android.chrome/com.google.android.apps.chrome.Main}' spent 3304.0ms processing the last input event: MotionEvent
09-07 09:45:06.629 I/InputDispatcher( 1393): Window 'Window{7186472 u0 com.android.chrome/com.google.android.apps.chrome.Main}' spent 3296.0ms processing the last input event: MotionEvent
09-07 09:45:06.629 I/InputDispatcher( 1393): Window 'Window{7186472 u0 com.android.chrome/com.google.android.apps.chrome.Main}' spent 3285.9ms processing the last input event: MotionEvent
09-07 09:45:06.629 I/InputDispatcher( 1393): Window 'Window{7186472 u0 com.android.chrome/com.google.android.apps.chrome.Main}' spent 3278.3ms processing the last input event: MotionEvent
09-07 09:45:06.629 I/InputDispatcher( 1393): Window 'Window{7186472 u0 com.android.chrome/com.google.android.apps.chrome.Main}' spent 3267.8ms processing the last input event: MotionEvent
09-07 09:45:06.629 I/InputDispatcher( 1393): Window 'Window{7186472 u0 com.android.chrome/com.google.android.apps.chrome.Main}' spent 3259.3ms processing the last input event: MotionEvent
09-07 09:45:06.629 I/InputDispatcher( 1393): Window 'Window{7186472 u0 com.android.chrome/com.google.android.apps.chrome.Main}' spent 3250.5ms processing the last input event: MotionEvent
09-07 09:45:06.629 I/InputDispatcher( 1393): Window 'Window{7186472 u0 com.android.chrome/com.google.android.apps.chrome.Main}' spent 3243.4ms processing the last input event: MotionEvent
09-07 09:45:06.629 I/InputDispatcher( 1393): Window 'Window{7186472 u0 com.android.chrome/com.google.android.apps.chrome.Main}' spent 3234.4ms processing the last input event: MotionEvent
09-07 09:45:06.629 I/InputDispatcher( 1393): Window 'Window{7186472 u0 com.android.chrome/com.google.android.apps.chrome.Main}' spent 3226.1ms processing the last input event: MotionEvent
09-07 09:45:06.629 I/InputDispatcher( 1393): Window 'Window{7186472 u0 com.android.chrome/com.google.android.apps.chrome.Main}' spent 3216.7ms processing the last input event: MotionEvent
09-07 09:45:06.629 I/InputDispatcher( 1393): Window 'Window{7186472 u0 com.android.chrome/com.google.android.apps.chrome.Main}' spent 3206.4ms processing the last input event: MotionEvent
09-07 09:45:06.629 I/InputDispatcher( 1393): Window 'Window{7186472 u0 com.android.chrome/com.google.android.apps.chrome.Main}' spent 3196.2ms processing the last input event: MotionEvent
09-07 09:45:06.629 I/InputDispatcher( 1393): Window 'Window{7186472 u0 com.android.chrome/com.google.android.apps.chrome.Main}' spent 3188.7ms processing the last input event: MotionEvent
09-07 09:45:06.629 I/InputDispatcher( 1393): Window 'Window{7186472 u0 com.android.chrome/com.google.android.apps.chrome.Main}' spent 3178.4ms processing the last input event: MotionEvent
09-07 09:45:06.629 I/InputDispatcher( 1393): Window 'Window{7186472 u0 com.android.chrome/com.google.android.apps.chrome.Main}' spent 3174.4ms processing the last input event: MotionEvent
09-07 09:45:06.629 I/InputDispatcher( 1393): Window 'Window{7186472 u0 com.android.chrome/com.google.android.apps.chrome.Main}' spent 3156.7ms processing the last input event: MotionEvent
09-07 09:45:06.629 I/Choreographer(11809): Skipped 678 frames!  The application may be doing too much work on its main thread.
09-07 09:45:06.631 W/Looper  ( 1393): Slow delivery took 2091ms main h=android.view.GestureDetector$GestureHandler c=null m=1

'''
09-07 09:45:15.906 I//system/bin/tombstoned(  718): received crash request for pid 11809
09-07 09:45:15.906 I//system/bin/tombstoned(  718): found intercept fd 512 for pid 11809 and type kDebuggerdJavaBacktrace
09-07 09:45:15.907 I/.android.chrom(11809): Wrote stack traces to '[tombstoned]'
09-07 09:45:15.907 I/system_server( 1393): libdebuggerd_client: done dumping process 11809
09-07 09:45:15.907 I/system_server( 1393): libdebuggerd_client: started dumping process 1393
09-07 09:45:15.908 I//system/bin/tombstoned(  718): registered intercept for pid 1393 and type kDebuggerdJavaBacktrace
09-07 09:45:15.908 I/system_server( 1393): Thread[2,tid=1399,WaitingInMainSignalCatcherLoop,Thread*=0x713880e000,peer=0x13580000,"Signal Catcher"]: reacting to signal 3
09-07 09:45:15.908 I/system_server( 1393): 
09-07 09:45:16.126 I/HidlSensorManager( 1393): hidl_ssvc_poll: spurious wake up, back to work
09-07 09:45:16.400 I//system/bin/tombstoned(  718): received crash request for pid 1393
09-07 09:45:16.400 I//system/bin/tombstoned(  718): found intercept fd 512 for pid 1393 and type kDebuggerdJavaBacktrace
09-07 09:45:16.401 I/system_server( 1393): Wrote stack traces to '[tombstoned]'
...
09-07 09:45:19.078 E/ActivityManager( 1393): ANR in com.android.chrome (com.android.chrome/com.google.android.apps.chrome.Main)
09-07 09:45:19.078 E/ActivityManager( 1393): PID: 11809
09-07 09:45:19.078 E/ActivityManager( 1393): Reason: Input dispatching timed out (Waiting to send non-key event because the touched window has not finished processing certain input events that were delivered to it over 500.0ms ago.  Wait queue length: 13.  Wait queue head age: 5948.2ms.)
09-07 09:45:19.078 E/ActivityManager( 1393): Load: 4.83 / 3.7 / 3.39
09-07 09:45:19.078 E/ActivityManager( 1393): CPU usage from 65863ms to 0ms ago (2021-09-07 09:44:08.848 to 2021-09-07 09:45:14.712) with 99% awake:
09-07 09:45:19.078 E/ActivityManager( 1393):   19% 11840/com.android.chrome:sandboxed_process0: 17% user + 1.7% kernel / faults: 27207 minor
09-07 09:45:19.078 E/ActivityManager( 1393):   11% 11809/com.android.chrome: 7.6% user + 3.7% kernel / faults: 8640 minor
09-07 09:45:19.078 E/ActivityManager( 1393):   5.6% 542/surfaceflinger: 3.8% user + 1.8% kernel / faults: 17 minor
09-07 09:45:19.078 E/ActivityManager( 1393):   5.1% 1393/system_server: 3.2% user + 1.8% kernel / faults: 2591 minor
09-07 09:45:19.078 E/ActivityManager( 1393):   4.9% 2325/com.google.android.gms: 4.6% user + 0.3% kernel / faults: 13930 minor
09-07 09:45:19.078 E/ActivityManager( 1393):   4.3% 11869/com.android.chrome:privileged_process0: 3.2% user + 1.1% kernel / faults: 8930 minor
09-07 09:45:19.078 E/ActivityManager( 1393):   2.7% 537/dreamlogger: 0.1% user + 2.6% kernel

分析

提供的log 使用logcat 获取 只有如上信息
通过观察 我们看到 anr具体信息被写入 tombstoned

跟进

如果是Android 8.1之前的系统 可执行adb pull /data/anr/traces.txt
8.1之后 用adb shell bugreport命令来导出trace文件

总结

发生ANR 需要分析trace文件来定位问题

如这例中

Window 'Window{7186472 u0 com.android.chrome/com.google.android.apps.chrome.Main}' spent 3489.1ms processing the last input event: MotionEvent

考虑到问题出在chrome中。 那只有在系统测解决了 -_-

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值