dumpsys procstats详解

简介

  procstats 工具用于分析应用内存在一段时间内的使用情况(而不像 meminfo 一样在特定时间点捕获快照)。其状态转储会显示每个应用的运行时间、比例集合大小 (PSS) 和唯一集合大小 (USS) 的统计信息–引用自官网介绍查看 RAM 使用情况数据 (procstats)
  Android内部将内存状态划分为四个等级:Norm/Mod/Low/Crit,按内存的使用情况从轻度到重度的顺序排列;将屏幕状态划分为两个等级:SOff/SOn,分别表示息屏和亮屏;将进程状态按优先级从高到低划分为14个等级:Persistent/Top/Imp Fg/Imp Bg/Backup/Service/Service Rs/Receiver/Heavy Wgt/(Home)/(Last Act)/(Cch Act)/(Cch CAct)/(Cch Emty),带括号的状态被视为不活跃状态。内存状态,屏幕状态个进程状态自由组合成(内存状态数量+屏幕使用状态)*进程状态 数量的bucket,系统会统计每个bucket的持续时间,内存使用状况。
  Persistent:对应ActivityManager.PROCESS_STATE_PERSISTENT和ActivityManager.PROCESS_STATE_PERSISTENT_UI,对应persistent的系统组件;
  Top:对应ActivityManager.PROCESS_STATE_TOP和ActivityManager.PROCESS_STATE_TOP_SLEEPING,分别对应用户正在交互的进程状态和睡眠状态下用户正在交互的进程状态;
  Imp Fg:对应ActivityManager.PROCESS_STATE_FOREGROUND_SERVICE_LOCATION,ActivityManager.PROCESS_STATE_BOUND_TOP,ActivityManager.PROCESS_STATE_FOREGROUND_SERVICE,ActivityManager.PROCESS_STATE_BOUND_FOREGROUND_SERVICE,ActivityManager.PROCESS_STATE_IMPORTANT_FOREGROUND,分别表示正在运行位置信息相关的服务进程状态,绑定了用户正在交互的组件的进程状态,正在运行前台服务的进程状态,绑定了运行前台服务组件的进程状态,前台重要进程状态。
  Imp Bg:对应ActivityManager.PROCESS_STATE_IMPORTANT_BACKGROUND和ActivityManager.PROCESS_STATE_TRANSIENT_BACKGROUND,分别表示后台重要服务进程状态,暂时性的后台进程运行状态。PROCESS_STATE_TRANSIENT_BACKGROUND通常是使用BIND_NOT_FOREGROUND的flag来绑定服务的进程状态,PROCESS_STATE_IMPORTANT_BACKGROUND通常是使用BIND_IMPORTANT_BACKGROUND的flag开绑定服务的进程状态。
  Backup:对应ActivityManager.PROCESS_STATE_BACKUP,表示在后台进行备份服务的进程状态。
  Service:对应ActivityManager.PROCESS_STATE_SERVICE,表示含有显式启动(startservice)的或正在执行生命周期(create,start,bind,destroy等)的Service的进程状态。
  Service Rs:表示正在启动或者重启一个服务且当时该进程只有这一个服务的进程状态。在随后的启动过程中进程状态会变化成Service状态。这个状态比较特殊,没有对应ActivityManager的任何常量。
  Receiver:对应ActivityManager.PROCESS_STATE_RECEIVER,表示正在处理广播的进程状态。
  Heavy Wgt:对应ActivityManager.PROCESS_STATE_HEAVY_WEIGHT,表示那些通过Manifest指明不能保存状态的应用进程状态(重量级进程)。
  (Home):对应ActivityManager.PROCESS_STATE_HOME,表示桌面进程状态。
  (Last Act):对应ActivityManager.PROCESS_STATE_LAST_ACTIVITY,表示上一个stopped但没有finish的activity所在的进程状态。
  (Cch Act):对应 ActivityManager.PROCESS_STATE_CACHED_ACTIVITY,如果一个进程含有不处于可见状态且不处于PAUSING,PAUSED和STOPPING状态的activity,所在进程便处于Cch Act状态。
  (Cch CAct):对应ActivityManager.PROCESS_STATE_CACHED_EMPTY,如果一个进程处于Cch Emty状态,但是有另一个含有activity的进程绑定了该Cch Emty状态的进程中的服务,就讲该进程的状态提升到Cch CAct。
  (Cch Emty):除了上述几种情况的进程,还包括没有初始化ActivityThread的进程毛都被划分成这类。
  注意,一个进程可能含有多个不同状态的activity,绑定了不同组件,或者被不同的组件绑定,进程状态的计算是按最高优先级的定的。例如,一个进程含有显式启动的服务(Service),同时含有一个STOPPED状态的activity(Last Act),那么该进程的状态将被定为Service而不是(Last Act)。

