5,593,876 Members 46,724 Now Online
XDA Developers Android and Mobile Development Forum

[TOOL] [PROJECT] New bugreport analysis tool - open source project by Sony Ericsson

Tip us?
 
KalleD
Old
#1  
Sony Mobile Developer - OP
Thanks Meter 607
Posts: 98
Join Date: May 2011
Default [TOOL] [PROJECT] New bugreport analysis tool - open source project by Sony Ericsson

Hi all,
ChkBugReport is a tool that helps you analyze your crash files. Because this tool is such a great help for our internal developers at Sony Ericsson, and as a part of our ambition to step up our open source activities, we want to give all of you the chance to use it by making it open source. Pál Szász (XDA username: pal.szasz), a software developer at Sony Ericsson, is the creator of this tool and will monitor this thread for questions, discussions and suggestions. Feel free to have a look at the open source project and contribute to make it even better!
https://github.com/sonyericssondev/ChkBugReport

For the full story follow the full story in Developer World
/Karl-Johan Dahlström
Sony Ericsson Developer Program
The Following 2 Users Say Thank You to KalleD For This Useful Post: [ Click to Expand ]
 
pedrodh
Old
#2  
Recognized Developer
Thanks Meter 211
Posts: 190
Join Date: Oct 2009
Nice. Any intention of integrating this into some IDE ?
Like my work and have bitcoin? Please donate: 152A5eh6QgLXYuNVxhgHtM1XxM8o85RoLL
 
pal.szasz
Old
#3  
Sony Mobile Developer
Thanks Meter 76
Posts: 48
Join Date: Jan 2012
I haven't thought about IDE integration. What do you have in mind exactly?

What I'm working on is automatically opening the result in a browser when processing done (already in the source code, although I tested only in osx at the moment).

Another functionality in progress (not uploaded yet) is to use ADB to automatically save a bugreport. So you would just execute
Code:
chkbugreport --browser adb://
and it will save the bugreport, analyze it and open the result in a browser (as a bonus a screenshot is saved as well).

When this would be implemented I think it would be easy to add it as an external tool in eclipse and launch it from there.
 
pedrodh
Old
(Last edited by pedrodh; 29th January 2012 at 12:27 PM.) Reason: fix
#4  
Recognized Developer
Thanks Meter 211
Posts: 190
Join Date: Oct 2009
Quote:
Originally Posted by pal.szasz View Post
I haven't thought about IDE integration. What do you have in mind exactly?

What I'm working on is automatically opening the result in a browser when processing done (already in the source code, although I tested only in osx at the moment).

Another functionality in progress (not uploaded yet) is to use ADB to automatically save a bugreport. So you would just execute
Code:
chkbugreport --browser adb://
and it will save the bugreport, analyze it and open the result in a browser (as a bonus a screenshot is saved as well).

When this would be implemented I think it would be easy to add it as an external tool in eclipse and launch it from there.
One possible IDE integration would be for the report to have linkable parts to the source code when applicable.
Also selecting the process from a windows, having UI buttons starting and stopping the capture of profiling data would be a bonus.

Anyway, the application works very well, and thumbs up for open sourcing this tool .


BTW in my case I've came across some missing resources when generating output:

Code:
Writing chapter: Trace charts/Thread-17 (Thread-18)...
Writing chapter: Main thread activity...
Writing footer...
Cannot find resource: /style.css
Cannot find resource: /icons.png
Cannot find resource: /ftrace-legend-dred.png
Cannot find resource: /ftrace-legend-black.png
Cannot find resource: /ftrace-legend-yellow.png
Cannot find resource: /ftrace-legend-red.png
Cannot find resource: /ftrace-legend-cyan.png
Cannot find resource: /ftrace-legend-dcyan.png
Cannot find resource: /pcy_p0.png
Cannot find resource: /pcy_p1.png
Cannot find resource: /pcy_p2.png
Copying extra resources...
Cannot find resource: /pcy_p3.png
Cannot find resource: /pcy_p4.png
Cannot find resource: /pcy_un.png
Cannot find resource: /pcy_rt.png
Cannot find resource: /pcy_fg.png
Cannot find resource: /pcy_bg.png
Cannot find resource: /main.js
Cannot find resource: /jquery.js
Cannot find resource: /jquery.cookie.js
Cannot find resource: /jquery.jstree.js
Cannot find resource: /jquery.hotkeys.js
Cannot find resource: /jquery.tablesorter.js
Cannot find resource: /jquery.tablednd.js
Cannot find resource: /themes/classic/d.png
Cannot find resource: /themes/classic/dot_for_ie.gif
Cannot find resource: /themes/classic/throbber.gif
Cannot find resource: /themes/classic/style.css
Cannot find resource: /themes/blue/desc.gif
Cannot find resource: /themes/blue/bg.gif
Cannot find resource: /themes/blue/style.css
Cannot find resource: /themes/blue/asc.gif
DONE!
Like my work and have bitcoin? Please donate: 152A5eh6QgLXYuNVxhgHtM1XxM8o85RoLL
 
