Home | History | Annotate | Download | only in source
      1 page.title=Reading Bug Reports
      2 @jd:body
      3 
      4 <!--
      5     Copyright 2015 The Android Open Source Project
      6 
      7     Licensed under the Apache License, Version 2.0 (the "License");
      8     you may not use this file except in compliance with the License.
      9     You may obtain a copy of the License at
     10 
     11         http://www.apache.org/licenses/LICENSE-2.0
     12 
     13     Unless required by applicable law or agreed to in writing, software
     14     distributed under the License is distributed on an "AS IS" BASIS,
     15     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     16     See the License for the specific language governing permissions and
     17     limitations under the License.
     18 -->
     19 <div id="qv-wrapper">
     20   <div id="qv">
     21     <h2>In this document</h2>
     22     <ol id="auto-toc">
     23     </ol>
     24   </div>
     25 </div>
     26 
     27 <p>Bugs are a reality in any type of development&#8212;and bug reports are
     28 critical to identifying and solving problems. All versions of Android support
     29 capturing bug reports with <a href="http://developer.android.com/tools/help/adb.html">Android
     30 Debug Bridge (adb)</a>; Android versions 4.2 and higher support a
     31 <a href="http://developer.android.com/tools/device.html#developer-device-options">Developer
     32 Option</a> for taking bug reports and sharing via email, Drive, etc.</p>
     33 
     34 <p>Android bug reports contain <code>dumpsys</code>, <code>dumpstate</code>, and
     35 <code>logcat</code> data in text (.txt) format, enabling you to easily search
     36 for specific content. The following sections detail bug report components,
     37 describe common problems, and give helpful tips and <code>grep</code> commands
     38 for finding logs associated with those bugs. Most sections also include examples
     39 for <code>grep</code> command and output and/or <code>dumpsys</code> output.</p>
     40 
     41 <h2 id="logcat">Logcat</h2>
     42 <p>The <code>logcat</code> log is a string-based dump of all <code>logcat</code>
     43 information. The <strong>system</strong> part is reserved for the framework and
     44 has a longer history than <strong>main</strong> which contains everything else.
     45 Each line starts with <code>timestamp PID TID log-level</code>.</p>
     46 
     47 <div class="toggle-content closed">
     48   <p><a href="#" onclick="return toggleContent(this)">
     49     <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img" />
     50     <strong><span class="toggle-content-text">Show example</span>
     51     <span class="toggle-content-text" style="display:none;">Hide example</span></strong>
     52   </a></p>
     53 
     54   <div class="toggle-content-toggleme">
     55     <p><pre>------ SYSTEM LOG (logcat -v threadtime -d *:v) ------
     56 --------- beginning of system
     57 <i>Blah</i>
     58 <i>Blah</i>
     59 <i>Blah</i>
     60 
     61 --------- beginning of main
     62 <i>Blah </i>
     63 <i>Blah</i>
     64 <i>Blah</i></pre></p>
     65   </div>
     66 </div>
     67 
     68 <h3 id="event-log">Viewing the event log</h3>
     69 <p>This log contains string representations of binary-formatted log messages. It
     70 is less noisy than the <code>logcat</code> log but also a little harder to read.
     71 When viewing event logs, you can search this section for specific process ID
     72 (PID) to see what a process has been doing. The basic format is:
     73 <code>timestamp PID TID log-level log-tag tag-values</code>.</p>
     74 
     75 <p>Log levels include the following:</p>
     76 <ul>
     77 <li>V: verbose</li>
     78 <li>D: debug</li>
     79 <li>I: information</li>
     80 <li>W: warning</li>
     81 <li>E: error</li>
     82 </ul>
     83 
     84 <div class="toggle-content closed">
     85   <p><a href="#" onclick="return toggleContent(this)">
     86     <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img" />
     87     <strong><span class="toggle-content-text">Show example</span>
     88     <span class="toggle-content-text" style="display:none;">Hide example</span></strong>
     89   </a></p>
     90 
     91   <div class="toggle-content-toggleme">
     92     <p><pre>------ EVENT LOG (logcat -b events -v threadtime -d *:v) ------
     93 09-28 13:47:34.179   785  5113 I am_proc_bound: [0,23054,com.google.android.gms.unstable]
     94 09-28 13:47:34.777   785  1975 I am_proc_start: [0,23134,10032,com.android.chrome,broadcast,com.android.chrome/org.chromium.chrome.browser.precache.PrecacheServiceLauncher]
     95 09-28 13:47:34.806   785  2764 I am_proc_bound: [0,23134,com.android.chrome]
     96 ...</pre></p>
     97   </div>
     98 </div>
     99 <p>&nbsp;</p>
    100 <p>For other useful event log tags, refer to
    101 <a href="https://android.googlesource.com/platform/frameworks/base/+/master/services/core/java/com/android/server/EventLogTags.logtags">/services/core/java/com/android/server/EventLogTags.logtags</a>.</p>
    102 
    103 <h2 id="anrs-deadlocks">ANRs and deadlocks</h2>
    104 <p>Bugreports can help you identify what's causing
    105 <a href="http://developer.android.com/training/articles/perf-anr.html">Application
    106 Not Responding (ANR)</a> errors and deadlock events.</p>
    107 
    108 <h3 id="determine-anr-app">Identifying unresponsive apps</h3>
    109 <p>When an application does not respond within a certain time, usually due to a
    110 blocked or busy main thread, the system kills the process and dumps the stack to
    111 <code>/data/anr</code>. To discover the culprit behind an ANR, grep for
    112 <code>am_anr</code> in the binary event log.</p>
    113 
    114 <div class="toggle-content closed">
    115   <p><a href="#" onclick="return toggleContent(this)">
    116     <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img" />
    117     <strong><span class="toggle-content-text">Show example</span>
    118     <span class="toggle-content-text" style="display:none;">Hide example</span></strong>
    119   </a></p>
    120   <div class="toggle-content-toggleme">
    121     <p><pre>grep "am_anr" bugreport-2015-10-01-18-13-48.txt
    122 10-01 18:12:49.599  4600  4614 I am_anr  : [0,29761,com.google.android.youtube,953695941,executing service com.google.android.youtube/com.google.android.apps.youtube.app.offline.transfer.OfflineTransferService]
    123 10-01 18:14:10.211  4600  4614 I am_anr  : [0,30363,com.google.android.apps.plus,953728580,executing service com.google.android.apps.plus/com.google.android.apps.photos.service.PhotosService]</pre></p>
    124   </div>
    125 </div>
    126 <p></p>
    127 <p>You can also grep for <code>ANR in</code> in the <code>logcat</code> log,
    128 which contains more information about what was using CPU at the time of the ANR.
    129 </p>
    130 
    131 <div class="toggle-content closed">
    132   <p><a href="#" onclick="return toggleContent(this)">
    133     <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img" />
    134     <strong><span class="toggle-content-text">Show example</span>
    135     <span class="toggle-content-text" style="display:none;">Hide example</span></strong>
    136   </a></p>
    137 
    138   <div class="toggle-content-toggleme">
    139     <p><pre>grep "ANR in" bugreport-2015-10-01-18-13-48.txt
    140 10-01 18:13:11.984  4600  4614 E ActivityManager: ANR in com.google.android.youtube
    141 10-01 18:14:31.720  4600  4614 E ActivityManager: ANR in com.google.android.apps.plus
    142 10-01 18:14:31.720  4600  4614 E ActivityManager: PID: 30363
    143 10-01 18:14:31.720  4600  4614 E ActivityManager: Reason: executing service com.google.android.apps.plus/com.google.android.apps.photos.service.PhotosService
    144 10-01 18:14:31.720  4600  4614 E ActivityManager: Load: 35.27 / 23.9 / 16.18
    145 10-01 18:14:31.720  4600  4614 E ActivityManager: CPU usage from 16ms to 21868ms later:
    146 10-01 18:14:31.720  4600  4614 E ActivityManager:   74% 3361/mm-qcamera-daemon: 62% user + 12% kernel / faults: 15276 minor 10 major
    147 10-01 18:14:31.720  4600  4614 E ActivityManager:   41% 4600/system_server: 18% user + 23% kernel / faults: 18597 minor 309 major
    148 10-01 18:14:31.720  4600  4614 E ActivityManager:   32% 27420/com.google.android.GoogleCamera: 24% user + 7.8% kernel / faults: 48374 minor 338 major
    149 10-01 18:14:31.720  4600  4614 E ActivityManager:   16% 130/kswapd0: 0% user + 16% kernel
    150 10-01 18:14:31.720  4600  4614 E ActivityManager:   15% 283/mmcqd/0: 0% user + 15% kernel
    151 ...
    152 10-01 18:14:31.720  4600  4614 E ActivityManager:   0.1% 27248/irq/503-synapti: 0%
    153 10-01 18:14:31.721  4600  4614 I ActivityManager: Killing 30363:com.google.android.apps.plus/u0a206 (adj 0): bg anr</pre></p>
    154   </div>
    155 </div>
    156 
    157 <h3 id="find-stack-traces">Finding stack traces</h3>
    158 <p>You can often find stack traces that correspond to an ANR. Make sure the
    159 timestamp and PID on the VM traces match the ANR you are investigating, then
    160 check the main thread of the process. Keep in mind:</p>
    161 <ul>
    162 <li>The main thread tells you only what the thread was doing at the time of the
    163 ANR, which may or may not correspond to the true cause of the ANR. (The stack in
    164 the bug report may be innocent; something else may have been stuck for a long
    165 time&#8212;but not quite long enough to ANR&#8212;before becoming unstuck.)
    166 </li>
    167 <li>More than one set of stack traces (<code>VM TRACES JUST NOW</code> and
    168 <code>VM TRACES AT LAST ANR</code>) might exist. Make sure you are viewing the
    169 correct section.</li>
    170 </ul>
    171 
    172 <div class="toggle-content closed">
    173   <p><a href="#" onclick="return toggleContent(this)">
    174     <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img" />
    175     <strong><span class="toggle-content-text">Show example</span>
    176     <span class="toggle-content-text" style="display:none;">Hide example</span></strong>
    177   </a></p>
    178 
    179   <div class="toggle-content-toggleme">
    180     <p><pre>------ VM TRACES AT LAST ANR (/data/anr/traces.txt: 2015-10-01 18:14:41) ------
    181 
    182 ----- pid 30363 at 2015-10-01 18:14:11 -----
    183 Cmd line: com.google.android.apps.plus
    184 Build fingerprint: 'google/angler/angler:6.0/MDA89D/2294819:userdebug/dev-keys'
    185 ABI: 'arm'
    186 Build type: optimized
    187 Zygote loaded classes=3978 post zygote classes=27
    188 Intern table: 45068 strong; 21 weak
    189 JNI: CheckJNI is off; globals=283 (plus 360 weak)
    190 Libraries: /system/lib/libandroid.so /system/lib/libcompiler_rt.so /system/lib/libjavacrypto.so /system/lib/libjnigraphics.so /system/lib/libmedia_jni.so /system/lib/libwebviewchromium_loader.so libjavacore.so (7)
    191 Heap: 29% free, 21MB/30MB; 32251 objects
    192 Dumping cumulative Gc timings
    193 Total number of allocations 32251
    194 Total bytes allocated 21MB
    195 Total bytes freed 0B
    196 Free memory 9MB
    197 Free memory until GC 9MB
    198 Free memory until OOME 490MB
    199 Total memory 30MB
    200 Max memory 512MB
    201 Zygote space size 1260KB
    202 Total mutator paused time: 0
    203 Total time waiting for GC to complete: 0
    204 Total GC count: 0
    205 Total GC time: 0
    206 Total blocking GC count: 0
    207 Total blocking GC time: 0
    208 
    209 suspend all histogram:  Sum: 119.728ms 99% C.I. 0.010ms-107.765ms Avg: 5.442ms Max: 119.562ms
    210 DALVIK THREADS (12):
    211 "Signal Catcher" daemon prio=5 tid=2 Runnable
    212   | group="system" sCount=0 dsCount=0 obj=0x12c400a0 self=0xef460000
    213   | sysTid=30368 nice=0 cgrp=default sched=0/0 handle=0xf4a69930
    214   | state=R schedstat=( 9021773 5500523 26 ) utm=0 stm=0 core=1 HZ=100
    215   | stack=0xf496d000-0xf496f000 stackSize=1014KB
    216   | held mutexes= "mutator lock"(shared held)
    217   native: #00 pc 0035a217  /system/lib/libart.so (art::DumpNativeStack(std::__1::basic_ostream&lt;char, std::__1::char_traits&lt;char&gt; &gt;&, int, char const*, art::ArtMethod*, void*)+126)
    218   native: #01 pc 0033b03b  /system/lib/libart.so (art::Thread::Dump(std::__1::basic_ostream&lt;char, std::__1::char_traits&lt;char&gt; &gt;&) const+138)
    219   native: #02 pc 00344701  /system/lib/libart.so (art::DumpCheckpoint::Run(art::Thread*)+424)
    220   native: #03 pc 00345265  /system/lib/libart.so (art::ThreadList::RunCheckpoint(art::Closure*)+200)
    221   native: #04 pc 00345769  /system/lib/libart.so (art::ThreadList::Dump(std::__1::basic_ostream&lt;char, std::__1::char_traits&lt;char&gt; &gt;&)+124)
    222   native: #05 pc 00345e51  /system/lib/libart.so (art::ThreadList::DumpForSigQuit(std::__1::basic_ostream&lt;char, std::__1::char_traits&lt;char&gt; &gt;&)+312)
    223   native: #06 pc 0031f829  /system/lib/libart.so (art::Runtime::DumpForSigQuit(std::__1::basic_ostream&lt;char, std::__1::char_traits&lt;char&gt; &gt;&)+68)
    224   native: #07 pc 00326831  /system/lib/libart.so (art::SignalCatcher::HandleSigQuit()+896)
    225   native: #08 pc 003270a1  /system/lib/libart.so (art::SignalCatcher::Run(void*)+324)
    226   native: #09 pc 0003f813  /system/lib/libc.so (__pthread_start(void*)+30)
    227   native: #10 pc 00019f75  /system/lib/libc.so (__start_thread+6)
    228   (no managed stack frames)
    229 
    230 "main" prio=5 tid=1 Suspended
    231   | group="main" sCount=1 dsCount=0 obj=0x747552a0 self=0xf5376500
    232   | sysTid=30363 nice=0 cgrp=default sched=0/0 handle=0xf74feb34
    233   | state=S schedstat=( 331107086 164153349 851 ) utm=6 stm=27 core=3 HZ=100
    234   | stack=0xff00f000-0xff011000 stackSize=8MB
    235   | held mutexes=
    236   kernel: __switch_to+0x7c/0x88
    237   kernel: futex_wait_queue_me+0xd4/0x130
    238   kernel: futex_wait+0xf0/0x1f4
    239   kernel: do_futex+0xcc/0x8f4
    240   kernel: compat_SyS_futex+0xd0/0x14c
    241   kernel: cpu_switch_to+0x48/0x4c
    242   native: #00 pc 000175e8  /system/lib/libc.so (syscall+28)
    243   native: #01 pc 000f5ced  /system/lib/libart.so (art::ConditionVariable::Wait(art::Thread*)+80)
    244   native: #02 pc 00335353  /system/lib/libart.so (art::Thread::FullSuspendCheck()+838)
    245   native: #03 pc 0011d3a7  /system/lib/libart.so (art::ClassLinker::LoadClassMembers(art::Thread*, art::DexFile const&, unsigned char const*, art::Handle&lt;art::mirror::Class&gt;, art::OatFile::OatClass const*)+746)
    246   native: #04 pc 0011d81d  /system/lib/libart.so (art::ClassLinker::LoadClass(art::Thread*, art::DexFile const&, art::DexFile::ClassDef const&, art::Handle&lt;art::mirror::Class&gt;)+88)
    247   native: #05 pc 00132059  /system/lib/libart.so (art::ClassLinker::DefineClass(art::Thread*, char const*, unsigned int, art::Handle&lt;art::mirror::ClassLoader&gt;, art::DexFile const&, art::DexFile::ClassDef const&)+320)
    248   native: #06 pc 001326c1  /system/lib/libart.so (art::ClassLinker::FindClassInPathClassLoader(art::ScopedObjectAccessAlreadyRunnable&, art::Thread*, char const*, unsigned int, art::Handle&lt;art::mirror::ClassLoader&gt;, art::mirror::Class**)+688)
    249   native: #07 pc 002cb1a1  /system/lib/libart.so (art::VMClassLoader_findLoadedClass(_JNIEnv*, _jclass*, _jobject*, _jstring*)+264)
    250   native: #08 pc 002847fd  /data/dalvik-cache/arm/system@framework (a] boot.oat (Java_java_lang_VMClassLoader_findLoadedClass__Ljava_lang_ClassLoader_2Ljava_lang_String_2+112)
    251   at java.lang.VMClassLoader.findLoadedClass!(Native method)
    252   at java.lang.ClassLoader.findLoadedClass(ClassLoader.java:362)
    253   at java.lang.ClassLoader.loadClass(ClassLoader.java:499)
    254   at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
    255   at android.app.ActivityThread.installProvider(ActivityThread.java:5141)
    256   at android.app.ActivityThread.installContentProviders(ActivityThread.java:4748)
    257   at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4688)
    258   at android.app.ActivityThread.-wrap1(ActivityThread.java:-1)
    259   at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1405)
    260   at android.os.Handler.dispatchMessage(Handler.java:102)
    261   at android.os.Looper.loop(Looper.java:148)
    262   at android.app.ActivityThread.main(ActivityThread.java:5417)
    263   at java.lang.reflect.Method.invoke!(Native method)
    264   at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
    265   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
    266 
    267   ...
    268 <i>  Stacks for other threads in this process follow</i>
    269   ...</pre></p>
    270   </div>
    271 </div>
    272 
    273 <h3 id="deadlocks">Finding deadlocks</h3>
    274 <p>Deadlocks often first appear as ANRs because threads are getting stuck. If
    275 the deadlock hits the system server, the watchdog will eventually kill it,
    276 leading to an entry in the log similar to:
    277 <code>WATCHDOG KILLING SYSTEM PROCESS</code>. From the user perspective, the
    278 device reboots, although technically this is a runtime restart rather than a
    279 true reboot.</p>
    280 
    281 <ul>
    282 <li>In a <strong>runtime</strong> restart, the system server dies and is
    283 restarted; the user sees the device return to the boot animation.</li>
    284 <li>In a <strong>reboot</strong>, the kernel has crashed; the user sees the
    285 device return to the Google boot logo.</li>
    286 </ul>
    287 
    288 <p>To find deadlocks, check the VM traces sections for a pattern of thread A
    289 waiting on something held by thread B, which in turn is waiting on something
    290 held by thread A.</p>
    291 
    292 <div class="toggle-content closed">
    293   <p><a href="#" onclick="return toggleContent(this)">
    294     <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img" />
    295     <strong><span class="toggle-content-text">Show example</span>
    296     <span class="toggle-content-text" style="display:none;">Hide example</span></strong>
    297   </a></p>
    298 
    299   <div class="toggle-content-toggleme">
    300     <p><pre>"Binder_B" prio=5 tid=73 Blocked
    301   | group="main" sCount=1 dsCount=0 obj=0x13faa0a0 self=0x95e24800
    302   | sysTid=2016 nice=0 cgrp=default sched=0/0 handle=0x8b68d930
    303   | state=S schedstat=( 9351576559 4141431119 16920 ) utm=819 stm=116 core=1 HZ=100
    304   | stack=0x8b591000-0x8b593000 stackSize=1014KB
    305   | held mutexes=
    306   at com.android.server.pm.UserManagerService.exists(UserManagerService.java:387)
    307   - waiting to lock &lt;0x025f9b02&gt; (a android.util.ArrayMap) held by thread 20
    308   at com.android.server.pm.PackageManagerService.getApplicationInfo(PackageManagerService.java:2848)
    309   at com.android.server.AppOpsService.getOpsRawLocked(AppOpsService.java:881)
    310   at com.android.server.AppOpsService.getOpsLocked(AppOpsService.java:856)
    311   at com.android.server.AppOpsService.noteOperationUnchecked(AppOpsService.java:719)
    312   - locked &lt;0x0231885a&gt; (a com.android.server.AppOpsService)
    313   at com.android.server.AppOpsService.noteOperation(AppOpsService.java:713)
    314   at com.android.server.AppOpsService$2.getMountMode(AppOpsService.java:260)
    315   at com.android.server.MountService$MountServiceInternalImpl.getExternalStorageMountMode(MountService.java:3416)
    316   at com.android.server.am.ActivityManagerService.startProcessLocked(ActivityManagerService.java:3228)
    317   at com.android.server.am.ActivityManagerService.startProcessLocked(ActivityManagerService.java:3170)
    318   at com.android.server.am.ActivityManagerService.startProcessLocked(ActivityManagerService.java:3059)
    319   at com.android.server.am.BroadcastQueue.processNextBroadcast(BroadcastQueue.java:1070)
    320   - locked &lt;0x044d166f&gt; (a com.android.server.am.ActivityManagerService)
    321   at com.android.server.am.ActivityManagerService.finishReceiver(ActivityManagerService.java:16950)
    322   at android.app.ActivityManagerNative.onTransact(ActivityManagerNative.java:494)
    323   at com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:2432)
    324   at android.os.Binder.execTransact(Binder.java:453)
    325 ...
    326   "PackageManager" prio=5 tid=20 Blocked
    327   | group="main" sCount=1 dsCount=0 obj=0x1304f4a0 self=0xa7f43900
    328   | sysTid=1300 nice=10 cgrp=bg_non_interactive sched=0/0 handle=0x9fcf9930
    329   | state=S schedstat=( 26190141996 13612154802 44357 ) utm=2410 stm=209 core=2 HZ=100
    330   | stack=0x9fbf7000-0x9fbf9000 stackSize=1038KB
    331   | held mutexes=
    332   at com.android.server.AppOpsService.noteOperationUnchecked(AppOpsService.java:718)
    333   - waiting to lock &lt;0x0231885a&gt; (a com.android.server.AppOpsService) held by thread 73
    334   at com.android.server.AppOpsService.noteOperation(AppOpsService.java:713)
    335   at com.android.server.AppOpsService$2.getMountMode(AppOpsService.java:260)
    336   at com.android.server.AppOpsService$2.hasExternalStorage(AppOpsService.java:273)
    337   at com.android.server.MountService$MountServiceInternalImpl.hasExternalStorage(MountService.java:3431)
    338   at com.android.server.MountService.getVolumeList(MountService.java:2609)
    339   at android.os.storage.StorageManager.getVolumeList(StorageManager.java:880)
    340   at android.os.Environment$UserEnvironment.getExternalDirs(Environment.java:83)
    341   at android.os.Environment.isExternalStorageEmulated(Environment.java:708)
    342   at com.android.server.pm.PackageManagerService.isExternalMediaAvailable(PackageManagerService.java:9327)
    343   at com.android.server.pm.PackageManagerService.startCleaningPackages(PackageManagerService.java:9367)
    344   - locked &lt;0x025f9b02&gt; (a android.util.ArrayMap)
    345   at com.android.server.pm.PackageManagerService$PackageHandler.doHandleMessage(PackageManagerService.java:1320)
    346   at com.android.server.pm.PackageManagerService$PackageHandler.handleMessage(PackageManagerService.java:1122)
    347   at android.os.Handler.dispatchMessage(Handler.java:102)
    348   at android.os.Looper.loop(Looper.java:148)
    349   at android.os.HandlerThread.run(HandlerThread.java:61)
    350   at com.android.server.ServiceThread.run(ServiceThread.java:46)</pre></p>
    351   </div>
    352 </div>
    353 
    354 
    355 <h2 id="activities">Activities</h2>
    356 <p>An <a href="http://developer.android.com/guide/components/activities.html">Activity</a>
    357 is an application component that provides a screen users interact with to do
    358 something such as dial a number, take a photo, send an email, etc. From a bug
    359 report perspective, an
    360 <a href="http://developer.android.com/reference/android/app/Activity.html">activity</a>
    361 is a single, focused thing a user can do, which makes locating the activity that
    362 was in focus during a crash very important. Activities (via ActivityManager)
    363 run processes, so locating all process stops and starts for a given activity can
    364 also aid troubleshooting.</p>
    365 
    366 <h3 id="history-focused-activities">Viewing focused activities</h3>
    367 <p>To view a history of focused activities, search for
    368 <code>am_focused_activity</code>.</p>
    369 
    370 <div class="toggle-content closed">
    371   <p><a href="#" onclick="return toggleContent(this)">
    372     <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img" />
    373     <strong><span class="toggle-content-text">Show example</span>
    374     <span class="toggle-content-text" style="display:none;">Hide example</span></strong>
    375   </a></p>
    376 
    377   <div class="toggle-content-toggleme">
    378     <p><pre>grep "am_focused_activity" bugreport-2015-10-01-18-13-48.txt
    379 10-01 18:10:41.409  4600 14112 I am_focused_activity: [0,com.google.android.GoogleCamera/com.android.camera.CameraActivity]
    380 10-01 18:11:17.313  4600  5687 I am_focused_activity: [0,com.google.android.googlequicksearchbox/com.google.android.launcher.GEL]
    381 10-01 18:11:52.747  4600 14113 I am_focused_activity: [0,com.google.android.GoogleCamera/com.android.camera.CameraActivity]
    382 10-01 18:14:07.762  4600  5687 I am_focused_activity: [0,com.google.android.googlequicksearchbox/com.google.android.launcher.GEL]</pre></p>
    383   </div>
    384 </div>
    385 
    386 <h3 id="history-process-starts">Viewing process starts</h3>
    387 <p>To view a history of process starts, search for <code>Start proc</code>.</p>
    388 
    389 <div class="toggle-content closed">
    390   <p><a href="#" onclick="return toggleContent(this)">
    391     <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img" />
    392     <strong><span class="toggle-content-text">Show example</span>
    393     <span class="toggle-content-text" style="display:none;">Hide example</span></strong>
    394   </a></p>
    395 
    396   <div class="toggle-content-toggleme">
    397     <p><pre>grep "Start proc" bugreport-2015-10-01-18-13-48.txt
    398 10-01 18:09:15.309  4600  4612 I ActivityManager: Start proc 24533:com.metago.astro/u0a240 for broadcast com.metago.astro/com.inmobi.commons.analytics.androidsdk.IMAdTrackerReceiver
    399 10-01 18:09:15.687  4600 14112 I ActivityManager: Start proc 24548:com.google.android.apps.fitness/u0a173 for service com.google.android.apps.fitness/.api.services.ActivityUpsamplingService
    400 10-01 18:09:15.777  4600  6604 I ActivityManager: Start proc 24563:cloudtv.hdwidgets/u0a145 for broadcast cloudtv.hdwidgets/cloudtv.switches.SwitchSystemUpdateReceiver
    401 10-01 18:09:20.574  4600  6604 I ActivityManager: Start proc 24617:com.wageworks.ezreceipts/u0a111 for broadcast com.wageworks.ezreceipts/.ui.managers.IntentReceiver
    402 ...</pre></p>
    403   </div>
    404 </div>
    405 
    406 <h3 id="device-thrashing">Is the device thrashing?</h3>
    407 <p>To determine if the device is
    408 <a href="https://en.wikipedia.org/wiki/Thrashing_(computer_science)">thrashing</a>,
    409 check for an abnormal increase in activity around <code>am_proc_died</code> and
    410 <code>am_proc_start</code> in a short amount of time.</p>
    411 
    412 <div class="toggle-content closed">
    413   <p><a href="#" onclick="return toggleContent(this)">
    414     <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img" />
    415     <strong><span class="toggle-content-text">Show example</span>
    416     <span class="toggle-content-text" style="display:none;">Hide example</span></strong>
    417   </a></p>
    418 
    419   <div class="toggle-content-toggleme">
    420     <p><pre>grep -e "am_proc_died" -e "am_proc_start" bugreport-2015-10-01-18-13-48.txt
    421 10-01 18:07:06.494  4600  9696 I am_proc_died: [0,20074,com.android.musicfx]
    422 10-01 18:07:06.555  4600  6606 I am_proc_died: [0,31166,com.concur.breeze]
    423 10-01 18:07:06.566  4600 14112 I am_proc_died: [0,18812,com.google.android.apps.fitness]
    424 10-01 18:07:07.018  4600  7513 I am_proc_start: [0,20361,10113,com.sony.playmemories.mobile,broadcast,com.sony.playmemories.mobile/.service.StartupReceiver]
    425 10-01 18:07:07.357  4600  4614 I am_proc_start: [0,20381,10056,com.google.android.talk,service,com.google.android.talk/com.google.android.libraries.hangouts.video.CallService]
    426 10-01 18:07:07.784  4600  4612 I am_proc_start: [0,20402,10190,com.andcreate.app.trafficmonitor:loopback_measure_serivce,service,com.andcreate.app.trafficmonitor/.loopback.LoopbackMeasureService]
    427 10-01 18:07:10.753  4600  5997 I am_proc_start: [0,20450,10097,com.amazon.mShop.android.shopping,broadcast,com.amazon.mShop.android.shopping/com.amazon.identity.auth.device.storage.LambortishClock$ChangeTimestampsBroadcastReceiver]
    428 10-01 18:07:15.267  4600  6605 I am_proc_start: [0,20539,10173,com.google.android.apps.fitness,service,com.google.android.apps.fitness/.api.services.ActivityUpsamplingService]
    429 10-01 18:07:15.985  4600  4612 I am_proc_start: [0,20568,10022,com.android.musicfx,broadcast,com.android.musicfx/.ControlPanelReceiver]
    430 10-01 18:07:16.315  4600  7512 I am_proc_died: [0,20096,com.google.android.GoogleCamera]</pre></p>
    431   </div>
    432 </div>
    433 
    434 <h2 id="memory">Memory</h2>
    435 <p>Because Android devices often have constrained physical memory, managing
    436 random-access memory (RAM) is critical. Bug reports contain several indicators
    437 of low memory as well as a dumpstate that provides a memory snapshot.</p>
    438 
    439 <h3 id="low-memory">Identifying low memory</h3>
    440 <p>Low memory can cause the system to thrash as it kills some processes to free
    441 memory but continues to start other processes. To view corroborating evidence of
    442 low memory, check for concentrations of <code>am_proc_died</code> and
    443 <code>am_proc_start</code> entries in the binary event log.</p>
    444 
    445 <p>Low memory can also slow task switching and thwart return attempts (because
    446 the task the user was trying to return to was killed). If the launcher was
    447 killed, it restarts when the user touches the home button and logs show the
    448 launcher reload its content.</p>
    449 
    450 <h4 id="historical-low-memory">Viewing historical indicators</h4>
    451 <p>The <code>am_low_memory</code> entry in the binary event log indicates the
    452 last cached process has died. After this, the system starts killing services.
    453 
    454 <div class="toggle-content closed">
    455   <p><a href="#" onclick="return toggleContent(this)">
    456     <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img" />
    457     <strong><span class="toggle-content-text">Show example</span>
    458     <span class="toggle-content-text" style="display:none;">Hide example</span></strong>
    459   </a></p>
    460 
    461   <div class="toggle-content-toggleme">
    462     <p><pre>grep "am_low_memory" bugreport-2015-10-01-18-13-48.txt
    463 10-01 18:11:02.219  4600  7513 I am_low_memory: 41
    464 10-01 18:12:18.526  4600 14112 I am_low_memory: 39
    465 10-01 18:12:18.874  4600  7514 I am_low_memory: 38
    466 10-01 18:12:22.570  4600 14112 I am_low_memory: 40
    467 10-01 18:12:34.811  4600 20319 I am_low_memory: 43
    468 10-01 18:12:37.945  4600  6521 I am_low_memory: 43
    469 10-01 18:12:47.804  4600 14110 I am_low_memory: 43</pre></p>
    470   </div>
    471 </div>
    472 
    473 <h4 id="thrashing-indicators">Viewing thrashing indicators</h4>
    474 <p>Other indicators of system thrashing (paging, direct reclaim, etc.) include
    475 <code>kswapd</code>, <code>kworker</code>, and <code>mmcqd</code> consuming
    476 cycles. (Keep in mind the bugreport being gathered can influence thrashing
    477 indicators.)</p>
    478 
    479 <div class="toggle-content closed">
    480   <p><a href="#" onclick="return toggleContent(this)">
    481     <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img" />
    482     <strong><span class="toggle-content-text">Show example</span>
    483     <span class="toggle-content-text" style="display:none;">Hide example</span></strong>
    484   </a></p>
    485 
    486   <div class="toggle-content-toggleme">
    487     <p><pre>------ CPU INFO (top -n 1 -d 1 -m 30 -t) ------
    488 
    489 User 15%, System 54%, IOW 28%, IRQ 0%
    490 User 82 + Nice 2 + Sys 287 + Idle 1 + IOW 152 + IRQ 0 + SIRQ 5 = 529
    491 
    492   PID   TID PR CPU% S     VSS     RSS PCY UID      Thread          Proc
    493 15229 15229  0  19% R      0K      0K  fg root     kworker/0:2
    494 29512 29517  1   7% D 1173524K 101188K  bg u0_a27   Signal Catcher  com.google.android.talk
    495 24565 24570  3   6% D 2090920K 145168K  fg u0_a22   Signal Catcher  com.google.android.googlequicksearchbox:search
    496 19525 19525  2   6% R   3476K   1644K  fg shell    top             top
    497 24957 24962  2   5% R 1706928K 125716K  bg u0_a47   Signal Catcher  com.google.android.GoogleCamera
    498 19519 19519  3   4% S      0K      0K  fg root     kworker/3:1
    499   120   120  0   3% S      0K      0K  fg root     mmcqd/1
    500 18233 18233  1   3% S      0K      0K  fg root     kworker/1:1
    501 25589 25594  1   2% D 1270476K  75776K  fg u0_a8    Signal Catcher  com.google.android.gms
    502 19399 19399  2   1% S      0K      0K  fg root     kworker/2:2
    503  1963  1978  1   0% S 1819100K 125136K  fg system   android.fg      system_server
    504  1963  1981  3   0% S 1819100K 125136K  fg system   android.display system_server</pre></p>
    505   </div>
    506 </div>
    507 <p></p>
    508 
    509 <p>ANR logs can provide a similar memory snapshot.</p>
    510 
    511 <div class="toggle-content closed">
    512   <p><a href="#" onclick="return toggleContent(this)">
    513     <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img" />
    514     <strong><span class="toggle-content-text">Show example</span>
    515     <span class="toggle-content-text" style="display:none;">Hide example</span></strong>
    516   </a></p>
    517 
    518   <div class="toggle-content-toggleme">
    519     <p><pre>10-03 17:19:59.959  1963  1976 E ActivityManager: ANR in com.google.android.apps.magazines
    520 10-03 17:19:59.959  1963  1976 E ActivityManager: PID: 18819
    521 10-03 17:19:59.959  1963  1976 E ActivityManager: Reason: Broadcast of Intent { act=android.net.conn.CONNECTIVITY_CHANGE flg=0x4000010 cmp=com.google.android.apps.magazines/com.google.apps.dots.android.newsstand.appwidget.NewsWidgetProvider (has extras) }
    522 10-03 17:19:59.959  1963  1976 E ActivityManager: Load: 19.19 / 14.76 / 12.03
    523 10-03 17:19:59.959  1963  1976 E ActivityManager: CPU usage from 0ms to 11463ms later:
    524 10-03 17:19:59.959  1963  1976 E ActivityManager:   54% 15229/kworker/0:2: 0% user + 54% kernel
    525 10-03 17:19:59.959  1963  1976 E ActivityManager:   38% 1963/system_server: 14% user + 23% kernel / faults: 17152 minor 1073 major
    526 10-03 17:19:59.959  1963  1976 E ActivityManager:   11% 120/mmcqd/1: 0% user + 11% kernel
    527 10-03 17:19:59.959  1963  1976 E ActivityManager:   10% 2737/com.android.systemui: 4.7% user + 5.6% kernel / faults: 7211 minor 149 major
    528 10-03 17:19:59.959  1963  1976 E ActivityManager:   0.2% 1451/debuggerd: 0% user + 0.2% kernel / faults: 15211 minor 147 major
    529 10-03 17:19:59.959  1963  1976 E ActivityManager:   8.7% 6162/com.twofortyfouram.locale: 4% user + 4.7% kernel / faults: 4924 minor 260 major
    530 10-03 17:19:59.959  1963  1976 E ActivityManager:   6.1% 24565/com.google.android.googlequicksearchbox:search: 2.4% user + 3.7% kernel / faults: 2902 minor 129 major
    531 10-03 17:19:59.959  1963  1976 E ActivityManager:   6% 55/kswapd0: 0% user + 6% kernel
    532 10-03 17:19:59.959  1963  1976 E ActivityManager:   4.9% 18819/com.google.android.apps.magazines: 1.5% user + 3.3% kernel / faults: 10129 minor 986 major
    533 10-03 17:19:59.959  1963  1976 E ActivityManager:   2.8% 18233/kworker/1:1: 0% user + 2.8% kernel
    534 10-03 17:19:59.959  1963  1976 E ActivityManager:   4.2% 3145/com.android.phone: 2% user + 2.2% kernel / faults: 3005 minor 43 major
    535 10-03 17:19:59.959  1963  1976 E ActivityManager:   4.2% 8084/com.android.chrome: 2% user + 2.1% kernel / faults: 4798 minor 380 major
    536 10-03 17:19:59.959  1963  1976 E ActivityManager:   3.4% 182/surfaceflinger: 1.1% user + 2.3% kernel / faults: 842 minor 13 major
    537 10-03 17:19:59.959  1963  1976 E ActivityManager:   3% 18236/kworker/1:2: 0% user + 3% kernel
    538 10-03 17:19:59.959  1963  1976 E ActivityManager:   2.9% 19231/com.android.systemui:screenshot: 0.8% user + 2.1% kernel / faults: 6119 minor 348 major
    539 10-03 17:19:59.959  1963  1976 E ActivityManager:   2.3% 15350/kworker/0:4: 0% user + 2.3% kernel
    540 10-03 17:19:59.959  1963  1976 E ActivityManager:   2.2% 1454/mediaserver: 0% user + 2.2% kernel / faults: 479 minor 6 major
    541 10-03 17:19:59.959  1963  1976 E ActivityManager:   2% 16496/com.android.chrome:sandboxed_process10: 0.1% user + 1.8% kernel / faults: 3610 minor 234 major
    542 10-03 17:19:59.959  1963  1976 E ActivityManager:   1% 3119/com.android.nfc: 0.4% user + 0.5% kernel / faults: 1789 minor 17 major
    543 10-03 17:19:59.959  1963  1976 E ActivityManager:   1.7% 19337/com.jarettmillard.localeconnectiontype:background: 0.1% user + 1.5% kernel / faults: 7854 minor 439 major
    544 10-03 17:19:59.959  1963  1976 E ActivityManager:   0.7% 3066/com.google.android.inputmethod.latin: 0.3% user + 0.3% kernel / faults: 1336 minor 7 major
    545 10-03 17:19:59.959  1963  1976 E ActivityManager:   1% 25589/com.google.android.gms: 0.3% user + 0.6% kernel / faults: 2867 minor 237 major
    546 10-03 17:19:59.959  1963  1976 E ActivityManager:   0.9% 1460/sensors.qcom: 0.5% user + 0.4% kernel / faults: 262 minor 5 major
    547 10-03 17:19:59.959  1963  1976 E ActivityManager:   0.8% 3650/mpdecision: 0% user + 0.8% kernel / faults: 160 minor 1 major
    548 10-03 17:19:59.959  1963  1976 E ActivityManager:   0.1% 3132/com.redbend.vdmc: 0% user + 0% kernel / faults: 1746 minor 5 major</pre></p>
    549   </div>
    550 </div>
    551 
    552 <h3 id="memory-snapshot">Getting a memory snapshot</h3>
    553 <p>The memory snapshot is a dumpstate that lists running Java and native
    554 processes (for details, refer to
    555 <a href="https://developer.android.com/tools/debugging/debugging-memory.html#ViewingAllocations">Viewing
    556 Overall Memory Allocations</a>). Keep in mind the snapshot gives only the state
    557 at a specific moment in time; the system might have been in better (or worse)
    558 shape before the snapshot.</p>
    559 <ul>
    560 <li>To understand how long a process runs, see
    561 <a href="#process-runtime">Process runtime</a>.</li>
    562 <li>To understand why something is currently running, see
    563 <a href="#why-is-process-running">Why is a process running?</a></li>
    564 </ul>
    565 
    566 <div class="toggle-content closed">
    567   <p><a href="#" onclick="return toggleContent(this)">
    568     <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img" />
    569     <strong><span class="toggle-content-text">Show example</span>
    570     <span class="toggle-content-text" style="display:none;">Hide example</span></strong>
    571   </a></p>
    572 
    573   <div class="toggle-content-toggleme">
    574     <p><pre>Total PSS by OOM adjustment:
    575     86752 kB: Native
    576                22645 kB: surfaceflinger (pid 197)
    577                18597 kB: mediaserver (pid 204)
    578                ...
    579    136959 kB: System
    580               136959 kB: system (pid 785)
    581    220218 kB: Persistent
    582               138859 kB: com.android.systemui (pid 947 / activities)
    583                39178 kB: com.android.nfc (pid 1636)
    584                28313 kB: com.android.phone (pid 1659)
    585                13868 kB: com.redbend.vdmc (pid 1646)
    586      9534 kB: Persistent Service
    587                 9534 kB: com.android.bluetooth (pid 23807)
    588    178604 kB: Foreground
    589               168620 kB: com.google.android.googlequicksearchbox (pid 1675 / activities)
    590                 9984 kB: com.google.android.apps.maps (pid 13952)
    591    188286 kB: Visible
    592                85326 kB: com.google.android.wearable.app (pid 1535)
    593                38978 kB: com.google.process.gapps (pid 1510)
    594                31936 kB: com.google.android.gms.persistent (pid 2072)
    595                27950 kB: com.google.android.gms.wearable (pid 1601)
    596                 4096 kB: com.google.android.googlequicksearchbox:interactor (pid 1550)
    597     52948 kB: Perceptible
    598                52948 kB: com.google.android.inputmethod.latin (pid 1566)
    599    150851 kB: A Services
    600                81121 kB: com.google.android.gms (pid 1814)
    601                37586 kB: com.google.android.talk (pid 9584)
    602                10949 kB: com.google.android.music:main (pid 4019)
    603                10727 kB: com.motorola.targetnotif (pid 31071)
    604                10468 kB: com.google.android.GoogleCamera (pid 9984)
    605     33298 kB: Previous
    606                33298 kB: com.android.settings (pid 9673 / activities)
    607    165188 kB: B Services
    608                49490 kB: com.facebook.katana (pid 15035)
    609                22483 kB: com.whatsapp (pid 28694)
    610                21308 kB: com.iPass.OpenMobile (pid 5325)
    611                19788 kB: com.google.android.apps.googlevoice (pid 23934)
    612                17399 kB: com.google.android.googlequicksearchbox:search (pid 30359)
    613                 9073 kB: com.google.android.apps.youtube.unplugged (pid 21194)
    614                 7660 kB: com.iPass.OpenMobile:remote (pid 23754)
    615                 7291 kB: com.pujie.wristwear.pujieblack (pid 24240)
    616                 7157 kB: com.instagram.android:mqtt (pid 9530)
    617                 3539 kB: com.qualcomm.qcrilmsgtunnel (pid 16186)
    618    204324 kB: Cached
    619                43424 kB: com.amazon.mShop.android (pid 13558)
    620                22563 kB: com.google.android.apps.magazines (pid 13844)
    621                ...
    622                 4298 kB: com.google.android.apps.enterprise.dmagent (pid 13826)</pre></p>
    623   </div>
    624 </div>
    625 
    626 <h2 id="broadcasts">Broadcasts</h2>
    627 <p>Applications generate broadcasts to send events within the current
    628 application or to another application. Broadcast receivers subscribe to specific
    629 messages (via filters), enabling them to both listen and respond to a broadcast.
    630 Bug reports contain information about sent broadcasts and unsent broadcasts, as
    631 well as a dumpsys of all receivers listening to a specific broadcast.</p>
    632 
    633 <h3 id="historical-broadcasts">Viewing historical broadcasts</h3>
    634 <p>Historical broadcasts are those that have already been sent, listed in
    635 reverse chronological order.</p>
    636 
    637 <p>The <strong>summary</strong> section is an overview of the last 300
    638 foreground broadcasts and the last 300 background broadcasts.</p>
    639 
    640 <div class="toggle-content closed">
    641   <p><a href="#" onclick="return toggleContent(this)">
    642     <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img" />
    643     <strong><span class="toggle-content-text">Show example</span>
    644     <span class="toggle-content-text" style="display:none;">Hide example</span></strong>
    645   </a></p>
    646 
    647   <div class="toggle-content-toggleme">
    648     <p><pre> Historical broadcasts summary [foreground]:
    649  #0: act=android.intent.action.SCREEN_ON flg=0x50000010
    650     +1ms dispatch +90ms finish
    651     enq=2015-10-29 17:10:51 disp=2015-10-29 17:10:51 fin=2015-10-29 17:10:51
    652   #1: act=android.intent.action.SCREEN_OFF flg=0x50000010
    653     0 dispatch +60ms finish
    654     enq=2015-10-29 17:10:05 disp=2015-10-29 17:10:05 fin=2015-10-29 17:10:05
    655  ...
    656  Historical broadcasts summary [background]:
    657  ...</pre></p>
    658   </div>
    659 </div>
    660 <p></p>
    661 
    662 <p>The <strong>detail</strong> section contains complete information for the
    663 last 50 foreground broadcasts and the last 50 background broadcasts, as well as
    664 the receivers for each broadcast. Receivers that have a:</p>
    665 <ul>
    666 <li><code>BroadcastRecord</code> entry are registered at runtime and are sent
    667 only to already running processes.</li>
    668 <li><code>ResolveInfo</code> entry are registered through manifest entries. The
    669 ActivityManager starts the process for each <code>ResolveInfo</code> if it is
    670 not already running.</li>
    671 </ul>
    672 
    673 <div class="toggle-content closed">
    674   <p><a href="#" onclick="return toggleContent(this)">
    675     <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img" />
    676     <strong><span class="toggle-content-text">Show example</span>
    677     <span class="toggle-content-text" style="display:none;">Hide example</span></strong>
    678   </a></p>
    679 
    680   <div class="toggle-content-toggleme">
    681     <p><pre>Historical broadcasts [foreground]:
    682  ...
    683  Historical broadcasts [background]:
    684  Historical Broadcast background #0:
    685  ...
    686  Historical Broadcast background #5:
    687     BroadcastRecord{18dbb16 u0 android.intent.action.USER_PRESENT} to user 0
    688     Intent { act=android.intent.action.USER_PRESENT flg=0x24000010 }
    689     caller=com.android.systemui 2925:com.android.systemui/u0a27 pid=2925 uid=10027
    690     enqueueClockTime=2015-10-29 17:10:55 dispatchClockTime=2015-10-29 17:10:55
    691     dispatchTime=-2s321ms (0 since enq) finishTime=-2s320ms (+1ms since disp)
    692     Receiver #0: BroadcastFilter{8181cc1 u-1 ReceiverList{5d929a8 902 system/1000/u-1 local:eca4dcb}}
    693     Receiver #1: BroadcastFilter{6371c97 u-1 ReceiverList{2938b16 902 system/1000/u-1 local:840b831}}
    694     ...
    695     Receiver #19: BroadcastFilter{93f16b u0 ReceiverList{5c61eba 17016 com.google.android.gm/10079/u0 remote:24083e5}}
    696  ...
    697  Historical Broadcast background #37:
    698     BroadcastRecord{7f6dd6 u0 android.hardware.action.NEW_PICTURE} to user 0
    699     Intent { act=android.hardware.action.NEW_PICTURE dat=content://media/external/images/media/6345 flg=0x10 }
    700     caller=com.google.android.GoogleCamera 32734:com.google.android.GoogleCamera/u0a53 pid=32734 uid=10053
    701     enqueueClockTime=2015-10-29 17:09:48 dispatchClockTime=2015-10-29 17:09:49
    702     dispatchTime=-45s720ms (+399ms since enq) finishTime=-45s701ms (+19ms since disp)
    703     resultTo=null resultCode=0 resultData=null
    704     nextReceiver=4 receiver=null
    705     Receiver #0: ResolveInfo{33d2857 com.google.android.gms/com.google.android.libraries.social.mediamonitor.MediaMonitor m=0x608000}
    706       priority=0 preferredOrder=0 match=0x608000 specificIndex=-1 isDefault=false
    707       ActivityInfo:
    708         name=com.google.android.libraries.social.mediamonitor.MediaMonitor
    709         packageName=com.google.android.gms
    710         enabled=true exported=true processName=com.google.android.gms
    711         ...
    712     Receiver #1: ResolveInfo{d9edf44 com.google.android.apps.maps/com.google.android.apps.gmm.ugc.clientnotification.StartPhotoTakenNotifierServiceReceiver m=0x608000}
    713       priority=0 preferredOrder=0 match=0x608000 specificIndex=-1 isDefault=false
    714       ActivityInfo:
    715         name=com.google.android.apps.gmm.ugc.clientnotification.StartPhotoTakenNotifierServiceReceiver
    716         packageName=com.google.android.apps.maps
    717         enabled=true exported=true processName=com.google.android.apps.maps
    718         ...
    719     Receiver #2: ResolveInfo{743f82d com.google.android.apps.photos/com.google.android.libraries.social.mediamonitor.MediaMonitor m=0x608000}
    720       priority=0 preferredOrder=0 match=0x608000 specificIndex=-1 isDefault=false
    721       ActivityInfo:
    722         name=com.google.android.libraries.social.mediamonitor.MediaMonitor
    723         packageName=com.google.android.apps.photos
    724         enabled=true exported=true processName=com.google.android.apps.photos
    725         ...
    726     Receiver #3: ResolveInfo{d5c9162 com.google.android.apps.plus/com.google.android.libraries.social.mediamonitor.MediaMonitor m=0x608000}
    727       priority=0 preferredOrder=0 match=0x608000 specificIndex=-1 isDefault=false
    728       ActivityInfo:
    729         name=com.google.android.libraries.social.mediamonitor.MediaMonitor
    730         packageName=com.google.android.apps.plus
    731         enabled=true exported=true processName=com.google.android.apps.plus
    732         ...</pre></p>
    733   </div>
    734 </div>
    735 
    736 <h3 id="active-broadcasts">Viewing active broadcasts</h3>
    737 <p>Active broadcasts are those that have yet to be sent. A large number in the
    738 queue means the system can't dispatch the broadcasts fast enough to keep up.</p>
    739 
    740 <div class="toggle-content closed">
    741   <p><a href="#" onclick="return toggleContent(this)">
    742     <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img" />
    743     <strong><span class="toggle-content-text">Show example</span>
    744     <span class="toggle-content-text" style="display:none;">Hide example</span></strong>
    745   </a></p>
    746 
    747   <div class="toggle-content-toggleme">
    748     <p><pre> Active ordered broadcasts [background]:
    749  Active Ordered Broadcast background #133: <i>// size of queue</i>
    750  ...</pre></p>
    751   </div>
    752 </div>
    753 
    754 <h3 id="broadcast-listeners">Viewing broadcast listeners</h3>
    755 <p>To view a list of receivers listening for a broadcast, check the Receiver
    756 Resolver Table in the <code>dumpsys activity broadcasts</code>. The following
    757 example displays all receivers listening for <code>USER_PRESENT</code>.</p>
    758 
    759 <div class="toggle-content closed">
    760   <p><a href="#" onclick="return toggleContent(this)">
    761     <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img" />
    762     <strong><span class="toggle-content-text">Show example</span>
    763     <span class="toggle-content-text" style="display:none;">Hide example</span></strong>
    764   </a></p>
    765 
    766   <div class="toggle-content-toggleme">
    767     <p><pre>-------------------------------------------------------------------------------
    768 ACTIVITY MANAGER BROADCAST STATE (dumpsys activity broadcasts)
    769 ..
    770   Receiver Resolver Table:
    771     Full MIME Types:
    772     ..
    773     Wild MIME Types:
    774     ..
    775     Schemes:
    776     ..
    777     Non-Data Actions:
    778     ..
    779         android.intent.action.USER_PRESENT:
    780           BroadcastFilter{8181cc1 u-1 ReceiverList{5d929a8 902 system/1000/u-1 local:eca4dcb}}
    781           BroadcastFilter{6371c97 u-1 ReceiverList{2938b16 902 system/1000/u-1 local:840b831}}
    782           BroadcastFilter{320c00 u0 ReceiverList{d3a6283 902 system/1000/u0 local:799c532}}
    783           BroadcastFilter{e486048 u0 ReceiverList{36fbaeb 902 system/1000/u0 local:5f51e3a}}
    784           BroadcastFilter{22b02 u-1 ReceiverList{b3f744d 902 system/1000/u-1 local:de837e4}}
    785           BroadcastFilter{3e989ab u0 ReceiverList{f8deffa 2981 com.google.process.gapps/10012/u0 remote:26bd225}}
    786           BroadcastFilter{fb56150 u0 ReceiverList{22b7b13 2925 com.android.systemui/10027/u0 remote:c54a602}}
    787           BroadcastFilter{63bbb6 u-1 ReceiverList{ba6c751 3484 com.android.nfc/1027/u-1 remote:5c4a478}}
    788           BroadcastFilter{95ad20d u0 ReceiverList{d8374a4 3586 com.google.android.googlequicksearchbox/10029/u0 remote:feb3737}}
    789           BroadcastFilter{fdef551 u0 ReceiverList{28ca78 3745 com.google.android.gms.persistent/10012/u0 remote:f23afdb}}
    790           BroadcastFilter{9830707 u0 ReceiverList{aabd946 3745 com.google.android.gms.persistent/10012/u0 remote:a4da121}}
    791           BroadcastFilter{83c43d2 u0 ReceiverList{d422e5d 3745 com.google.android.gms.persistent/10012/u0 remote:f585034}}
    792           BroadcastFilter{8890378 u0 ReceiverList{26d2cdb 3745 com.google.android.gms.persistent/10012/u0 remote:dfa61ea}}
    793           BroadcastFilter{7bbb7 u0 ReceiverList{214b2b6 3745 com.google.android.gms.persistent/10012/u0 remote:8353a51}}
    794           BroadcastFilter{38d3566 u0 ReceiverList{de859c1 3745 com.google.android.gms.persistent/10012/u0 remote:e003aa8}}
    795           BroadcastFilter{3435d9f u0 ReceiverList{6e38b3e 3745 com.google.android.gms.persistent/10012/u0 remote:8dd7ff9}}
    796           BroadcastFilter{d0a34bb u0 ReceiverList{5091d4a 3745 com.google.android.gms.persistent/10012/u0 remote:d6d22b5}}
    797           BroadcastFilter{d43c416 u0 ReceiverList{51a3531 3745 com.google.android.gms.persistent/10012/u0 remote:d0b9dd8}}
    798           BroadcastFilter{aabf36d u0 ReceiverList{a88bf84 3745 com.google.android.gms.persistent/10012/u0 remote:a9d6197}}
    799           BroadcastFilter{93f16b u0 ReceiverList{5c61eba 17016 com.google.android.gm/10079/u0 remote:24083e5}}
    800           BroadcastFilter{68f794e u0 ReceiverList{4cb1c49 947 com.google.android.googlequicksearchbox:search/10029/u0 remote:251d250}}
    801       ..
    802     MIME Typed Actions:</pre></p>
    803   </div>
    804 </div>
    805 
    806 <h2 id="monitor contention">Monitor contention</h2>
    807 <p>Monitor contention logging can sometimes indicate actual monitor contention,
    808 but most often indicates the system is so loaded that everything has slowed down.
    809 You might see long monitor events logged by ART in system or event log.</p>
    810 
    811 <p>In the system log:</p>
    812 <p><pre>10-01 18:12:44.343 29761 29914 W art     : Long monitor contention event with owner method=void android.database.sqlite.SQLiteClosable.acquireReference() from SQLiteClosable.java:52 waiters=0 for 3.914s</pre></p>
    813 
    814 <p>In the event log:</p>
    815 <p><pre>10-01 18:12:44.364 29761 29914 I dvm_lock_sample: [com.google.android.youtube,0,pool-3-thread-9,3914,ScheduledTaskMaster.java,138,SQLiteClosable.java,52,100]</pre></p>
    816 
    817 <h2 id="background-compilation">Background compilation</h2>
    818 <p>Compilation can be expensive and load the device.</p>
    819 
    820 <div class="toggle-content closed">
    821   <p><a href="#" onclick="return toggleContent(this)">
    822     <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img" />
    823     <strong><span class="toggle-content-text">Show example</span>
    824     <span class="toggle-content-text" style="display:none;">Hide example</span></strong>
    825   </a></p>
    826 
    827   <div class="toggle-content-toggleme">
    828     <p><pre>09-14 06:27:05.670  2508  2587 E ActivityManager: CPU usage from 0ms to 5857ms later:
    829 09-14 06:27:05.670  2508  2587 E ActivityManager:   84% 5708/dex2oat: 81% user + 2.3% kernel / faults: 3731 minor 1 major
    830 09-14 06:27:05.670  2508  2587 E ActivityManager:   73% 2508/system_server: 21% user + 51% kernel / faults: 10019 minor 28 major
    831 09-14 06:27:05.670  2508  2587 E ActivityManager:   1% 3935/com.android.phone: 0.3% user + 0.6% kernel / faults: 2684 minor 2 major</pre></p>
    832   </div>
    833 </div>
    834 <p></p>
    835 
    836 <p>Compilation might occur in the background when Google Play store updates are
    837 downloading. In this case, messages from the Google Play store app
    838 (<code>finsky</code>) and <code>installd</code> appear prior to
    839 <code>dex2oat</code> messages.</p>
    840 
    841 <div class="toggle-content closed">
    842   <p><a href="#" onclick="return toggleContent(this)">
    843     <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img" />
    844     <strong><span class="toggle-content-text">Show example</span>
    845     <span class="toggle-content-text" style="display:none;">Hide example</span></strong>
    846   </a></p>
    847 
    848   <div class="toggle-content-toggleme">
    849     <p><pre>10-07 08:42:33.725 11051 11051 D Finsky  : [1] InstallerTask.advanceState: Prepare to patch com.garmin.android.apps.virb (com.garmin.android.apps.virb) from content://downloads/my_downloads/3602 format 2
    850 10-07 08:42:33.752   495   495 I installd: free_cache(48637657) avail 15111192576
    851 
    852 10-07 08:42:39.998  2497  2567 I PackageManager.DexOptimizer: Running dexopt (dex2oat) on: /data/app/vmdl436577137.tmp/base.apk pkg=com.garmin.android.apps.virb isa=arm vmSafeMode=false debuggable=false oatDir = /data/app/vmdl436577137.tmp/oat bootComplete=true
    853 </pre></p>
    854   </div>
    855 </div>
    856 <p></p>
    857 
    858 <p>Compilation might also occur in the background when an application is loading
    859 a dex file that has not yet been compiled. In this case, you won't see
    860 <code>finsky</code> or <code>installd</code> logging.</p>
    861 
    862 <div class="toggle-content closed">
    863   <p><a href="#" onclick="return toggleContent(this)">
    864     <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img" />
    865     <strong><span class="toggle-content-text">Show example</span>
    866     <span class="toggle-content-text" style="display:none;">Hide example</span></strong>
    867   </a></p>
    868 
    869   <div class="toggle-content-toggleme">
    870     <p><pre>09-14 07:29:20.433 15736 15736 I dex2oat : /system/bin/dex2oat -j4 --dex-file=/data/user/0/com.facebook.katana/app_secondary_program_dex/program-72cef82b591768306676e10161c886b58b34315a308602be.dex.jar --oat-file=/data/user/0/com.facebook.katana/app_secondary_program_dex_opt/program-72cef82b591768306676e10161c886b58b34315a308602be.dex.dex
    871 ...
    872 09-14 07:29:25.102 15736 15736 I dex2oat : dex2oat took 4.669s (threads: 4) arena alloc=7MB java alloc=3MB native alloc=29MB free=4MB</pre></p>
    873   </div>
    874 </div>
    875 
    876 <h2 id="narrative">Narrative</h2>
    877 <p>Establishing the narrative of a problem (how it started, what happened, how
    878 the system reacted) requires a solid timeline of events. You can use the
    879 information in the bug report to sync timelines across multiple logs and
    880 determine the exact timestamp of the bug report.</p>
    881 
    882 <h3 id="timelines">Syncing timelines</h3>
    883 <p>A bugreport reflects multiple parallel timelines: system log, event log,
    884 kernel log, and multiple specialized timelines for broadcasts, battery stats,
    885 etc. Unfortunately, timelines are often reported using different time bases.</p>
    886 
    887 <p>The system and event log timestamps are in the same timezone as the user (as
    888 are most other timestamps). For example, when user taps the home button, the
    889 system log reports:</p>
    890 <p><pre>10-03 17:19:52.939  1963  2071 I ActivityManager: START u0 {act=android.intent.action.MAIN cat=[android.intent.category.HOME] flg=0x10200000 cmp=com.google.android.googlequicksearchbox/com.google.android.launcher.GEL (has extras)} from uid 1000 on display 0</pre></p>
    891 
    892 <p>For the same action, the event log reports:</p>
    893 <p><pre>10-03 17:19:54.279  1963  2071 I am_focused_activity: [0,com.google.android.googlequicksearchbox/com.google.android.launcher.GEL]</pre></p>
    894 
    895 <p>Kernel (<code>dmesg</code>) logs use a different time base, tagging log items
    896 with seconds since bootloader completes. To register this timescale to other
    897 timescales, search for <em>suspend exit</em> and <em>suspend entry</em> messages:</p>
    898 <p><pre>&lt;6&gt;[201640.779997] PM: suspend exit 2015-10-03 19:11:06.646094058 UTC
    899 
    900 &lt;6&gt;[201644.854315] PM: suspend entry 2015-10-03 19:11:10.720416452 UTC</pre></p>
    901 
    902 <p>Because kernel logs might not include time while in suspend, you should
    903 piecewise register the log between the suspend entry and exit messages.
    904 Additionally, kernel logs use UTC timezone and must be adjusted to the user
    905 timezone.</p>
    906 
    907 <h3 id="time-of-bugreport">Identifying bugreport time</h3>
    908 <p>To determine when a bugreport was taken, first check the system log (Logcat)
    909 for the <code>dumpstate: begin</code>:</p>
    910 <p><pre>10-03 17:19:54.322 19398 19398 I dumpstate: begin</pre></p>
    911 
    912 <p>Next, check the kernel log (<code>dmesg</code>) timestamps for the <code>Starting service
    913 'bugreport'</code> message:</p>
    914 <p><pre>&lt;5&gt;[207064.285315] init: Starting service 'bugreport'...</pre></p>
    915 
    916 <p>Work backwards to correlate the two events, keeping in mind the caveats
    917 mentioned in <a href="#timelines">Syncing timelines</a>. While there's a lot
    918 happening after the bugreport is initiated, most activity isn't very useful as
    919 the act of taking the bugreport loads the system substantially.</p>
    920 
    921 <h2 id="power">Power</h2>
    922 
    923 <p>The event log contains screen power status, where 0 is screen off, 1 is
    924 screen on, and 2 is for keyguard done.</p>
    925 
    926 <div class="toggle-content closed">
    927   <p><a href="#" onclick="return toggleContent(this)">
    928     <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img" />
    929     <strong><span class="toggle-content-text">Show example</span>
    930     <span class="toggle-content-text" style="display:none;">Hide example</span></strong>
    931   </a></p>
    932 
    933   <div class="toggle-content-toggleme">
    934     <p><pre>grep screen_toggled bugreport-2015-10-18-16-52-22.txt
    935 10-18 15:05:04.383   992   992 I screen_toggled: 1
    936 10-18 15:05:07.010   992   992 I screen_toggled: 0
    937 10-18 15:23:15.063   992   992 I screen_toggled: 1
    938 10-18 15:23:25.684   992   992 I screen_toggled: 0
    939 10-18 15:36:31.623   992   992 I screen_toggled: 1
    940 10-18 15:36:37.660  3283  3283 I screen_toggled: 2</pre></p>
    941   </div>
    942 </div>
    943 <p></p>
    944 <p>Bug reports also contain statistics about wake locks, a mechanism used by
    945 application developers to indicate their application needs to have the device
    946 stay on. (For details on wake locks, refer to
    947 <a href="https://developer.android.com/reference/android/os/PowerManager.WakeLock.html">PowerManager.WakeLock</a>
    948 and <a href="https://developer.android.com/training/scheduling/wakelock.html#cpu">Keep
    949 the CPU on</a>.)
    950 
    951 <p>The aggregated wake lock duration statistics track <strong>only</strong> the
    952 time a wake lock is actually responsible for keeping the device awake and
    953 <strong>do not</strong> include time with the screen on. In addition, if
    954 multiple wake locks are held simultaneously, the wake lock duration time is
    955 distributed across those wake locks.</p>
    956 
    957 <p>For more help visualizing power status, use
    958 <a href="https://github.com/google/battery-historian">Battery Historian</a>, a
    959 Google open source tool to analyze battery consumers using Android bugreport
    960 files.</p>
    961 
    962 <h2 id="packages">Packages</h2>
    963 <p>The DUMP OF SERVICE package contains application versions (and other useful
    964 info).</p>
    965 
    966 <div class="toggle-content closed">
    967   <p><a href="#" onclick="return toggleContent(this)">
    968     <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img" />
    969     <strong><span class="toggle-content-text">Show example</span>
    970     <span class="toggle-content-text" style="display:none;">Hide example</span></strong>
    971   </a></p>
    972 
    973   <div class="toggle-content-toggleme">
    974     <p><pre>...
    975 Packages:
    976 ...
    977  Package [com.google.android.gms] (3cf534b):
    978    userId=10013
    979    sharedUser=SharedUserSetting{98f3d28 com.google.uid.shared/10013}
    980    pkg=Package{b8f6a41 com.google.android.gms}
    981    codePath=/system/priv-app/PrebuiltGmsCore
    982    resourcePath=/system/priv-app/PrebuiltGmsCore
    983    legacyNativeLibraryDir=/system/priv-app/PrebuiltGmsCore/lib
    984    primaryCpuAbi=arm64-v8a
    985    secondaryCpuAbi=armeabi-v7a
    986    versionCode=8186448 targetSdk=23
    987    versionName=8.1.86 (2287566-448)
    988    splits=[base]
    989    applicationInfo=ApplicationInfo{5158507 com.google.android.gms}
    990    flags=[ SYSTEM HAS_CODE ALLOW_CLEAR_USER_DATA ]
    991    privateFlags=[ PRIVILEGED ]
    992    dataDir=/data/user/0/com.google.android.gms
    993    supportsScreens=[small, medium, large, xlarge, resizeable, anyDensity]
    994    libraries:
    995      com.google.android.gms
    996    usesOptionalLibraries:
    997      com.android.location.provider
    998      com.google.android.ble
    999      com.android.media.remotedisplay
   1000    usesLibraryFiles:
   1001      /system/framework/com.android.media.remotedisplay.jar
   1002      /system/framework/com.android.location.provider.jar
   1003    timeStamp=2015-10-14 15:17:56
   1004    firstInstallTime=2015-09-22 14:08:35
   1005    lastUpdateTime=2015-10-14 15:17:56
   1006    signatures=PackageSignatures{db63be6 [1af63d8]}
   1007    installPermissionsFixed=true installStatus=1
   1008    pkgFlags=[ SYSTEM HAS_CODE ALLOW_CLEAR_USER_DATA ]
   1009    declared permissions:
   1010      com.google.android.gms.permission.INTERNAL_BROADCAST: prot=signature, INSTALLED
   1011      ...
   1012      com.google.android.gms.permission.CAR_VENDOR_EXTENSION: prot=dangerous, INSTALLED
   1013    User 0:  installed=true hidden=false stopped=false notLaunched=false enabled=0
   1014      disabledComponents:
   1015        com.google.android.gms.icing.service.PowerConnectedReceiver
   1016        ...
   1017        com.google.android.gms.icing.proxy.AppsMonitor
   1018      enabledComponents:
   1019        com.google.android.gms.mdm.receivers.GmsRegisteredReceiver
   1020        ...
   1021        com.google.android.gms.subscribedfeeds.SyncService</pre></p>
   1022   </div>
   1023 </div>
   1024 
   1025 <h2 id="processes">Processes</h2>
   1026 <p>Bug reports contain a huge amount of data for processes, including start and
   1027 stop time, runtime length, associated services, <code>oom_adj</code> score, etc.
   1028 For details on how Android manages processes, refer to
   1029 <a href="http://developer.android.com/guide/components/processes-and-threads.html">Processes
   1030 and Threads</a>.</p>
   1031 
   1032 <h3 id="process-runtime">Determining process runtime</h3>
   1033 <p>The <code>procstats</code> section contains complete statistics on how long
   1034 processes and associated services have been running. For a quick, human-readable
   1035 summary, search for <code>AGGREGATED OVER</code> to view data from either the
   1036 last three or 24 hours, then search for <code>Summary:</code> to view the list
   1037 of processes, how long those processes have run at various priorities, and their
   1038 RAM usage formatted as min-average-max PSS/min-average-max USS.</p>
   1039 
   1040 <div class="toggle-content closed">
   1041   <p><a href="#" onclick="return toggleContent(this)">
   1042     <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img" />
   1043     <strong><span class="toggle-content-text">Show example</span>
   1044     <span class="toggle-content-text" style="display:none;">Hide example</span></strong>
   1045   </a></p>
   1046 
   1047   <div class="toggle-content-toggleme">
   1048     <p><pre>-------------------------------------------------------------------------------
   1049 DUMP OF SERVICE processinfo:
   1050 -------------------------------------------------------------------------------
   1051 DUMP OF SERVICE procstats:
   1052 COMMITTED STATS FROM 2015-10-19-23-54-56 (checked in):
   1053 ...
   1054 COMMITTED STATS FROM 2015-10-20-03-00-00 (checked in):
   1055 ...
   1056 CURRENT STATS:
   1057 ...
   1058 AGGREGATED OVER LAST 24 HOURS:
   1059 System memory usage:
   1060 ...
   1061 Per-Package Stats:
   1062 ...
   1063 Summary:
   1064 ...
   1065   * com.google.android.gms.persistent / u0a13 / v8186448:
   1066            TOTAL: 100% (21MB-27MB-40MB/20MB-24MB-38MB over 597)
   1067              Top: 51% (22MB-26MB-38MB/21MB-24MB-36MB over 383)
   1068           Imp Fg: 49% (21MB-27MB-40MB/20MB-25MB-38MB over 214)
   1069 
   1070           Start time: 2015-10-19 09:14:37
   1071   Total elapsed time: +1d0h22m7s390ms (partial) libart.so
   1072 
   1073 AGGREGATED OVER LAST 3 HOURS:
   1074 System memory usage:
   1075 ...
   1076 Per-Package Stats:
   1077 ...
   1078 Summary:
   1079   * com.google.android.gms.persistent / u0a13 / v8186448:
   1080            TOTAL: 100% (23MB-27MB-32MB/21MB-25MB-29MB over 111)
   1081              Top: 61% (23MB-26MB-31MB/21MB-24MB-28MB over 67)
   1082           Imp Fg: 39% (23MB-28MB-32MB/21MB-26MB-29MB over 44)
   1083 ...
   1084           Start time: 2015-10-20 06:49:24
   1085   Total elapsed time: +2h46m59s736ms (partial) libart.so</pre></p>
   1086   </div>
   1087 </div>
   1088 
   1089 <h3 id="why-is-process-running">Why is a process running?</h3>
   1090 <p>The <code>dumpsys activity processes</code> section lists all currently
   1091 running processes ordered by <code>oom_adj</code> score (Android indicates
   1092 process importance by assigning the process an <code>oom_adj</code> value, which
   1093 can be dynamically updated by ActivityManager). The output is similar to that of
   1094 a <a href="#memory-snapshot">memory snapshot</a> but includes additional
   1095 information about what is causing the process to run. In the example below,
   1096 the bolded entries indicate the <code>gms.persistent</code> process is running
   1097 at <code>vis</code> (visible) priority because the system process is bound to
   1098 its <code>NetworkLocationService</code>.</p>
   1099 
   1100 <div class="toggle-content closed">
   1101   <p><a href="#" onclick="return toggleContent(this)">
   1102     <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img" />
   1103     <strong><span class="toggle-content-text">Show example</span>
   1104     <span class="toggle-content-text" style="display:none;">Hide example</span></strong>
   1105   </a></p>
   1106 
   1107   <div class="toggle-content-toggleme">
   1108     <p><pre>-------------------------------------------------------------------------------
   1109 ACTIVITY MANAGER RUNNING PROCESSES (dumpsys activity processes)
   1110 ...
   1111 Process LRU list (sorted by oom_adj, 34 total, non-act at 14, non-svc at 14):
   1112     PERS #33: sys   F/ /P  trm: 0 902:system/1000 (fixed)
   1113     PERS #32: pers  F/ /P  trm: 0 2925:com.android.systemui/u0a27 (fixed)
   1114     PERS #31: pers  F/ /P  trm: 0 3477:com.quicinc.cne.CNEService/1000 (fixed)
   1115     PERS #30: pers  F/ /P  trm: 0 3484:com.android.nfc/1027 (fixed)
   1116     PERS #29: pers  F/ /P  trm: 0 3502:com.qualcomm.qti.rcsbootstraputil/1001 (fixed)
   1117     PERS #28: pers  F/ /P  trm: 0 3534:com.qualcomm.qti.rcsimsbootstraputil/1001 (fixed)
   1118     PERS #27: pers  F/ /P  trm: 0 3553:com.android.phone/1001 (fixed)
   1119     Proc #25: psvc  F/ /IF trm: 0 4951:com.android.bluetooth/1002 (service)
   1120         com.android.bluetooth/.hfp.HeadsetService&lt;=Proc{902:system/1000}
   1121     Proc # 0: fore  F/A/T  trm: 0 3586:com.google.android.googlequicksearchbox/u0a29 (top-activity)
   1122   Proc #26: vis   F/ /SB trm: 0 3374:com.google.android.googlequicksearchbox:interactor/u0a29 (service)
   1123         com.google.android.googlequicksearchbox/com.google.android.voiceinteraction.GsaVoiceInteractionService&lt;=Proc{902:system/1000}
   1124 <b>    Proc # 5: vis   F/ /T  trm: 0 3745:com.google.android.gms.persistent/u0a12 (service)</b>
   1125 <b>        com.google.android.gms/com.google.android.location.network.NetworkLocationService&lt;=Proc{902:system/1000}</b>
   1126     Proc # 3: vis   F/ /SB trm: 0 3279:com.google.android.gms/u0a12 (service)
   1127         com.google.android.gms/.icing.service.IndexService&lt;=Proc{947:com.google.android.googlequicksearchbox:search/u0a29}
   1128     Proc # 2: vis   F/ /T  trm: 0 947:com.google.android.googlequicksearchbox:search/u0a29 (service)
   1129         com.google.android.googlequicksearchbox/com.google.android.sidekick.main.remoteservice.GoogleNowRemoteService&lt;=Proc{3586:com.google.android.googlequicksearchbox/u0a29}
   1130     Proc # 1: vis   F/ /T  trm: 0 2981:com.google.process.gapps/u0a12 (service)
   1131         com.google.android.gms/.tapandpay.hce.service.TpHceService&lt;=Proc{3484:com.android.nfc/1027}
   1132     Proc #11: prcp  B/ /IB trm: 0 3392:com.google.android.inputmethod.latin/u0a64 (service)
   1133         com.google.android.inputmethod.latin/com.android.inputmethod.latin.LatinIME&lt;=Proc{902:system/1000}
   1134     Proc #24: svc   B/ /S  trm: 0 27071:com.google.android.music:main/u0a67 (started-services)
   1135     Proc #22: svc   B/ /S  trm: 0 853:com.qualcomm.qcrilmsgtunnel/1001 (started-services)
   1136     Proc # 4: prev  B/ /LA trm: 0 32734:com.google.android.GoogleCamera/u0a53 (previous)
   1137     Proc #23: svcb  B/ /S  trm: 0 671:com.qualcomm.telephony/1000 (started-services)
   1138     Proc #20: cch   B/ /CE trm: 0 27659:com.android.providers.calendar/u0a2 (provider)
   1139         com.android.providers.calendar/.CalendarProvider2&lt;=Proc{27697:com.google.android.calendar/u0a40}
   1140     Proc #13: cch   B/ /CE trm: 0 653:com.google.android.gms.wearable/u0a12 (cch-empty)
   1141     Proc #10: cch   B/ /S  trm: 0 4067:com.google.android.talk/u0a62 (cch-started-ui-services)
   1142     Proc # 7: cch   B/ /S  trm: 0 18868:com.google.corp.huddle.android/u0a95 (cch-started-ui-services)
   1143     Proc # 6: cch   B/ /CA trm: 0 27697:com.google.android.calendar/u0a40 (cch-act)
   1144     Proc # 8: cch+1 B/ /CA trm: 0 25675:com.google.android.apps.genie.geniewidget/u0a81 (cch-act)
   1145     Proc #16: cch+2 B/ /CE trm: 0 1272:com.google.android.keep/u0a106 (cch-empty)
   1146     Proc #15: cch+2 B/ /CE trm: 0 885:android.process.media/u0a9 (cch-empty)
   1147     Proc #14: cch+2 B/ /CE trm: 0 15146:android.process.acore/u0a3 (cch-empty)
   1148     Proc # 9: cch+3 B/ /CA trm: 0 17016:com.google.android.gm/u0a79 (cch-act)
   1149     Proc #19: cch+4 B/ /CE trm: 0 973:com.google.android.apps.maps/u0a66 (cch-empty)
   1150     Proc #18: cch+4 B/ /CE trm: 0 1091:com.google.android.apps.photos/u0a71 (cch-empty)
   1151     Proc #17: cch+4 B/ /CE trm: 0 1141:com.google.android.apps.plus/u0a74 (cch-empty)
   1152     Proc #12: cch+5 B/ /CA trm: 0 22299:com.google.android.apps.dogfood/u0a105 (cch-act)
   1153     Proc #21: cch+6 B/ /CE trm: 0 995:com.google.android.partnersetup/u0a18 (cch-empty)></pre></p>
   1154   </div>
   1155 </div>
   1156 
   1157 <h2 id=scans>Scans</h2>
   1158 <p>Use the following steps to identify applications performing excessive
   1159 Bluetooth Low Energy (BLE) scans:</p>
   1160 <ul>
   1161 <li>Find log messages for <code>BluetoothLeScanner</code>:
   1162 <pre>
   1163 $ grep 'BluetoothLeScanner' ~/downloads/bugreport.txt
   1164 07-28 15:55:19.090 24840 24851 D BluetoothLeScanner: onClientRegistered() - status=0 clientIf=5
   1165 </pre></li>
   1166 <li>Locate the PID in the log messages. In this example, "24840" and
   1167 "24851" are PID (process ID) and TID (thread ID).</li>
   1168 <li>Locate the application associated with the PID:
   1169 <pre>
   1170 PID #24840: ProcessRecord{4fe996a 24840:com.badapp/u0a105}
   1171 </pre>
   1172 <p>In this example, the package name is <code>com.badapp</code>.</li>
   1173 <li>Look up the package name on Google Play to identify the responsible
   1174 application:
   1175 <strong>https://play.google.com/store/apps/details?id=com.badapp</strong>.</li>
   1176 </ul>
   1177 <p class=note><strong>Note</strong>: For devices running Android 7.0, the
   1178 system collects data for BLE scans and associates these activities
   1179 with the initiating application. For details, see
   1180 <a href="{@docRoot}devices/tech/power/values.html#le-bt-scans">Low Energy (LE)
   1181 and Bluetooth scans</a>.</p>
   1182