用法

Process stats (procstats) dump options:
    [--checkin|-c|--csv] [--csv-screen] [--csv-proc] [--csv-mem]
    [--details] [--full-details] [--current] [--hours N] [--last N]
    [--max N] --active] [--commit] [--reset] [--clear] [--write] [-h]
    [--start-testing] [--stop-testing] 
    [--pretend-screen-on] [--pretend-screen-off] [--stop-pretend-screen]
    [<package.name>]
  --checkin: perform a checkin: print and delete old committed states.
  -c: print only state in checkin format.
  --csv: output data suitable for putting in a spreadsheet.
  --csv-screen: on, off.
  --csv-mem: norm, mod, low, crit.
  --csv-proc: pers, top, fore, vis, precept, backup,
    service, home, prev, cached
  --details: dump per-package details, not just summary.
  --full-details: dump all timing and active state details.
  --current: only dump current state.
  --hours: aggregate over about N last hours.
  --last: only show the last committed stats at index N (starting at 1).
  --max: for -a, max num of historical batches to print.
  --active: only show currently active processes/services.
  --commit: commit current stats to disk and reset to start new stats.
  --section: proc|pkg-proc|pkg-svc|pkg-asc|pkg-all|all 
    options can be combined to select desired stats
  --reset: reset current stats, without committing.
  --clear: clear all stats; does both --reset and deletes old stats.
  --write: write current in-memory stats to disk.
  --read: replace current stats with last-written stats.
  --start-testing: clear all stats and starting high frequency pss sampling.
  --stop-testing: stop high frequency pss sampling.
  --pretend-screen-on: pretend screen is on.
  --pretend-screen-off: pretend screen is off.
  --stop-pretend-screen: forget "pretend screen" and use the real state.
  -a: print everything.
  -h: print this help text.
  <package.name>: optional name of package to filter output by.

输出信息

  使用常规的dumpsys procstats -a输出的内容可以划分成如下面代码所示:
  1."COMMITTED STATS FROM"一栏可能有多个,因为这个是通过读取/data/system/procstats下面的文件输出的,表示了从后面的日期到下一个"COMMITTED STATS FROM"指定的日期(如果没有,就是到dump的时间点)这段时间的概况;
  2."CURRENT STATS"一栏输出最近一次统计的情况;
  3."AGGREGATED OVER LAST 24 HOURS"一栏输出过去24小时的统计情况。不一定是完全的24小时,因为系统是通过查找/data/system/procstats下面的文件,从最新的往回读取,将总时间加起来满24小时的文件数据整合起来输出。
  4."AGGREGATED OVER LAST 3 HOURS"一栏输出过去3小时的统计情况。不一定是完全的3小时,因为系统是通过查找/data/system/procstats下面的文件,从最新的往回读取,将总时间加起来满3小时的文件数据整合起来输出。

adb shell dumpsys procstats -a

COMMITTED STATS FROM 日期
	{Process summary}
	{Run time Stats}
	{Memory usage}
	{PSS collection stats}
COMMITTED STATS FROM 日期
	{Process summary}
	{Run time Stats}
	{Memory usage}
	{PSS collection stats}
CURRENT STATS
	{System memory usage}
	{Per-Package Stats}
	{Multi-Package Common Processes}
	{Tracking associations}
	{Process summary}
	{Run time Stats}
	{Memory usage}
	{PSS collection stats}
	{Internal state}
	{Available pages by page size}
AGGREGATED OVER LAST 24 HOURS
	{System memory usage}
	{Per-Package Stats}
	{Multi-Package Common Processes}
	{Process summary}
	{Run time Stats}
	{Memory usage}
	{PSS collection stats}
	{Internal state}
	{Available pages by page size}
