• 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为零则说明系统从未进入待机

  • 相关阅读:
    STL的相关知识
    有关欧拉通路/回路的一些资料整理
    差分约束
    BZOJ 2100: [Usaco2010 Dec]Apple Delivery
    BZOJ 2017: [Usaco2009 Nov]硬币游戏(A Coin Game)
    vijos 1282&1283&1284&1285 佳佳的魔法照片/魔法药水/魔杖/魔法阵
    BZOJ 1660: [Usaco2006 Nov]Bad Hair Day
    BZOJ 1602: [Usaco2008 Oct]牧场行走
    BZOJ 1647: [Usaco2007 Open]Fliptile 翻格子游戏
    BZOJ 1646: [Usaco2007 Open]Catch That Cow
  • 原文地址:https://www.cnblogs.com/yejintianming00/p/9338997.html
Copyright © 2020-2023  润新知