I'm looking at the out of the following command "adb shell dumpsys cpuinfo" where I want to know if these reported values are averages over previous time ?
D:\Android_Dev\Android_sdk\platform-tools>adb shell dumpsys cpuinfo
Load: 4.03 / 3.43 / 2.44
CPU usage from 23770ms to 16630ms ago:
58% 1844/logd: 58% user + 0% kernel / faults: 3 minor
50% 3895/com.google.android.wearable.app:ui: 41% user + 9.3% kernel / faults: 1798 minor
26% 1864/adbd: 2.8% user + 23% kernel / faults: 1243 minor
22% 4880/logcat: 7.8% user + 15% kernel
9.7% 7834/kworker/0:2: 0% user + 9.7% kernel
4.9% 2198/system_server: 2.6% user + 2.2% kernel / faults: 76 minor
My questions are as follows:
- what does faults represent here ?
- what does these percentage values represent because they don't add up to 100 ?
- are these percentage values averages of the respective processes such as as 58% for logd?
CPU usage from 23770ms to 16630ms ago:
what does this mean ? does it mean that these values are the average from last 23 to 16 seconds ?
shows info from /proc/stat and /proc/(pid)/stat
Page faults.
"minor" for minor faults.
from ProcessCpuTracker.java
They are /proc/(pid)/stat data[9] and data[11].
http://blog.scoutapp.com/articles/2009/07/31/understanding-load-averages
(Linked page from interpreting dumpsys cpuinfo)
With multi-processor system, sum can be more than 100%.
from ProcessCpuTracker.java
2nd parameter(user+...) / 3rd parameter(totalTime) is printed.
Times are based on times when stat data cached by ProcessCpuTracker is updated.
from ProcessCpuTracker.java
[Related sources]
https://android.googlesource.com/platform/frameworks/native/+/master/cmds/dumpsys/dumpsys.cpp
main() => service->dump()
https://github.com/android/platform_frameworks_base/blob/master/services/core/java/com/android/server/am/ActivityManagerService.java
CpuBinder.dump() is called
mProcessCpuThread updates stat cache. (updateCpuStatsNow() is called)
https://github.com/android/platform_frameworks_base/blob/master/core/java/com/android/internal/os/ProcessCpuTracker.java
printCurrentLoad() prints CPU load
printCurrentState() prints per process stats