AGGREGATED OVER LAST 3 HOURS
	{System memory usage}
	{Per-Package Stats}
	{Multi-Package Common Processes}
	{Process summary}
	{Run time Stats}
	{Memory usage}
	{PSS collection stats}
	{Internal state}
	{Available pages by page size}

Process summary

  Process summary:统计了所有包的所在的进程的简要状态。如果需要更详细的所有包的信息,需要加上"–details"/"–full-details"/"-a"参数。以"com.qualcomm.qti.services.secureui:sui_service / u0a169 / v1"为例,以’/'为分隔符,从左到右分别时是进程名,UID,版本号。
  每个进程下面的每一行表示各种状态的数据,非cache状态就是Persistent/Top/Imp Fg/Imp Bg/Backup/Service/Service Rs/Receiver/Heavy Wgt这些状态。对于cache状态((Home)/(Last Act)/(Cch Act)/(Cch CAct)/(Cch Emty)),系统会单独进行计算,不计入TOTAL一栏。如果某个状态运行时间占比很小,会不列出这一行的数据,包括TOTAL一栏。
  百分比数字是指某个状态占总时间的百分比。例如“8.9MB-9.0MB-9.1MB/400KB-627KB-1.1MB/16MB-21MB-27MB over 4“表示“PSS数据/USS数据/RSS数据 over 样本数”。每个内存数据按‘-’作为分隔符,从左到右分别是最小值,平均值和最大值。

adb shell dumpsys procstats -a

Process summary:
  * com.qualcomm.qti.services.secureui:sui_service / u0a169 / v1:
         TOTAL: 100% (9.2MB-9.2MB-9.2MB/672KB-672KB-672KB/27MB-27MB-27MB over 1)
    Persistent: 100% (9.2MB-9.2MB-9.2MB/672KB-672KB-672KB/27MB-27MB-27MB over 1)
  * com.netease.cloudmusic:play / u0a222 / v7003010:
         TOTAL: 100% (97MB-97MB-97MB/62MB-62MB-62MB/112MB-112MB-112MB over 1)
        Imp Fg: 100% (97MB-97MB-97MB/62MB-62MB-62MB/112MB-112MB-112MB over 1)
  * .dataservices / 1001 / v1:
         TOTAL: 100% (39MB-39MB-39MB/1.5MB-1.5MB-1.5MB/32MB-32MB-32MB over 1)
    Persistent: 100% (39MB-39MB-39MB/1.5MB-1.5MB-1.5MB/32MB-32MB-32MB over 1)
  * com.android.ims.rcsservice / 1001 / v1:
         TOTAL: 100% (9.2MB-9.2MB-9.2MB/456KB-456KB-456KB/29MB-29MB-29MB over 1)
    Persistent: 100% (9.2MB-9.2MB-9.2MB/456KB-456KB-456KB/29MB-29MB-29MB over 1)
  * com.netease.cloudmusic / u0a222 / v7003010:
         TOTAL: 100% (237MB-237MB-237MB/176MB-176MB-176MB/231MB-231MB-231MB over 1)
        Imp Fg: 100% (237MB-237MB-237MB/176MB-176MB-176MB/231MB-231MB-231MB over 1)
  * com.google.android.gms / u0a124 / v203315046:
         TOTAL: 100% (111MB-111MB-111MB/75MB-75MB-75MB/135MB-135MB-135MB over 1)
        Imp Fg: 100% (111MB-111MB-111MB/75MB-75MB-75MB/135MB-135MB-135MB over 1)
        ...
  * com.google.process.gservices / u0a124 / v30:
    (Last Act): 6.3% (9.0MB-9.0MB-9.0MB/3.9MB-3.9MB-3.9MB/38MB-38MB-38MB over 1)
      (Cached): 94%

PSS collection stats

  PSS collection stats:描述了统计时间等信息。Start time是开始统计的时间,Total uptime和Total elapsed time分别是统计不包括深度睡眠时间在内的持续的时间和包括深度睡眠时间在内的持续的时间,Aggregated over是表示输出信息来源于几份数据,一般是1。

adb shell dumpsys procstats -a

