zoukankan      html  css  js  c++  java
  • wakelock查看

    Android的wakelock分为两层

    待机异常https://wenku.baidu.com/view/6b765c8802020740be1e9bd8.html

    Linux层和应用层

    1. 查看Linux的wakelock

      在adb shell中使用命令#cat /sys/power/wake_lock

      (1)内核没有加锁时,如下图显示

      (2)当内核有进程加锁时,例如我对屏幕进行解锁

    2. 查看应用程序的wakelock,学习对dumpsys中各种log进行分析

      在adb shell中使用# dumpsys power命令

      1. 当没有应用程序打开时,如下显示

         

      2. 当有应用程序加锁时,如下显示

     

    1. 对于内核状态的加锁情况,也可以使用cat /d/wakeup_sources命令查看,如下图

      其中各字段解析如下

    count: wakelock被激活次数。如果该数值比较大,说明它处理了大量的事件,而该数值比较小则表示,花了很长的时间来处理这些事件,或wakelock没有正确释放。

    expire_count:超时的wakelock的次数。

    wake_count

    active_since:当前状态下,仍持有锁的wakelock,

    total_time:wakelock 锁持有的总时间,该时间最重要。

    sleep_time:wakelock 在系统休眠的时候锁持有的时间

    max_time:wakelock单次花费最多的时间。

    last_change:最后记录的时间。

     

    原文

    count, tells you how many times the wakelock was activated. If a
    
    wakelock prevented suspend for a long time a large count tells you it
    
    handled a lot of events while a small count tells you it took a long
    
    time to process the events, or the wakelock was not released properly.
    
    expire_count, tells you how many times the timeout expired. For the
    
    input event wakelock in the android kernel (which has a timeout) an
    
    expire count that matches the count tells you that someone opened an
    
    input device but is not reading from it (this has happened several
    
    times).
    
    wake_count, tells you that this is the first wakelock that was
    
    acquired in the resume path. This is currently less useful than I
    
    would like on the Nexus One since it is usually "SMD_RPCCALL" which
    
    does not tell me a lot.
    
    active_since, tells you how long a a still active wakelock has been
    
    active. If someone activated a wakelock and never released it, it will
    
    be obvious here.
    
    total_time, total time the wake lock has been active. This one should
    
    be obvious.
    
    sleep_time, total time the wake lock has been active when the screen was off.
    
    max_time, longest time the wakelock was active uninterrupted. This
    
    used less often, but the battery on a device was draining fast, but
    
    the problem went away before looking at the stats this will show if a
    
    wakelock was active for a long time.
    

     

     

    查看串口log信息

     

    echo 0x201 > /sys/module/lpm_levels/parameters/debug_mask

     

    查看子系统是否进入待机

    cat /d/rpm_stats

    如果vdd min不为零则进入待机,如果vdd min为零则说明系统从未进入待机

  • 相关阅读:
    C#基础精华07(委托事件,委托的使用,匿名方法)
    C#操作xml文档,cuid,dategridview显示数据
    自定义控件的模式
    Mob短信验证的具体使用
    Mob短信验证的配置的解释
    Android Studio添加应用作为依赖时报错Error:Dependency MonthText:xlistview:unspecified on project app resolves to an APK archive which is not supported as a compilation dependency. File: 及其解决方案
    友盟官方文档
    获取网络状态
    Nohttp请求图片的两种简答的方式:普通请求以及缓存请求
    Nohttp网络请求数据,Post以及Get的简单实用以及设置缓存文字的的请求
  • 原文地址:https://www.cnblogs.com/yejintianming00/p/9338997.html
Copyright © 2011-2022 走看看