刚接触android不久,碰到了个anr,log:
05-11 04:45:04.583 I/am_anr  (  197): [2609,com.android.deskclock,572997,keyDispatchingTimedOut]
05-11 04:45:05.033 I/binder_sample( 2609): [android.content.IContentProvider,3,4910,com.android.deskclock,100]
05-11 04:45:05.113 I/content_update_sample( 2609): [content://settings/system,insert,,4999,com.android.deskclock,100]binder_sample、content_update_sample等是什么意思,后面的数字4910、4999都是操作的时长吗?
这里的anr是由binder_sample引起吗?查源码的话该查deskclock还是别处?

解决方案 »

  1.   

    ( 2609)这个是指打出log的进程号,com.android.deskclock这个是信息的文件路径;keyDispatchingTimedOut这个是指具体的原因,按键超时了
      

  2.   

    binder_sample、content_update_sample等是什么意思?
    这个叫TAG, 源码中会有 定义String TAG 或者LOG_TAG 为这些的语句。方便开发人员找到文件位置的标致。后面的数字4910、4999都是操作的时长吗?
    NO,是进程号。这里的anr是由binder_sample引起吗?查源码的话该查deskclock还是别处?
    从TAG的命名来看,是sample下的很好找的吧 一般都是以文件名.java来命名TAG的
      

  3.   

    多谢谢各位!
    log太多了不知道要帖哪些才有用

    05-11 04:45:04.583 I/am_anr  (  197): [2609,com.android.deskclock,572997,keyDispatchingTimedOut]
    从这个log来看是指pid 197线程发送按键消息到pid 2609,2609没有及时处理于是出现anr对吗?----- pid 197 at 2011-05-11 04:45:07 -----
    Cmd line: system_serverDALVIK THREADS:
    (mutexes: tll=0 tsl=0 tscl=0 ghl=0 hwl=0 hwll=0)
    "main" prio=5 tid=1 NATIVE
      | group="main" sCount=1 dsCount=0 obj=0x2aad2248 self=0xcf70
      | sysTid=197 nice=0 sched=0/0 cgrp=[fopen-error:2] handle=1876218976
      at com.android.server.SystemServer.init1(Native Method)
      at com.android.server.SystemServer.main(SystemServer.java:634)
      at java.lang.reflect.Method.invokeNative(Native Method)
      at java.lang.reflect.Method.invoke(Method.java:507)
      at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:862)
      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:620)
      at dalvik.system.NativeStart.main(Native Method)
    ----- pid 2609 at 2011-05-11 04:45:08 -----
    Cmd line: com.android.deskclockDALVIK THREADS:
    (mutexes: tll=0 tsl=0 tscl=0 ghl=0 hwl=0 hwll=0)
    "main" prio=5 tid=1 NATIVE
      | group="main" sCount=1 dsCount=0 obj=0x2aad2248 self=0xcf70
      | sysTid=2609 nice=0 sched=0/0 cgrp=[fopen-error:2] handle=1876218976
      at android.os.MessageQueue.nativePollOnce(Native Method)
      at android.os.MessageQueue.next(MessageQueue.java:119)
      at android.os.Looper.loop(Looper.java:110)
      at android.app.ActivityThread.main(ActivityThread.java:3701)
      at java.lang.reflect.Method.invokeNative(Native Method)
      at java.lang.reflect.Method.invoke(Method.java:507)
      at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:862)
      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:620)
      at dalvik.system.NativeStart.main(Native Method)从这两call stack看有问题吗?我看不出来呀