PSS collection stats:
  Internal Single: 54x over +704ms
  Internal All Procs (Memory Change): 0x over 0
  Internal All Procs (Polling): 79x over +1s129ms
  External: 0x over 0
  External Slow: 8x over +887ms

          Start time: 2020-09-28 00:09:58
        Total uptime: +43m12s747ms
  Total elapsed time: +43m12s747ms (complete) libart.so

  Run time Stats:描述系统运行状态。如下所示:系统在熄屏/正常内存使用状况(SOff/Norm)下运行了39m2s685ms,而且当前还在该状态下运行(running);在熄屏/中度内存使用状况(SOff/Mod,输出内容省略了SOff)下运行了30s985ms;在亮屏/正常内存使用状况(SOn/Norm)下使用了9m18s303ms;在亮屏/中度内存使用状况(SOn/Mod)下使用了8s479ms;在亮屏/低内存使用状态(SOn/Low)下使用了2s319ms,在亮屏/紧急内存使用状态(SOn/Crit)下使用了
1s674ms,总计时间是49m4s445ms。该时间是从上一次提交(commit)的时间点到dump的时间点统计的,并不是开机的时间点统计的时间。

adb shell dumpsys procstats -a

Run time Stats:
  SOff/Norm: +39m2s685ms (running)
        Mod: +30s985ms
   SOn/Norm: +9m18s303ms
        Mod: +8s479ms
        Low: +2s319ms
       Crit: +1s674ms
      TOTAL: +49m4s445ms

  AGGREGATED OVER LAST 24 HOURS:描述了过去24小时所有包的所在的进程的简要状态。

adb shell dumpsys procstats

AGGREGATED OVER LAST 24 HOURS:
  * com.netease.cloudmusic:videoplay / u0a222 / v7003010:
         TOTAL: 100% (26MB-26MB-27MB/220KB-5.2MB-9.2MB/14MB-25MB-42MB over 7)
        Imp Fg: 0.62%
       Service: 99% (26MB-26MB-27MB/220KB-5.2MB-9.2MB/14MB-25MB-42MB over 7)
  * com.google.android.ext.services / u0a213 / v300900700:
         TOTAL: 100% (22MB-23MB-24MB/556KB-1.6MB-3.4MB/26MB-36MB-42MB over 8)
        Imp Fg: 100% (22MB-23MB-24MB/556KB-1.6MB-3.4MB/26MB-36MB-42MB over 8)

  AGGREGATED OVER LAST 3 HOURS:描述了过去3小时所有包的所在的进程的简要状态。

adb shell dumpsys procstats

AGGREGATED OVER LAST 3 HOURS:
  * com.google.android.apps.scone / u0a113 / v10629:
         TOTAL: 100% (13MB-14MB-15MB/1.9MB-3.2MB-5.1MB/26MB-34MB-41MB over 4)
        Imp Bg: 0.03%
       Service: 100% (13MB-14MB-15MB/1.9MB-3.2MB-5.1MB/26MB-34MB-41MB over 4)
  * com.google.android.ims / u0a141 / v30252713:
         TOTAL: 100% (17MB-19MB-20MB/2.9MB-5.9MB-8.2MB/25MB-35MB-43MB over 4)
        Imp Bg: 0.01%
       Service: 100% (17MB-19MB-20MB/2.9MB-5.9MB-8.2MB/25MB-35MB-43MB over 4)

Per-Package Stats

   Per-Package Stats:如果使用了"–details"/"–full-details"/“-a”参数,输出信息会以"Per-Package Stats"为开头将更加详细的信息展现出来:
  每个顶层*后面是包名/UID/版本号。以下面的com.google.android.youtube包名为例说明。每个包名最多可分为三个部分:Process,Service,Association。
  Process:后面是包含的进程名称:com.google.android.youtube。unique表示该进程是该包定义的非共用进程,multi表示该进程是共用进程,可以通过android:process属性配置运行在该进程。entries表示了进程的状态数量。com.google.android.youtube有6个entries,分别是SOff/Norm/Imp Bg,
