Android bugreport analysis method

bugreport overview

Android bugreport is a tool for diagnosing and fixing problems with Android devices. It contains all the status and information of the Android device at a certain point in time, including various CPU, RAM, network and I/O information, as well as some logs and statistics, etc. Compared with reporting problems through user feedback and other means, analyzing Android bugreport can more accurately understand and diagnose problems.

To analyze an Android bugreport file, you can follow these steps:

  1. Find basic information: Check basic information such as phone model, firmware version, system build number, etc., to understand the hardware and software environment of the phone.

  2. Find statistical information: View system statistical information to understand the CPU, memory, network usage, etc. of the mobile phone. These information are very helpful for checking the health of the mobile phone.

  3. Find the exception log: Check the exception log to find the error message that caused the problem. The error message may include application crash, system log or service stop, etc.

  4. Use tools to analyze: Use tools to analyze log information, such as the Profiler tool of Android Studio, adb logcat, etc., which can help you analyze exception logs in depth and find the specific cause of the problem.

generate bugreport

Direct adb bugreport generation

adb bugreport
/data/user_de/0/com.android.shell/files/bugreports/bugreport-frost-RD2A.211001.002-2022-07-26-09-29-01.zip: 1 file pulled, 0 skipped. 27.4 MB/s (23057334 bytes in 0.802s)
Bug report copied to C:\Users\86185\bugreport-frost-RD2A.211001.002-2022-07-26-09-29-01.zip

Android bugreport content analysis

A zip package is directly generated, about 20M in size; the directory after decompression of
bugreport-xxxxx-2022-07-26-09-29-01.zip
is as follows:

