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. LeetCode_35. Search Insert Position

    35. Search Insert Position Easy Given a sorted array and a target value, return the index if the tar ...

  2. jQuery学习四——效果

    1.显示,隐藏: <!DOCTYPE html> <html> <head> <title>jquery事件</title> </he ...

  3. 手动mvn install指令向maven本地仓库安装jar包

    mvn install:install-file -DgroupId=imsdriver(jar包的groupId) -DartifactId=imsdriver(jar包的artifactId) - ...

  4. TEC-2机微程序设计

    了解TEC-2机的结构和基本的指令知识很重要,不理解而只知一味地照抄是学不到知识的.建议先阅读课件,再结合例子进行理解.以下例子只供参考,有些地方可以合并,具体的操作仍需见仁见智.理解并学会使用微指令 ...

  5. iOS-UIWebView去掉滚动条和黑色背景即拖拽后的上下阴影

    iOS UIWebView去掉滚动条和黑色背景即拖拽后的上下阴影 隐藏滚动条和上下滚动时出边界的后面的黑色的背景 webView.backgroundColor=[UIColor clearColor ...

  6. SSRS 2016 Forms Authentication

    SSRS 2016 comes with completely new report manager web interface and implementing form authenticatio ...

  7. lvs整理

    LVS是Linux Virtual Server的简写,即Linux虚拟服务器,是一个虚拟的服务器集群系统.通过LVS提供的负载均衡技术和Linux操作系统实现一个高性能.高可用的服务器群集,它具有良 ...

  8. spacemacs:emacs和vim结合,大杀器。vim党转emacs

    结合本人基础,做下述结论.不一定准确.  基础:  1. vim操作和高级操作,熟悉.使用的spf13-vim.  2. emacs以前学过,但是按键太累,相比vim简直难受.  3. emacs命令 ...

  9. Egret入门学习日记 --- 第十四篇(书中 5.4~5.6节 内容)

    第十四篇(书中 5.4~5.6节 内容) 书中内容: 总结 5.4节 内容重点: 1.如何编写自定义组件? 跟着做: 重点1:如何编写自定义组件? 文中提到了重要的两点. 好,我们来试试看. 第一步, ...

  10. [CF837D]Round Subset_动态规划

    Round Subset 题目链接:http://codeforces.com/problemset/problem/837/D 数据范围:略. 题解: $dp$比较显然. 但是卡空间,有两种方法: ...