SOff/Norm/Service,SOff/Norm/Receiver,SOff/Norm/ (Cch Emty),SOff/Mod/(Cch Emty),SOn/Norm/(Cch Emty)。输出信息在后面标注了这些状态的持续时间。
  PSS/USS表示内存的使用数据,entries表示状态数量(Youtube只有一个SOff/Norm/(Cch Emty)),后面信息是“PSS最小值-PSS平均值-PSS最大值/USS最小值-USS平均值-USS最大值/RSS最小值-RSS平均值-RSS最大值 over 样本数”。
  Cur time表示最近一次处于运行状态的持续时间。如果时间后面带有(running)的字眼,说明使用dump命令的时候该进程还处于运行状态。myID是一个标识唯一性的哈希值,mCommonProcess也是一个标识唯一性的哈希值。参考前面所述,如果进程是unique的,mCommonProcess和myID相同;如果进程是multi的,mCommonProcess是那个共用进程的唯一性标识值。mPackage是定义进程的包名,视进程是unique还是multi有不同的值。

  Service:后面是包含的服务名称:androidx.work.impl.background.systemjob.SystemJobService。Process表明服务所在的进程名称。"op count"统计了服务的各种行为计数。"Started op count"表示服务被显式启动(例如调用startService)或重启的次数(例如重启被杀的persistent服务)的次数;"Running op count"表示服务被运行起来的次数,“被运行”可以理解为服务从未启动状态变成显式启动(例如调用startService),绑定(例如调用bindService),执行生命周期(onCreate,onStart,onBind,onDestroy等)等状态的次数;"Bound op count"表示服务被绑定(例如调用bindService)的次数;“Executing op count"表示服务执行生命周期(onCreate,onStart,onBind,onDestroy等)等状态的次数。每个"op count"的下一行还显示了服务在这些"op count"动作期间,处于各种进程状态的时间。在当前的进程状态后面,输出信息会添加”(running)"标识。

  Association:后面是包里面的内容提供器或服务。Association描述了其他组件和这些内容提供器或服务的联系。Process是这些内容提供器或服务所处的进程。mNumActive是与这些内容提供器或服务有关系的活跃组件数量,如果发起联系的组件是活跃的,后面会带"(running)"标识。
  "<-“后面是和这些内容提供器或服务有关联的组件信息。以”<- com.google.android.gms/u0a154 (com.google.android.gms):“为例,意思是组件名称是com.google.android.gms,UID是u0a154,所在包名是com.google.android.gms。Total count表示了其他组件发生关联的次数,Active count表示其他组件发生关联且处于活跃状态的次数(活跃状态:进程状态比(Home)优先级高),后面的”(inline)“表明活跃状态只有一种,如果是”(multi-field)"表明活跃状态不只有一种。在下面的几行里,输出信息会列出这些状态的名字,持续时间,和持续时间占比。

adb shell dumpsys procstats -a