|-- FS
|-- bugreport-W6501-TP1A.220624.014-2023-06-01-20-52-54.txt
|-- dumpstate_log.txt
|-- lshal-debug
|-- main_entry.txt
|-- proto
|-- version.txt
`-- visible_windows.zip
  • FS is a directory containing the following subdirectories:
    data key information under data such as tombstone, ANR, logd information, etc.
    proc dump information of each process procfs
    linkerconfig TBD
  • lshal-debug lshal information of the key HAL process
  • proto TBD
    dumpstate_board.txt Execute the dumpstate process information of bugreport
  • The file name of main_entry.txt dump
  • dumpstate_log.txt execute dumpstate log information
  • version.txt TBD
  • visible_windows.zip TBD
    If ANR, crash and other events occur, the content under FS is very important. Both the trace and tombstone files of ANR can be found, which can be analyzed in combination with bugreport txt files
  • bugreport-xxx-211001.002-2022-07-26-09-29-01.txt
    This file contains the ALL info of the system dump and the log before and after the dump time point, including:
    system information: dump time point, system version , kernel version, runtime, Bootcmd
========================================================
== dumpstate: 2022-07-26 09:29:01
========================================================
Build: frost-userdebug 11 RD2A.211001.002 C3QP_R_V0.9.15.R1-0577-20220720 test-keys
Build fingerprint: 'Redmi/frost/frost:11/RD2A.211001.002/C3QP_R_V0.9.15.R1-0577-20220720:userdebug/test-keys'
Bootloader: unknown
Radio: MPSS.HA.1.0.c2-00414-QTANG2_LWG_PACK-1,MPSS.HA.1.0.c2-00414-QTANG2_LWG_PACK-1
Network: ,
Module Metadata version: 30
Kernel: Linux version 5.4.191-jgki-debug+ (scm@SS-AIMM02) (Android (6443078 based on r383902) clang version 11.0.1 (https://android.googlesource.com/toolchain/llvm-project b397f81060ce6d701042b782172ed13bee898b79), LLD 11.0.1 (/buildbot/tmp/tmp6_m7QH b397f81060ce6d701042b782172ed13bee898b79)) #1 SMP PREEMPT Wed Jul 20 02:28:27 CST 2022
Command line: security=selinux androidboot.hardware=jlq iommu.strict=0 firmware_class.path=/etc/firmware swiotlb=2048 rcu_nocbs=0-7 kpti=off rcupdate.rcu_expedited=1 earlycon=uart8250,mmio32,0x3450F000 console=jlqttyS1,115200n8 no_console_suspend loglevel=7 page_owner=on printk.devkmsg=on buildvariant=userdebug  androidboot.verifiedbootstate=orange androidboot.vbmeta.device=PARTUUID=7db6ac55-ecb5-4e02-80da-4d335b973332 androidboot.vbmeta.avb_version=1.0 androidboot.vbmeta.device_state=unlocked androidboot.secureboot=0 androidboot.vbmeta.hash_alg=sha256 androidboot.vbmeta.size=7168 androidboot.vbmeta.digest=9d001b15f4485a96b573fa13c001ac965a9cd10f43c5734ee92815b91827a401 androidboot.veritymode=disabled androidboot.bootdevice=34458000.sdhci androidboot.boot_devices=0.soc/34458000.sdhci androidboot.serialno=d4081bbb androidboot.sysdump=1 androidboot.cpuid=0x2124a4815baaeebd2102628ed64fc07400000000000000000000000000000000 androidboot.bootreason=0 androidboot.baseband=msm androidboot.hwname=frost androidboot.hwc=Global androidboot.hwversion=1.21.0 androidboot.hwlevel=1 androidboot.product.hardware.sku=c3qpa panel_cfg=xiaomi C3QP 35 02 0a hd+ video dsi panel,display_init=1 androidboot.slot_suffix=_a rootwait ro init=\init androidboot.dtbo_idx=6,9,15  androidboot.dtb_idx=0 androidboot.force_normal_boot=1
Uptime: up 0 weeks, 6 days, 6 hours, 1 minute
Bugreport format version: 2.0
Dumpstate info: id=2 pid=20089 dry_run=0 args=/system/bin/dumpstate -S -d -z bugreport_mode=

dumpsys information

dumpsys SurfaceFlinger
关键字:
DUMP OF SERVICE CRITICAL SurfaceFlinger:
was the duration of dumpsys SurfaceFlinger

dumpsys activity activities
关键字:
ACTIVITY MANAGER ACTIVITIES (dumpsys activity activities)
was the duration of dumpsys activity

dumpsys cpuinfo
keywords:
was the duration of dumpsys cpuinfo

dumpsys input
keyword:
was the duration of dumpsys input

dumpsys notification
关键字:
was the duration of dumpsys notification

dumpsys power
keyword:
was the duration of dumpsys power

dumpsys sensorservice
关键字:
was the duration of dumpsys sensorservice

dumpsys window lastanr
关键字:
WINDOW MANAGER LAST ANR (dumpsys window lastanr)

dumpsys window policy
关键字:
WINDOW MANAGER POLICY STATE (dumpsys window policy)

dumpsys window animator
关键字:
WINDOW MANAGER ANIMATOR STATE (dumpsys window animator)

dumpsys window sessions
关键字:
WINDOW MANAGER SESSIONS (dumpsys window sessions)

dumpsys window displays
关键字:
WINDOW MANAGER DISPLAY CONTENTS (dumpsys window displays)

dumpsys window tokensKeyword
:
WINDOW MANAGER TOKENS (dumpsys window tokens)

dumpsys window windows
关键字:
WINDOW MANAGER WINDOWS (dumpsys window windows)

dumpsys window trace
关键字:
WINDOW MANAGER TRACE (dumpsys window trace)

dumpsys window logging
关键字:
WINDOW MANAGER LOGGING (dumpsys window logging)

dumpsys window refresh
关键字:
WINDOW MANAGER HIGH REFRESH RATE BLACKLIST (dumpsys window refresh)

dumpsys window constants
关键字:
WINDOW MANAGER CONSTANTS (dumpsys window constants):

lgcat information

关键字:
system log:
------ SYSTEM LOG (logcat -v threadtime -v printable -v uid -d *:v) ------
------ was the duration of ‘SYSTEM LOG’ ------

event log:
------ EVENT LOG (logcat -b events -v threadtime -v printable -v uid -d *:v) ------
------ was the duration of ‘EVENT LOG’ ------

stat log:
------ STATS LOG (logcat -b stats -v threadtime -v printable -v uid -d *:v) ------
------ was the duration of ‘STATS LOG’ ------

radio log:
------ RADIO LOG (logcat -b radio -v threadtime -v printable -v uid -d *:v) ------
------ was the duration of ‘RADIO LOG’ ------

last log:
------ LAST LOGCAT (logcat -L -b all -v threadtime -v printable -v uid -d *:v) ------

chkbugreport tool

Because bugreport contains too much information, it is difficult to find classified information, so there is an open source tool chkbugreport for analyzing bugreport txt files; its function is to analyze and process bugreports generated on mobile phones, and extract as much useful data as possible for developers;
For specific usage, please refer to the following article:
BugReport analysis tool ChkBugReport

Guess you like

Origin blog.csdn.net/weixin_44008788/article/details/131294133