History log of /frameworks/base/services/core/java/com/android/server/LockGuard.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
5f3e93451e87d72c513e75c5d5459a4bd2cc41b2 13-Mar-2017 Jeff Sharkey <jsharkey@android.com> Lower-overhead version of LockGuard.

Instead of building up a giant set of all locks inside the system
server, there are only a handful that we're interested in watching:
specifically those below the ActivityManagerService lock.

This change adds a index-based variant of lock registering and
checking, which has much lower overhead that doesn't bring a device
to its knees. It's disabled by default, but can be enabled on local
development builds.

Currently uses the boostPriorityForLockedSection() hook in AMS to
check for lock inversions when enabled.

Test: builds, boots, no AMS lock inversions detected
Bug: 35410906
Change-Id: I473d634d23c08538029412a1254bf4f92b96fb84
/frameworks/base/services/core/java/com/android/server/LockGuard.java
3d1cb6a2b6882a9b702fc97aa50b2d5779956492 28-Feb-2016 Jeff Sharkey <jsharkey@android.com> Utility to detect lock inversions in system.

This change adds a new LockGuard utility class that can be used to
detect lock inversions across the system server. For example, if a
thread is trying to acquire the ActivityManager lock while holding the
PackageManager lock, it will yell.

This class requires no prior knowledge of locks or their ordering; it
derives all of this data at runtime. However, this means the overhead
is substantial and it should not be enabled by default.

Adds overrides to ArrayMap and ArraySet to use identityHashCode()
instead of the hashCode() provided by the object.

Bug: 27336728
Change-Id: I26c31bc99fe8d61ff13c3455aaeddd5517e44433
/frameworks/base/services/core/java/com/android/server/LockGuard.java