Per-Package Stats:
  * com.google.android.youtube / u0a186 / v1425573400:
      Process com.google.android.youtube (unique, 7 entries):
        SOff/Norm/  Receiver: +366ms
                  (Cch Emty): +7m26s961ms
         SOn/Norm/    Imp Fg: +2s994ms
                      Imp Bg: +3m37s698ms
                     Service: +1s300ms
                    Receiver: +10s509ms
                  (Cch Emty): +24m48s420ms
                       TOTAL: +36m8s248ms
        PSS/USS (3 entries):
          SOff/Norm/(Cch Emty): 49MB-49MB-49MB/42MB-42MB-42MB/0.00-0.00-0.00 over 1
           SOn/Norm/    Imp Bg: 50MB-50MB-50MB/42MB-42MB-42MB/0.00-0.00-0.00 over 4
                    (Cch Emty): 44MB-47MB-50MB/38MB-41MB-43MB/0.00-0.00-0.00 over 12
        myID=4730da7 mCommonProcess=4730da7 mPackage=com.google.android.youtube
      Service com.google.firebase.iid.FirebaseInstanceIdService:
        Process: com.google.android.youtube
        Running op count 1:
          SOff/Norm: +12s256ms
           SOn/Norm: +2m47s268ms
              TOTAL: +2m59s524ms
        Bound op count 1:
          SOff/Norm: +12s256ms
           SOn/Norm: +2m47s268ms
              TOTAL: +2m59s524ms
        Executing op count 1:
           SOn/Norm: +426ms
              TOTAL: +426ms
      Service com.google.android.apps.youtube.app.common.notification.FcmMessageListenerService:
        Process: com.google.android.youtube
        Running op count 1:
          SOff/Norm: +12s256ms
           SOn/Norm: +2m47s297ms
              TOTAL: +2m59s553ms
        Bound op count 1:
          SOff/Norm: +12s256ms
           SOn/Norm: +2m47s297ms
              TOTAL: +2m59s553ms
        Executing op count 1:
           SOn/Norm: +445ms
              TOTAL: +445ms
      Service com.firebase.jobdispatcher.GooglePlayReceiver:
        Process: com.google.android.youtube
        Running op count 2:
           SOn/Norm: +3s717ms
              TOTAL: +3s717ms
        Bound op count 2:
           SOn/Norm: +3s579ms
              TOTAL: +3s579ms
        Executing op count 4:
           SOn/Norm: +1s838ms
              TOTAL: +1s838ms
      Service com.google.android.apps.youtube.app.extensions.mediabrowser.impl.MainAppMediaBrowserService:
        Process: com.google.android.youtube
        Running op count 1:
           SOn/Norm: +1s511ms
              TOTAL: +1s511ms
        Bound op count 1:
           SOn/Norm: +1s400ms
              TOTAL: +1s400ms
        Executing op count 2:
           SOn/Norm: +1s297ms
              TOTAL: +1s297ms
      Service com.google.android.libraries.youtube.account.AccountsChangedJobIntentService:
        Process: com.google.android.youtube
        Running op count 1:
           SOn/Norm: +2s621ms
              TOTAL: +2s621ms
        Bound op count 1:
           SOn/Norm: +2s489ms
              TOTAL: +2s489ms
        Executing op count 2:
           SOn/Norm: +161ms
              TOTAL: +161ms
      Service com.google.android.apps.youtube.app.common.ads.AdIdListenerService:
        Process: com.google.android.youtube
        Running op count 2:
           SOn/Norm: +2s180ms
              TOTAL: +2s180ms
        Bound op count 2:
           SOn/Norm: +2s102ms
              TOTAL: +2s102ms
        Executing op count 4:
           SOn/Norm: +1s853ms
              TOTAL: +1s853ms
      Service com.google.android.libraries.youtube.common.gcore.gcoreclient.gcm.impl.GcmTaskServiceDelegator:
        Process: com.google.android.youtube
        Running op count 7:
           SOn/Norm: +3m35s273ms
              TOTAL: +3m35s273ms
        Bound op count 7:
           SOn/Norm: +3m34s266ms
              TOTAL: +3m34s266ms
        Executing op count 14:
           SOn/Norm: +8s198ms
              TOTAL: +8s198ms
      Service com.google.android.apps.youtube.app.application.system.LocaleUpdatedJobService:
        Process: com.google.android.youtube
        Running op count 1:
           SOn/Norm: +300ms
              TOTAL: +300ms
        Bound op count 1:
           SOn/Norm: +278ms
              TOTAL: +278ms
        Executing op count 2:
           SOn/Norm: +244ms
              TOTAL: +244ms
      Association com.firebase.jobdispatcher.GooglePlayReceiver:
        Process: com.google.android.youtube
        mNumActive=0
          <- com.google.android.gms.persistent/u0a154 (com.google.android.gms):
             Total count 2: Duration +3s312ms / 0.04%
             Active count 2 (inline):
                Imp Bg: Duration +3s312ms / 0.04%
                 TOTAL: Duration +3s312ms / 0.04%
      Association com.google.android.apps.youtube.app.extensions.mediabrowser.impl.MainAppMediaBrowserService:
        Process: com.google.android.youtube
        mNumActive=0
          <- com.android.bluetooth/1002 (com.android.bluetooth):
             Total count 1: Duration +1s217ms / 0.02%
             Active count 1 (inline):
                Imp Fg: Duration +1s217ms / 0.02%
                 TOTAL: Duration +1s217ms / 0.02%
      Association com.google.android.libraries.youtube.account.AccountsChangedJobIntentService:
        Process: com.google.android.youtube
        mNumActive=0
          <- system/1000 (android):
             Total count 1: Duration +2s486ms / 0.03%
             Active count 1 (inline):
                Imp Bg: Duration +2s486ms / 0.03%
                 TOTAL: Duration +2s486ms / 0.03%
      Association com.google.android.apps.youtube.app.common.ads.AdIdListenerService:
        Process: com.google.android.youtube
        mNumActive=0
          <- com.google.android.gms/u0a154 (com.google.android.gms):
             Total count 2: Duration +1s808ms / 0.02%
             Active count 2 (inline):
                Imp Fg: Duration +1s808ms / 0.02%
                 TOTAL: Duration +1s808ms / 0.02%
      Association com.google.android.libraries.youtube.common.gcore.gcoreclient.gcm.impl.GcmTaskServiceDelegator:
        Process: com.google.android.youtube
        mNumActive=0
          <- com.google.android.gms.persistent/u0a154 (com.google.android.gms):
             Total count 7: Duration +3m33s640ms / 2.9%
             Active count 7 (inline):
                Imp Bg: Duration +3m33s640ms / 2.9%
                 TOTAL: Duration +3m33s640ms / 2.9%

