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. Zuul1与Spring Cloud Gateway对比

    一.API网关 1.1 Zuul1简介 1.2 Spring Cloud Gateway简介 二.对比 2.0 产品对比 2.1 性能对比 2.1.1 低并发场景 2.1.2 高并发场景 2.1.3 ...

  2. 区块链学习(四)truffle部署编译智能合约以太坊私有链

    前面我们介绍了以太坊私有链的搭建以及多节点私有链网络,这次我们介绍如何使用truffle框架来部署编译智能合约到我们之前搭建的私有链网络中. 搭建环境及需使用的工具:ubuntu18.04  Truf ...

  3. jsp标签在spring boot中的关键用法

    <form:form modelAttribute="user" action="save" method="post" >// ...

  4. TCP使用

    TCP使用注意事项总结   目录 发送或者接受数据过程中对端可能发生的情况汇总 本端TCP发送数据时对端进程已经崩溃 本端TCP发送数据时对端主机已经崩溃 本端TCP发送数据时对端主机已经关机 某个连 ...

  5. PLSQL设置文件夹排序并设置颜色

  6. HTML 5 全局 contenteditable 属性

    contenteditable 可以将标签设置为可输入的input,textarea, 但是在ios上,点击或者点击很久input输入框才出来,兼容ios的方法是加一个   -webkit-user- ...

  7. 从 select ... for update来分析mysql的锁

    一 mysql的悲观锁 - 以行锁做示例 每次拿数据的时候都认为别的线程会修改数据,所以每次拿数据的时候都会给数据上锁.上锁之后,当别的线程想要拿数据时,就会阻塞.直到给数据上锁的线程将事务提交或者回 ...

  8. JWT 身份认证优缺点分析以及常见问题解决方案

    本文转载自:JWT 身份认证优缺点分析以及常见问题解决方案 Token 认证的优势 相比于 Session 认证的方式来说,使用 token 进行身份认证主要有下面三个优势: 1.无状态 token ...

  9. C++:标准模板库Sort

    一.概述 STL几乎封装了所用的数据结构中的算法,这里主要介绍排序算法的使用,指定排序迭代器区间后,即可实现排序功能. 所需头文件#include <algorithm> sort函数:对 ...

  10. 顺序表添加与删除元素以及 php实现顺序表实例

    对顺序表的操作,添加与删除元素. 增加元素 如下图所示  对顺序列表 Li [1328,693,2529,254]  添加一个元素 111 ,有三种方式: a)尾部端插入元素,时间复杂度O(1);  ...