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

wakelock查看的更多相关文章

  1. Android -- PowerManager和PowerManager.WakeLock

    PowerManager.WakeLock                                                       PowerManager.WakerLock是我 ...

  2. Dumpsys Alarm查看应用程序唤醒命令

    Dumpsys alarm查看应用程序唤醒命令: 在安卓adb root进如命令行后(没有root或者root群组的权限执行不了该命令), 1. <span style="font-s ...

  3. 查看w3wp进程占用的内存及.NET内存泄露,死锁分析

    一 基础知识 在分析之前,先上一张图: 从上面可以看到,这个w3wp进程占用了376M内存,启动了54个线程. 在使用windbg查看之前,看到的进程含有 *32 字样,意思是在64位机器上已32位方 ...

  4. ASP.NET Core应用中如何记录和查看日志

    日志记录不仅对于我们开发的应用,还是对于ASP.NET Core框架功能都是一项非常重要的功能特性.我们知道ASP.NET Core使用的是一个极具扩展性的日志系统,该系统由Logger.Logger ...

  5. Linux上如何查看物理CPU个数,核数,线程数

    首先,看看什么是超线程概念 超线程技术就是利用特殊的硬件指令,把两个逻辑内核模拟成两个物理芯片,让单个处理器都能使用线程级并行计算,进而兼容多线程操作系统和软件,减少了CPU的闲置时间,提高的CPU的 ...

  6. IIS启动失败,启动Windows Process Activation Service时,出现错误13:数据无效 ;HTTP 错误 401.2 - Unauthorized 由于身份验证头无效,您无权查看此页

    因为修改过管理员账号的密码后重启服务器导致IIS无法启动,出现已下异常 1.解决:"启动Windows Process Activation Service时,出现错误13:数据无效&quo ...

  7. linux之查看系统命令

    cpu信息 1.查看逻辑cpu核数 # cat /proc/cpuinfo| grep "processor"| wc -l 2.查看物理cpu个数 # cat /proc/cpu ...

  8. 萌新笔记——linux下查看内存的使用情况

    windows上有各种软件可以进行"一键加速"之类的操作,释放掉一些内存(虽然我暂时不知道是怎么办到的,有待后续学习).而任务管理器也可以很方便地查看各进程使用的内存情况,如下图: ...

  9. linux常用查看硬件设备信息命令

    转载:http://blog.chinaunix.net/uid-26782198-id-3242120.html # uname -a               # 查看内核/操作系统/CPU信息 ...

随机推荐

  1. easyui datagrid设置一开始不加载数据

    解决办法就是:一开始的url属性设置为空,例如: <table id="dg" title="用户管理" class="easyui-datag ...

  2. ubuntu 18.04下greenplum安装笔记(二)安装Greenplum的失败的尝试

    之前对Linux环境进行了搭建,现在开始进行Greenplum的正式安装. 下载 进Greenplum的官网:https://greenplum.org/download/ 可以发现,对于ubuntu ...

  3. jsplumb 流程图,常用功能配置记录

    前言: jsplumb 有2个版本一个Toolkit Edition(付费版),另外一个就是Community Edition(社区版本).Toolkit Edition版本功能集成的比较丰富,社区版 ...

  4. [CareerCup] 2. Bomberman 炸弹人

    We have a 2D grid. Each cell is either a wall, an enemy or empty. For example (0-empty, X-enemy, Y-w ...

  5. Vue-cli中的安装方法

    vue-cli脚手架模板是基于node下的npm来完成安装的所以首先需要安装node 1.安装node,vue运行需要基于npm一定的版本,所以首先升级npm到最新的版本,而在安装的过程中个人比较喜欢 ...

  6. nginx之配置proxy_set_header问题梳理

    客户端请求web服务,客户端:ip:192.168.223.1 nginx作为反向代理服务器:192.168.223.136 nginx作为后端web服务器:192.168.223.137 前提条件: ...

  7. Mac OS X下把 /etc/sudoers 写错了怎么办?(转载https://blog.csdn.net/robertsong2004/article/details/53725285)

    重要的事情先说一下,首先为了回避这个问题,一定要用 visudo 来改 /etc/sudoers 文件. 问题描述: 1. 用  sudo vi 直接改 /etc/sudoers 并覆盖原文件. 2. ...

  8. SQLServer 查询view中是否包含某个关键字

    在数据库view的创建中,会遇到一些跨数据库的view脚本,但是在将view更新到production的时候可能忘记更改database name,导致出现一些问题. 以下脚本可以检查出包含某个关键字 ...

  9. java - redis学习

    在学习redis之前,我们首先需要了解一下NoSQL(非关系数据库).非关系型数据库通常指数据以对象的形式存储在数据库中,而对象之间的关系通过每个对象自身的属性来决定. 为什么需要NoSQL? (1) ...

  10. Python基础系列讲解——时间模块详解大全之time模块

    Python中提供处理时间日期相关的内置模块有time.datetime和calendar. time模块中大多数函数调用了所在平台C library 的同名函数,因此更依赖于操作系统层面,所以tim ...