版權(quán)聲明:本文為作者原創(chuàng)愕乎,轉(zhuǎn)載必須注明出處唠亚。
轉(zhuǎn)載請注明出處:http://www.reibang.com/p/907028bac94a
Bugreport
上一篇文章Bugreport源碼篇主要是從源碼角度來分析了一下系統(tǒng)是如何生成Bugreport的凉袱,以及Bugreport的源碼實現(xiàn)版述。本篇主要從使用角度來對Bugreport中包含的內(nèi)容做相關(guān)介紹遥巴。也是基于Android 8.0版本婿失,由于Bugreport獲取的內(nèi)容很長,這里只能簡單劃分如下21塊內(nèi)容剿吻,簡單說說各部分log的信息窍箍。
注:這里拿小米手機dump的bugreport內(nèi)容來做介紹
1、系統(tǒng)build相關(guān)信息
========================================================
== dumpstate: 2018-11-10 00:22:54
========================================================
Build: OPM1.171019.011
Build fingerprint: 'xiaomi/tulip/tulip:8.1.0/OPM1.171019.011/8.11.9:user/release-keys'
Bootloader: unknown
Radio: 660_GEN_PACK-1.174030.1.174977.1
Network: (unknown)
Kernel: Linux version 4.4.78-perf+ (builder@mi-server) (gcc version 4.9.x 20150123 (prerelease) (GCC) ) #1 SMP PREEMPT Fri Nov 9 04:24:09 WIB 2018
Command line: ramoops_memreserve=4M rcupdate.rcu_expedited=1 console=ttyMSM0,115200,n8 androidboot.console=ttyMSM0 earlycon=msm_serial_dm,0xc170000 androidboot.hardware=qcom user_debug=31 msm_rtb.filter=0x37 ehci-hcd.park=3 lpm_levels.sleep_disabled=1 sched_enable_hmp=1 sched_enable_power_aware=1 service_locator.enable=1 swiotlb=1 androidboot.configfs=true androidboot.usbcontroller=a800000.dwc3 buildvariant=user root=/dev/mmcblk0p61 androidboot.verifiedbootstate=orange androidboot.keymaster=1 androidboot.veritymode=enforcing androidboot.bootdevice=c0c4000.sdhci androidboot.serialno=a02f873c androidboot.hwc=Global androidboot.hwversion=4.20.0 androidboot.hwlevel=0 androidboot.hwdefined=0 androidboot.baseband=sdm mdss_mdp.panel=1:dsi:0:qcom,mdss_dsi_nt36672a_tianma_fhdplus_video:config0:1:none:cfg:single_dsi androidboot.fpsensor=fpc androidboot.secureboot=0
Bugreport format version: 1.0
Dumpstate info: id=5 pid=27250 dry_run=0 args=/system/bin/dumpstate -s extra_options=
系統(tǒng)build信息如下:
- dumpstate:
date
- Build: getprop
ro.build.display.id
- Build fingerprint: getprop
ro.build.fingerprint
- Bootloader: getprop
ro.bootloader
- Radio:getprop
gsm.version.baseband
- Network: getprop
gsm.operator.alpha
- Kernel: dump_file
/proc/version
- Command line: cat
/proc/cmdline
系統(tǒng)運行時間:
------ UPTIME (uptime) ------
00:22:55 up 4:42, 0 users, load average: 44.10, 46.18, 42.83
------ 0.018s was the duration of 'UPTIME' ------
- up即為uptime:系統(tǒng)運行時長
00:22:55
- idle time:系統(tǒng)空閑時長
4:42
- user:用戶數(shù)
0
- load average:cup 最近1min,5min,15min的平均負載情況.
這個值的標準由cpu有多少個核來決定
2丽旅、下面列舉bugreport結(jié)果相關(guān)項
------ DUMPSYS MEMINFO (/system/bin/dumpsys -t 90 meminfo -a) ------
------ DUMPSYS CPUINFO (/system/bin/dumpsys -t 10 cpuinfo -a) ------
------ PROCRANK (procrank) ------
------ VIRTUAL MEMORY STATS (/proc/vmstat) ------
------ VMALLOC INFO (/proc/vmallocinfo) ------
------ SLAB INFO (/proc/slabinfo) ------
------ ZONEINFO (/proc/zoneinfo) ------
------ PAGETYPEINFO (/proc/pagetypeinfo) ------
------ BUDDYINFO (/proc/buddyinfo) ------
------ FRAGMENTATION INFO (/d/extfrag/unusable_index) ------
------ KERNEL WAKE SOURCES (/d/wakeup_sources) ------
------ KERNEL CPUFREQ (/sys/devices/system/cpu/cpu0/cpufreq/stats/time_in_state) ------
------ KERNEL SYNC (/d/sync) ------
------ QSEE_LOG (cat /d/tzdbg/qsee_log) ------
------ TZ_LOG (cat /d/tzdbg/log) ------
------ PROCESSES AND THREADS (ps -A -T -Z -O pri,nice,rtprio,sched,pcy) ------
------ LIBRANK (librank) ------
------ PRINTENV (printenv) ------
------ NETSTAT (netstat -nW) ------
3椰棘、kernel log
內(nèi)核log信息
------ KERNEL LOG (dmesg) ------
4、lsof榄笙、map邪狞、block process wait-channels、process times
需要root權(quán)限
Skipping '/system/xbin/su root lsof' on user build.
------ 0.000s was the duration of 'LIST OF OPEN FILES' ------
------ SHOW MAP 1 (/init) (/system/xbin/su root showmap 1) ------
------ PROCESS TIMES (pid cmd user system iowait+percentage) ------
1 /init 5.77 5.28 0.00
5茅撞、system log
其實調(diào)用的是logcat system和main緩沖區(qū)的log
------ SYSTEM LOG (logcat -v threadtime -v printable -v uid -d *:v) ------
--------- beginning of crash
--------- beginning of system
--------- beginning of main
6外恕、event log
調(diào)用的是logcat events緩沖區(qū)的log
------ EVENT LOG (logcat -b events -v threadtime -v printable -v uid -d *:v) ------
7、radio log
調(diào)用的是logcat radio緩沖區(qū)的log
------ RADIO LOG (logcat -b radio -v threadtime -v printable -v uid -d *:v) ------
8乡翅、log statistics
記錄了main/radio/events/system/crash/security/kernel等各個log的使用情況
------ LOG STATISTICS (logcat -b all -S) ------
size/num main radio events system crash security kernel Total
Total 500424586/6305580 5790723/77563 50150183/584809 70541684/485432 4748/7 0/0 6764031/100345 633675955/7553736
Now 255769/3591 3596015/51755 259743/2887 4187060/29223 4748/7 256047/3682 8559382/91145
Logspan 51.296(44.3%) 4:43:15.343 4:38.941 1:58:43.109(6.9%) 1:12:55.143 4:43:51.288
Overhead 456865 6494295 421415 5823548 5140 462239 14029033
...
9鳞疲、vm trace
------ VM TRACES JUST NOW (/data/anr/dumptrace_EEGHQP: 2018-11-10 00:23:44) ------
----- pid 711 at 2018-11-10 00:23:31 -----
------ VM TRACES AT LAST ANR (/data/anr/anr_2018-11-09-23-50-52-579: 2018-11-09 23:51:14) ------
----- pid 31377 at 2018-11-09 23:50:54 -----
------ TOMBSTONE (/data/tombstones/tombstone_01: 2018-11-09 11:16:18) ------
若沒有
*** NO TOMBSTONES to dump in /data/tombstones/
10、network
------ NETWORK DEV INFO (/proc/net/dev) ------
------ QTAGUID NETWORK INTERFACES INFO (/proc/net/xt_qtaguid/iface_stat_all) ------
------ QTAGUID NETWORK INTERFACES INFO (xt) (/proc/net/xt_qtaguid/iface_stat_fmt) ------
------ QTAGUID CTRL INFO (/proc/net/xt_qtaguid/ctrl) ------
------ QTAGUID STATS INFO (/proc/net/xt_qtaguid/stats) ------
11蠕蚜、last kernel log
------ LAST KMSG (/proc/last_kmsg) ------
12尚洽、ip相關(guān)
------ NETWORK INTERFACES (ip link) ------
------ IPv4 ADDRESSES (ip -4 addr show) ------
------ IPv6 ADDRESSES (ip -6 addr show) ------
------ IP RULES (ip rule show) ------
------ IP RULES v6 (ip -6 rule show) ------
------ RT_TABLES (/data/misc/net/rt_tables: 2018-11-09 23:17:14) ------
------ ROUTE TABLE IPv4 (ip -4 route show table 255) ------
------ ROUTE TABLE IPv6 (ip -6 route show table 255) ------
------ ARP CACHE (ip -4 neigh show) ------
------ IPv6 ND CACHE (ip -6 neigh show) ------
------ MULTICAST ADDRESSES (ip maddr) ------
13、中斷向量表
這一塊跟android6.0相比少了INTERRUPTS
------ NETWORK DIAGNOSTICS (/system/bin/dumpsys -t 10 connectivity --diag) ------
14靶累、system property信息
------ SYSTEM PROPERTIES (getprop) ------
vold進程:管理和控制Android平臺外部存儲設(shè)備腺毫,包括SD插撥癣疟、掛載、卸載潮酒、格式化等睛挚;vold進程接收來自內(nèi)核的外部設(shè)備消息。
------ VOLD DUMP (vdc dump) ------
------ SECURE CONTAINERS (vdc asec list) ------
------ STORAGED TASKIOINFO (storaged -u) ------
------ FILESYSTEMS & FREE SPACE (df) ------
Filesystem 1K-blocks Used Available Use% Mounted on
tmpfs 1895568 764 1894804 1% /dev
/dev/block/platform/soc/c0c4000.sdhci/by-name/system 2982364 2679276 255740 92% /system
/dev/block/platform/soc/c0c4000.sdhci/by-name/vendor 1999196 727564 1234608 38% /vendor
tmpfs 1895568 0 1895568 0% /mnt
none 1895568 0 1895568 0% /sys/fs/cgroup
/dev/block/bootdevice/by-name/cust 822168 782032 15236 99% /cust
/dev/block/bootdevice/by-name/modem 196528 109488 87040 56% /firmware
/dev/block/bootdevice/by-name/bluetooth 65488 480 65008 1% /bt_firmware
/dev/block/mmcblk0p60 237536 504 229172 1% /cache
/dev/block/dm-0 52950544 3700556 49102532 8% /data
/data/media 52950544 3700556 49102532 8% /storage/emulated
15急黎、last radio log
------ LAST RADIO LOG (parse_radio_log /proc/last_radio_log) ------
16扎狱、thermal log / blacklights
------ THERMAL LOG ------
battery=43000
backlight_therm=44
emmc_therm=47
pa_therm0=44
pm660_tz=47560
pm660l_tz=37000
msm_therm=49
quiet_therm=46
xo_therm=45
tsens_tz_sensor0=525
tsens_tz_sensor1=528
tsens_tz_sensor2=538
tsens_tz_sensor3=545
tsens_tz_sensor4=535
tsens_tz_sensor5=541
tsens_tz_sensor6=522
tsens_tz_sensor7=551
tsens_tz_sensor8=516
tsens_tz_sensor9=519
tsens_tz_sensor10=509
tsens_tz_sensor11=516
tsens_tz_sensor12=545
tsens_tz_sensor13=519
limits_sensor-00=0
limits_sensor-01=0
bms=43000
GLM_soc=0
LLM_cp1-=0
LLM_cp0-=0
背光信息
------ BACKLIGHTS ------
LCD brightness=*** Error dumping /sys/class/leds/lcd-backlight/brightness: Permission denied
Button brightness=*** Error dumping /sys/class/leds/button-backlight/brightness: No such file or directory
Keyboard brightness=*** Error dumping /sys/class/leds/keyboard-backlight/brightness: No such file or directory
ALS mode=*** Error dumping /sys/class/leds/lcd-backlight/als: Permission denied
LCD driver registers:
*** Error dumping /sys/class/leds/lcd-backlight/registers: Permission denied
17、Binder相關(guān)
------ BINDER FAILED TRANSACTION LOG (/sys/kernel/debug/binder/failed_transaction_log) ------
------ BINDER TRANSACTION LOG (/sys/kernel/debug/binder/transaction_log) ------
------ BINDER TRANSACTIONS (/sys/kernel/debug/binder/transactions) ------
------ BINDER STATS (/sys/kernel/debug/binder/stats) -----
------ BINDER STATE (/sys/kernel/debug/binder/state) ------
緊接著需要root,user build不會有這個log
------ DUMP VENDOR RIL LOGS (/system/xbin/su root vril-dump) ------
18勃教、dumpsys相關(guān)
通過dumpsys -l可查看系統(tǒng)所有服務(wù)淤击,不帶參數(shù)的dumpsys命令會輸出系統(tǒng)中所有的服務(wù):每個服務(wù)開頭信息如下:
========================================================
== Android Framework Services
========================================================
------ DUMPSYS (/system/bin/dumpsys -t 10 --skip meminfo cpuinfo) ------
DUMP OF SERVICE DisplayFeatureControl:
DUMP OF SERVICE DockObserver:
DUMP OF SERVICE SurfaceFlinger:
DUMP OF SERVICE
...
19、dumpsys checkin相關(guān)
dumpsys電池統(tǒng)計故源,內(nèi)存污抬、網(wǎng)絡(luò)統(tǒng)計、進程绳军、使用情況印机、包這些統(tǒng)計類信息
========================================================
== Checkins
========================================================
------ CHECKIN BATTERYSTATS (/system/bin/dumpsys -t 30 batterystats -c) ------
------ CHECKIN MEMINFO (/system/bin/dumpsys -t 30 meminfo --checkin) ------
------ CHECKIN NETSTATS (/system/bin/dumpsys -t 30 netstats --checkin) ------
------ CHECKIN PROCSTATS (/system/bin/dumpsys -t 30 procstats -c) ------
------ CHECKIN USAGESTATS (/system/bin/dumpsys -t 30 usagestats -c) ------
------ CHECKIN PACKAGE (/system/bin/dumpsys -t 30 package --checkin) ------
20、dumpsys app相關(guān)
dumpsys會收集activity信息以及service和provider信息门驾。
========================================================
== Running Application Activities
========================================================
------ APP ACTIVITIES (/system/bin/dumpsys -t 30 activity -v all) ------
========================================================
== Running Application Services
========================================================
------ APP SERVICES (/system/bin/dumpsys -t 30 activity service all) ------
========================================================
== Running Application Providers
========================================================
------ APP PROVIDERS (/system/bin/dumpsys -t 30 activity provider all) ------
21耳贬、Dropbox相關(guān)
Dropbox會收集system server crash 和 system app crash 信息
========================================================
== Dropbox crashes
========================================================
------ DROPBOX SYSTEM SERVER CRASHES (/system/bin/dumpsys -t 30 dropbox -p system_server_crash) ------
------ DROPBOX SYSTEM APP CRASHES (/system/bin/dumpsys -t 30 dropbox -p system_app_crash) ------
總結(jié)
從上面的總結(jié)和6.0的源碼對比來看,總體log的打印順序都沒有明顯變化猎唁,只是增加了一些信息。開發(fā)者在根據(jù)bugreport分析問題的時候可以通過搜索關(guān)鍵字來快速找到有用信息顷蟆,比如當你想了解meminfo信息的時候诫隅,你可以搜索DUMPSYS MEMINFO來找到各個進程所占用內(nèi)存的信息。又或者當你想查詢摸一個app的信息時帐偎,你可以搜索package [包名]來找到對應的app信息逐纬。總是削樊,還需要大家多多使用豁生,多多熟練就能快速找到你想要的信息。