Original: http://www.androidlearner.net/using-chkbugreport-analysis-bugreport.html
First, Chkbugreport Introduction
Chkbugreport is an open source tool that can parse the Bugreprot you get into HTML files that are appropriate for reading. The exported HTML file contains charts and analytic conclusions based on the bugreport data.
Its source code uses the following open source libraries: jquery, Jstree jquery plugin, tablednd jquery plugin, tablesorter jquery plugin, Js-hotkeys, Jquery-cook Ie. Learning output report Document HTML can refer to the source code.
Currently Chkbugreport can extract the following information from the Bugreport data:
1, stacktraces Chkbugreport can parse out the last moment of output bugreport from the bugreport, and cause the stack information of ANR time and even more time. In the example, you can see that the priority and strategy of the process are all marked, and that some of the time consuming parts of the stack are black and red, and some of the parts that violate strict mode (such as using the database in the main thread) are marked as bright. If this thread is deadlocked, the errors in the report will appear.
2, Logs This part is to the system, main and kernel log analysis, where you can see each process memory usage diagram, that program generated the most log, activity start time consuming, database operation time-consuming statistics, object is locked, Aidl call time, The lifecycle of activity and service and how often it is used in memory, and so on, as detailed in
3. Packages chkbugreport resolves the packages.xml stored in Bugreport and displays a series of Packages, user IDs, and permissions. See
4, processes operation of the system generated during the event log, memory usage information and so on, see
5, Battery Statistics battery usage statistic information, see
6, CPU Frequency statistics CPU frequency statistic information, see
7, raw data is divided into small segments of the original
Chkbugreport can also detect (potential) errors that can be found in the Output Errors section of the report. You can also find deadlocks or some violations of strict mode in the stacktrace of the output report.
Second, the use of Chkbugreport
The use is simple:
1 |
Java-jar $HOME/downloads/chkbugreport.jar $HOME/tmp/bugreport.txt |
You can also add Chkbugreport.jar to the path and use this
1 |
Chkbugreport Thebugreport.txt |
The tool will output an analysis result directory based on your bugreport data bugreport_out.
You can use the following command to obtain Bugreport:
1 |
adb shell bugreport > Bugreport.txt |
Of course, you can use Chkbugreport to analyze some of Bugreport's data, like/data/anr/traces.txt.
1 |
Chkbugreport-sl:the_system_log.txt-sa:traces.txt Dummy |
This will output the analysis results to dummy_out.
You can even use Chkbugreport to analyze the data generated by TraceView
1 |
Chkbugreport-t something.prof |
Prof Data generation methods can refer to the following methods:
1, you can use the Eclipse plug-in TraceView build
2, you can also follow the following steps:
A. List all processes using the ADB shell PS and find the PID for the process you want to trace
B. Execute adb shell am profile PID start/data/profile.dat, start analysis
C. Operate your app
D. Execute adb shell am profile PID stop, stop profiling
E. Export data and purge temporary files: adb pull/data/profile.dat adb shell Rm/data/profile.dat
F. Use of chkbugreport for analysis Chkbugreport-t Profile.dat
Common parameters for Chkbugreport are as follows:
Chkbugreport Common parameters
Other parameters (less used):
Chkbugreport not commonly used parameters
III, related references
1, open Source Tool chkbugreport Introduction
2, chkbugreport source
3, chkbugreport latest jar package download elevator &NBSP
4, report example using Chkbugreport output
A. A simple example of process deadlock
B. Two processes calling each other's aidl lead to blocked deadlock examples &NBSP
C. This example combines the above two examples (due to a process call aidl blocking causes another thread to deadlock)