Android Bugreport Analysis

Source: Internet
Author: User
Tags system log cpu usage
reproduced from: Author: blueskyhff_firef

Get Log from Androidsystem

ADB bugreport> Bugreport.txt

Copy bugreport tothe current directory.

Bugreport contains a variety of log information, most of the log can be directly run by the relevant program to obtain directly.

The steps are as follows:

1.ADB shell2. Access to the relevant tool program directory 3. Execute the relevant program 4. Get relevant information

The following is an example of output process information 1.adbshell 2. Enter Ps-p 3. You can see the related process information Log Archive analysis 1.bugreport

Bugreport logs the android boot process log and the system state after it starts, including the process list, memory information, VM information, and so on. 2.bugreport Structure Analysis (1) dumpstate


Get this log: Read file/proc/meminfo

System memory Usage Status


Get this log: Perform/system/bin/top-n 1-d 1-m 30-t

System CPU Usage Status


Get this log: Execute/system/bin/procrank

/system/xbin/procrank the results of the output after the execution, to see some memory usage status

VIRTUAL Memorystats

Get this log: Read file/proc/vmstat

Virtual memory allocation

Vmalloc applications are located between Vmalloc_start~vmalloc_end, and there is no simple conversion relationship with physical addresses, although logically they are continuous, but they do not require continuity in physics.

Vmalloc INFO

Get this log: Read file/proc/vmallocinfo

Virtual memory allocation


Get this log: Read file/proc/slabinfo

Slab is a memory allocator. Here, some information about the allocator is exported


Get this log: Read file/proc/zoneinfo

Zone Info

Systemlog (need to focus on analysis)

Get this log: Perform/system/bin/logcat-v time-d *:v

Logs output in the program to analyze the current state of the system

VM traces

Get this log: Read file/data/anr/traces.txt

Because each program is running in its own VM, this log is some traces of the actual VM

EVENT Logtags

Get this log: Read file/etc/event-log-tags


Get this log: Perform/system/bin/logcat-b events-v time-d *:v

Output some of the event log


Get this log: Perform/system/bin/logcat-b radio-v time-d *:v

Displays the link state of some wireless devices, such as GSM,PHONE,STK (satellite Tool Kit) ...

Network state

Get this log: Execute/system/bin/netcfg (Get Network link state)

Get this log: Read file/proc/net/route (get routing status)

Show Network links and routes


Get this log: reference code implementation

Displays some system properties, such as version,services,network ...


Get this log: Execute/SYSTEM/BIN/DMESG

Log showing the Android kernel output


Get this log: Read file/proc/wakelocks

Some of the records that the kernel wakes up and sleeps with some programs and services


(Linux kernelcpufreq subsystem) Clock scaling allows the clockspeed of the CPUs on the fly.

This is a nicemethod to save battery power, because the lower clock speed the is,the.


Get this log: Execute ps-p

Show Current process

Processes Andthreads

Get this log: Execute ps-t-p-p

Show current processes and threads


Get this log: Execute/system/xbin/librank

Eliminate unnecessary library

BINDER failedtransaction LOG

Get this log: Read file/proc/binder/failed_transaction_log

Bindertransaction LOG

Get this log: Read file/proc/binder/transaction_log


Get this log: Read file/proc/binder/transactions


Get this log: Read file/proc/binder/stats

BINDER processstate

Get this log: Read file/proc/binder/proc/*

Some states related to bind


Get this log: Execute/SYSTEM/BIN/DF

Some capacity usage status of the primary file (Cache,sqlite,dev ...)


Get this log: Read file/data/system/packages.xml

Some of the state of package in the system (access rights, paths ...), like some LNK files in Windows.

PACKAGE uiderrors

Get this log: Read file/data/system/uiderrors.txt

Error message

KERNEL last Kmsglog

Latest Kernel MessageLog

Last Radiolog

Latest Radio Log

KERNEL Panicconsole LOG

KERNEL panicthreads LOG

Some error message log for console/thread


Get this log: Get lcdbrightness read/sys/class/leds/lcd-backlight/brightness

Get this log: Get buttonbrightness read/sys/class/leds/button-backlight/brightness

Get this log: Get keyboardbrightness read/sys/class/leds/keyboard-backlight/brightness

Get this log: Get Alsmode read/sys/class/leds/lcd-backlight/als

Get this log: Get Lcddriver registers Read/sys/class/leds/lcd-backlight/registers

Get some information about the relative brightness (2) Build.prop

Versioninfo Output The following information
Current time
Current kernel version: can read files (/proc/version) get
Display current command: can read folder (/proc/cmdline) get
Displays some properties of the system build: You can read the file (/system/build.prop) to get
Output system Some properties
Gsm.operator.alpha (3) Dumpsys

This log can be obtained after executing the/system/bin/dumpsys.
It is often found that the log output is incomplete because the code requires the tool to perform a maximum of 60ms and may cause the log to not be fully exported.
The log can be guaranteed to be fully exported by modifying the time parameter.
Currently running services
DUMP of SERVICE Services-name (running) Log Code Analysis

Site:. " Frameworks "Base" Cmds "Dumpstate"

The code of the related log program can obtain the log analysis Experience analytical steps from the above directory

1. View some version information
System environment to identify problems
2. View the use of cpu/memory
See if there is memory exhaustion, the CPU is busy such a background situation appears.
3. Analysis of Traces
Because traces are some thread stack information that is output after a system error, you can quickly locate the problem.
4. Analyze System LOG
System log detailed output of a variety of log, you can find the relevant log for each analysis of the case analysis

The following analysis I wrote a test example, in the OnCreate to do a dead loop, so that the main thread will be locked in the hardware after the back of the ANR error.
The stack information for the program found in traces is as follows:

-----pid 20597at 2010-03-15 01:29:53-----
"Main" prio=5 tid=3 timed_wait
| group= "main" scount=1 dscount=0 s=n obj=0x2aac6240self=0xbda8
| systid=20597 nice=0 sched=0/0 cgrp=defaulthandle=1877232296
At Java.lang.VMThread.sleep (Native method)
At Java.lang.Thread.sleep (
At Java.lang.Thread.sleep (
At Android.os.SystemClock.sleep (
At ( ( ( ($2200 ($h.handlemessage (
At Android.os.Handler.dispatchMessage (
At Android.os.Looper.loop ( (
At Java.lang.reflect.Method.invokeNative (Native method)
At Java.lang.reflect.Method.invoke ($ ( (
At Dalvik.system.NativeStart.main (Native method)
"Binder Thread #2" prio=5 tid=11 NATIVE
| group= "main" scount=1 dscount=0 s=n obj=0x2fb7c260self=0x143860
| systid=20601 nice=0 sched=0/0 cgrp=defaulthandle=1211376
At (Native method)
"Binder Thread #1" prio=5 tid=9 NATIVE
| group= "main" scount=1 dscount=0 s=n obj=0x2fb7c1a0self=0x14c980
| systid=20600 nice=0 sched=0/0 cgrp=defaulthandle=1207920
At (Native method)
"Signal catcher" Daemon prio=5 tid=7 RUNNABLE
| Group= "System" scount=0 dscount=0 s=n obj=0x2fb7a1e8self=0x126cc0
| systid=20599 nice=0 sched=0/0 cgrp=defaulthandle=1269048
At (Native method)
"Heapworker" Daemon prio=5 tid=5 vmwait
| Group= "System" scount=1 dscount=0 s=n OBJ=0X2E31DAF0SELF=0X135C08
| systid=20598 nice=0 sched=0/0 cgrp=defaulthandle=1268528
At (Native method)
-----End 20597-----

The stack structure of the file is analyzed from bottom to top
(1) bottom of stack at (Native method)
The system starts a dedicated virtual machine for the current task (application)
(2) (
Activity Services is responsible for managing the activity in the background, and it starts the activity of the test example at this time.
(3) at (
Start the test program
(4) Stack top at Java.lang.VMThread.sleep (Native method)
The thread was sleep-deprived, so it was unable to respond to the user and a ANR error occurred.

The above is an analysis of a very simple problem.

You also need to analyze system LOG in detail if you encounter more complex problems.
1. For example, network anomalies, through the system log output of the network link information to determine the status of the network
2. Data transmission, network links and other time-consuming operations need to analyze the system log Activitymanager response time

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.