FORUMS

OnePlus 2 Forums: Discuss Everything About The OP2!

Now that the OnePlus 2 has been officially unveiled and that we have had close-up … more

Intel & Micron Announce “Revolutionary” Storage Tech

Intel & Micron have announced 3D Xpoint technology—”the … more

Google Now Interfaces With Third-Party Messaging Apps

Google has announced that Ok Google voice commands can now be used to send … more

Make Your Lockscreen More Productive With Widgets

Are you running Android Lollipop? Do you miss the ability to add widgets to your lock … more

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

98 posts
Thanks Meter: 611
 
By KalleD, Sony Mobile Developer on 25th January 2012, 03:35 PM
Post Reply Subscribe to Thread Email Thread
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 4 Users Say Thank You to KalleD For This Useful Post: [ View ]
 
 
27th January 2012, 12:33 PM |#2  
Retired Recognized Developer
Thanks Meter: 220
 
Donate to Me
More
Nice. Any intention of integrating this into some IDE ?
27th January 2012, 08:38 PM |#3  
Sony Mobile Developer
Thanks Meter: 102
 
More
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.
29th January 2012, 12:26 PM |#4  
Retired Recognized Developer
Thanks Meter: 220
 
Donate to Me
More
Quote:
Originally Posted by pal.szasz

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!
Last edited by pedrodh; 29th January 2012 at 12:27 PM. Reason: fix
30th January 2012, 06:52 AM |#5  
Sony Mobile Developer
Thanks Meter: 102
 
More
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.
30th January 2012, 10:32 AM |#6  
Sony Mobile Developer
Thanks Meter: 102
 
More
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.
1st February 2012, 02:58 PM |#7  
Retired Recognized Developer
Thanks Meter: 220
 
Donate to Me
More
Quote:
Originally Posted by pal.szasz

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.
1st February 2012, 03:53 PM |#8  
Sony Mobile Developer
Thanks Meter: 102
 
More
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.
27th September 2012, 03:55 PM |#9  
Sony Mobile Developer
Thanks Meter: 102
 
More
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
27th September 2012, 05:27 PM |#10  
cdesai's Avatar
Recognized Developer
Flag IN YOUR HEAD
Thanks Meter: 4,038
 
Donate to Me
More
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
28th September 2012, 09:55 AM |#11  
Sony Mobile Developer
Thanks Meter: 102
 
More
Well, finally I had time to add some documentation: https://github.com/sonyxperiadev/ChkBugReport/wiki (it's not complete, but at least a good start)

Also source code is pushed and added a new precompiled jar (I started to add the version number in the filename so I can keep the old versions as well): https://github.com/sonyxperiadev/ChkBugReport/downloads

And as usual, any kind of feedback is welcome
Last edited by pal.szasz; 19th October 2012 at 06:50 AM.

Read More
Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes