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

原文地址:https://www.cnblogs.com/yejintianming00/p/9338997.html

时间: 2024-08-09 12:24:21

wakelock查看的相关文章

Android查看wakelock

Android wakelock分为两层 linux层和应用层 1. 查看linux 的waklock # cat /sys/power/wake_lock PowerManagerService.Display PowerManagerService.WakeLocks PowerManagerService.Display : 这是屏开着是PowerManagerService对linux层设的wakelock PowerManagerService.WakeLocks: 这是应用层设的wa

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

Dumpsys alarm查看应用程序唤醒命令: 在安卓adb root进如命令行后(没有root或者root群组的权限执行不了该命令), 1. <span style="font-size:18px;">Pending alarm batches: 48</span> 当应用设置ALARM的时候,系统不会将这些ALARM在设置的准确时间内触发,而将用一种批量触发(batches mode)的策略,这样可以最小化地使系统从休眠状态醒来,最低程度地减少电池的消耗,

查看Linux系统版本信息

一.查看Linux内核版本命令(两种方法): 1.cat /proc/version [[email protected]CentOS home]# cat /proc/versionLinux version 2.6.32-431.el6.x86_64 ([email protected]) (gcc version 4.4.7 20120313 (Red Hat 4.4.7-4) (GCC) ) #1 SMP Fri Nov 22 03:15:09 UTC 2013 2.uname -a [

10.6 监控io性能 - 10.7 free命令 - 10.8 ps命令 - 10.9 查看网络状态 - 10.10 linux下抓包

- 10.6 监控io性能 - 10.7 free命令 - 10.8 ps命令 - 10.9 查看网络状态 - 10.10 linux下抓包 - 扩展tcp三次握手四次挥手 http://www.doc88.com/p-9913773324388.html  - tshark几个用法:http://www.aminglinux.com/bbs/thread-995-1-1.html  # 10.6 监控io性能 ![mark](http://oqxf7c508.bkt.clouddn.com/b

SSISDB8:查看SSISDB记录Package执行的消息

在执行Package时,SSISDB都会创建唯一的OperationID 和 ExecutionID,标识对package执行的操作和执行实例(Execution Instance),并记录operation message,统计executable的执行时间,便于developers 优化package的设计,对package进行故障排除. 一,在package发生错误时,查看失败的Executable An executable is a task or container that you

linux查看cpu个数,核数,逻辑cpu个数

物理CPU:物理CPU是相对于虚拟CPU而言的概念,指实际存在的处理器,就是我们可以看的见,摸得着的CPU,就是插在主板上面的. 物理核:CPU中包含的物理内核个数,比如我们通常说的双核CPU,单核CPU. 在linux系统下面的/proc/cpuinfo文件的条目中: 1.有多少个不同的physical id就有多少个物理CPU. 2.cpu cores记录了对应的物理CPU(以该条目中的physical id标识)有多少个物理核,现在我们个人使用的单机PC大部分使用的都是双核CPU. 逻辑C

一、查看Linux内核版本命令(两种方法):

一.查看Linux内核版本命令(两种方法): 1.cat /proc/version [[email protected]CentOS home]# cat /proc/versionLinux version 2.6.32-431.el6.x86_64 ([email protected]) (gcc version 4.4.7 20120313 (Red Hat 4.4.7-4) (GCC) ) #1 SMP Fri Nov 22 03:15:09 UTC 2013 2.uname -a [

Linux 查看端口使用情况

之前查询端口是否被占用一直搞不明白,问了好多人,终于搞懂了,现在总结下: 1.netstat  -anp  |grep   端口号 如下,我以3306为例,netstat  -anp  |grep  3306(此处备注下,我是以普通用户操作,故加上了sudo,如果是以root用户操作,不用加sudo即可查看),如下图1: 图1 图1中主要看监控状态为LISTEN表示已经被占用,最后一列显示被服务mysqld占用,查看具体端口号,只要有如图这一行就表示被占用了. 2.netstat   -nult

linux查看主机最后启动时间

1.使用who查看最后重启时间 who -b 2.使用last查看近几次重启时间 last reboot 第一条即为最后一次重启日期 last其实是查询用户的登录记录,reboot是一个伪用户:也就是你可以通过last查询其他用户的登录记录. 参考: http://www.linuxidc.com/Linux/2014-09/106489.htm