OSDN Git Service

Now track "active time" in procstats.
authorDianne Hackborn <hackbod@google.com>
Mon, 9 Jul 2018 16:09:05 +0000 (09:09 -0700)
committerDianne Hackborn <hackbod@google.com>
Mon, 9 Jul 2018 19:46:53 +0000 (12:46 -0700)
commit95031ef2e6a6a00681ade493b353f8d443cafc0c
tree0e0abdc385f2e75d01c831961071a23372534568
parentbad8de914ad0edcc3dcafe217cecb9bd98ca7f72
Now track "active time" in procstats.

Associations now keep track of the time they are
actively involved in impacting their target application.
This is based on the procstate propagating through the
association being the same as the procstate of its target
process...  so it may count as active when there is
another reason for that process to be in the same state.

To do this, we now maintain a set of "tracking
associations" -- these are in-use associations that
we know we need to be tracking to determine whether
they are active.  This list is built based on whether
we at all consider an association during an oom_adj
computation, and at the end of that walked to determine
which of those associations are currently active.

Also add tracking of associations through external
provider references, with a tag name now needing to be
passed through so we can mark up the reason for the
external reference.

Test: manual
Bug: 110957691
Change-Id: I426a499834e20a9d7f2b439faf9cb398d9792fa2
12 files changed:
cmds/content/src/com/android/commands/content/Content.java
cmds/uiautomator/library/testrunner-src/com/android/uiautomator/core/ShellUiAutomatorBridge.java
core/java/android/app/IActivityManager.aidl
core/java/com/android/internal/app/procstats/AssociationState.java
core/java/com/android/internal/app/procstats/ProcessState.java
core/java/com/android/internal/app/procstats/ProcessStats.java
core/java/com/android/internal/app/procstats/ServiceState.java
services/core/java/com/android/server/am/ActivityManagerService.java
services/core/java/com/android/server/am/ConnectionRecord.java
services/core/java/com/android/server/am/ContentProviderConnection.java
services/core/java/com/android/server/am/ContentProviderRecord.java
services/core/java/com/android/server/am/ProcessStatsService.java