pal.szasz
Old
#5  
Sony Mobile Developer
Thanks Meter 76
Posts: 48
Join Date: Jan 2012
Regarding the resource errors: did you used the precompiled binary or compiled the source code yourself? If it's the later one, how did you compile it? While developing I use eclipse, and I have the "res" folder added a source folder as well. This way the contents of the res folder will be copied to the jar. If you compiled it in some other way, then probably the resources from "res" where not packed into the jar. Building with the ant file should work as well ("ant -f chkbugreport.xml" if I remember correctly)

Regarding the IDE integration: yes, linking/binding the source code would be nice. For tracing data there is already something in progress: running "chkbugreport -t adb://" will show a window to select a process and start/stop it's profiling, but since that code uses code from the android sdk, I need to check how I can link the two codes together (since one of the codes is GPL, the other is Apache) before I can publish it.
 
pal.szasz
Old
#6  
Sony Mobile Developer
Thanks Meter 76
Posts: 48
Join Date: Jan 2012
I uploaded the changes for adb support. Now an extra jar file is needed: ddmlib.jar. You can find this either in the source code repo, or in the android sdk (a recent one is needed).

I updated the wrapper script as well, to use ddmlib.jar. However if the ddmlib.jar is missing, then the tool will still work like before, simply the new functionality will be missing, which is:

Code:
chkbugreport --browser adb://
The above command will run the bugreport tool on the phone (if it's connected to the PC, of course), processes it and open the result in the browser. As extra bonus, a screenshot is saved as well ;)


Code:
chkbugreport --browser -t adb://
This will show a window, where you can select which process to trace. Click START then STOP, and the tracefile will be created and processed (and opened in the browser). BUT: there are some limitations:

* adb must be run as root (the tracefile is saved to the /data partition), which means either run en ENG build or USERDEBUG (but then you must first execute "adb root")
* it seems that the fileformat for traceview files have changed, the tool currently supports only version 1, so this will not work if you have a recent android version. I'll fix this later.
 
pedrodh
Old
#7  
Recognized Developer
Thanks Meter 211
Posts: 190
Join Date: Oct 2009
Quote:
Originally Posted by pal.szasz View Post
Regarding the resource errors: did you used the precompiled binary or compiled the source code yourself? If it's the later one, how did you compile it? While developing I use eclipse, and I have the "res" folder added a source folder as well. This way the contents of the res folder will be copied to the jar. If you compiled it in some other way, then probably the resources from "res" where not packed into the jar. Building with the ant file should work as well ("ant -f chkbugreport.xml" if I remember correctly)

Regarding the IDE integration: yes, linking/binding the source code would be nice. For tracing data there is already something in progress: running "chkbugreport -t adb://" will show a window to select a process and start/stop it's profiling, but since that code uses code from the android sdk, I need to check how I can link the two codes together (since one of the codes is GPL, the other is Apache) before I can publish it.
I compiled my own using IDEA, but since I didn't get any errors during compilation (I think) I didn't assume I was missing something in the compilation process.

About the other changes, why not output the traces to /sdcard ? Since that one is always R/W to all users should work right? I say this without actually having looked at the code behind the magic, so perhaps is not a valid suggestion.
Like my work and have bitcoin? Please donate: 152A5eh6QgLXYuNVxhgHtM1XxM8o85RoLL
 
pal.szasz
Old
#8  
Sony Mobile Developer
Thanks Meter 76
Posts: 48
Join Date: Jan 2012
I am planning to add support for that as well (i.e. the user can select where to save the tracelogs). AFAIK the sdcard is only readable for everyone by default, apps need to have a certain permission (something with WRITE_EXTERNAL_STORAGE) in order to be able to write to sdcard. But if you are debugging your own app, that's not a problem.
 
pal.szasz
Old
#9  
Sony Mobile Developer
Thanks Meter 76
Posts: 48
Join Date: Jan 2012
I haven't updated this thread in a looong time. I'm pretty close to put up some more detailed documentation and examples, hopefully I can do it tomorrow.
Meanwhile as a teaser here is an example report generated from a bugreport: http://sonyericssondev.github.com/Ch...out/index.html
 
cdesai
Old
#10  
cdesai's Avatar
Recognized Developer
Thanks Meter 3968
Posts: 2,272
Join Date: Jan 2011
Location: IN YOUR HEAD

 
DONATE TO ME
The shell user does have permissions to write to sdcard, so if you're doing that via adb it should be good.

Sent from my GT-P1000
CyanogenMod Maintainer | SGT7 | TeamBBQ

 
BBQLinux - An Arch based Linux distribution for Android developers
Website: http://www.bbqlinux.org | Downloads: [url]http://sourceforge.net/projects/bbqlinux/files//url]
IRC: #bbqlinux on freenode

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


XDA PORTAL POSTS

How to Hack An Android App (Don’t Try This at Home) – XDA Developer TV

Listen, don’t cheat in your games. So don’t … more

Windows Phone 8.1 Developer Preview Now Available!

About two weeks ago at the BUILD conference in San Francisco, Microsoft unveiled Windows … more

Prevent Unwanted Butt Dialing with Smart Pocket Guard

You may recall that back in August of last year, we took a look atAir SwiperbyXDA … more