OSDN Git Service

system suspend: more information about wake locks
authorTri Vo <trong@google.com>
Fri, 9 Nov 2018 02:24:52 +0000 (18:24 -0800)
committerTri Vo <trong@google.com>
Fri, 7 Dec 2018 03:45:51 +0000 (19:45 -0800)
commitba81fb29c4998647baf5fe0fa313a14d87b92eff
tree9e226ae431529bf87bdb58dcb55794bd1f83a27b
parent25f58c7312769068de495af9de11d1a04071ce96
system suspend: more information about wake locks

/sys/power/{wake_lock wake_unlock} can give a list of all currently
active and inactive wake lock names. Bring system suspend debug
functionality up to par by keeping track of all used wake lock names,
client pids, current state and last used timestamp.

To prevent collected stats from growing unboundedly we evict least
recently used stats entry after a given threshold.

Bug: 78888165
Test: SystemSuspendV1_0UnitTest
Change-Id: I26eb94e61d4656ec1bba45b4a70a0715fae15d05
suspend/1.0/default/SystemSuspend.cpp
suspend/1.0/default/SystemSuspend.h
suspend/1.0/default/SystemSuspendStats.proto
suspend/1.0/default/SystemSuspendUnitTest.cpp
suspend/1.0/default/main.cpp