Multi-Package Common Processes

  Multi-Package Common Processes:共用进程信息。这一栏列出了系统中所有共用进程的信息。

adb shell dumpsys procstats -a

Tracking associations:
  #0: com.coloros.persist.system/1000 <- system/1000:
    Tracking for: +2h0m45s511ms
    Component: com.coloros.securitypermission/.permission.dialog.PermissionDialogService
    Proc state: ImpFg #120721
    Process: ProcessState{9a43f8d com.coloros.persist.system/1000 pkg=com.coloros.securitypermission (sub)}
    Active count 1: Duration +3m40s679ms / 100% (running)

  #1: com.coloros.persist.system/1000 <- com.android.systemui/u0a88:
    Tracking for: +2h0m44s543ms
    Component: com.coloros.notificationmanager/com.coloros.notification.NotificationCenterService
    Proc state: ImpFg #120721
    Process: ProcessState{d79d07a com.coloros.persist.system/1000 pkg=com.coloros.notificationmanager (sub)}
    Active count 1: Duration +3m40s679ms / 100% (running)

Tracking associations

  Tracking associations:这一栏关注处于活跃状态的关联(Association)。处于活跃状态的意思是发起关联的组件进程状态比(Home)优先级高。系统在发起联系的组件变成活跃状态时,会跟踪(Track)这个联系,直到联系结束。
  以下面的#0为例。"com.coloros.persist.system/1000 <- system/1000"表示时system进程对com.coloros.persist.system进程发起了联系,注意这里用的名称都是共用进程(如果有的话)的名称。Tracking for后面是跟踪持续时间。Component是发起联系的组件名称,Proc state后面是活跃进程当前状态的名称和oomadj调整序列号,Process是发起联系的组件进程信息,Active count是处于活跃状态的次数,其后的Duration是处于活跃状态的总时间。有时候跟踪持续时间比处于活跃状态的总时间小,是因为曾经活跃的联系结束后来又建立了活跃的联系,导致活跃状态的累计时间比跟踪持续时间长。

adb shell dumpsys procstats -a

Tracking associations:
  #0: com.coloros.persist.system/1000 <- system/1000:
    Tracking for: +2h0m45s511ms
    Component: com.coloros.securitypermission/.permission.dialog.PermissionDialogService
    Proc state: ImpFg #120721
    Process: ProcessState{9a43f8d com.coloros.persist.system/1000 pkg=com.coloros.securitypermission (sub)}
    Active count 1: Duration +3m40s679ms / 100% (running)

  #1: com.coloros.persist.system/1000 <- com.android.systemui/u0a88:
    Tracking for: +2h0m44s543ms
    Component: com.coloros.notificationmanager/com.coloros.notification.NotificationCenterService
    Proc state: ImpFg #120721
    Process: ProcessState{d79d07a com.coloros.persist.system/1000 pkg=com.coloros.notificationmanager (sub)}
    Active count 1: Duration +3m40s679ms / 100% (running)

Internal state

  Internal state:表示当前的数据是否是记录在运行的系统中,如果是false,说明数据是从历史记录中得出来的。一般在CURRENT STATS标题下才为true,诸如AGGREGATED OVER LAST 24 HOURS之类的标题下为false。

adb shell dumpsys procstats -a

Internal state:
  mRunning=true
©️2020 CSDN 皮肤主题: 编程工作室 设计师:CSDN官方博客 返回首页