| oprofile: hangs on Parsing OProfile Data [message #662778] |
Thu, 31 March 2011 17:59  |
Will Messages: 5 Registered: March 2011 |
Junior Member |
|
|
Trying to use the OProfile plugin with Eclipse 3.6.2 on Archlinux x86_64. As far as I can tell, OProfile works from the command line.
The plugin itself sometimes seems to work when I run my application with no inputs in which case it just prints out its usage statement and then exits. Sometimes the OProfile tab doesn't come up at all, but sometimes it comes up saying either that no samples were found or it shows one sample in some random function. This seems to make sense as it doesn't take very long for the program to print out its usage statement.
However, profiling any more substantial a run (e.g. still < 1 second) leads to a progress dialog popping up after it has finished which says "Parsing OProfile Data". It doesn't seem to be using any CPU or accessing the harddrive, and it stays at 0% with the Cancel button grayed-out indefinitely.
Any ideas?
|
|
|
|
| Re: oprofile: hangs on Parsing OProfile Data [message #662802 is a reply to message #662778] |
Thu, 31 March 2011 22:03   |
Will Messages: 5 Registered: March 2011 |
Junior Member |
|
|
So, it's not a problem w/ opreport itself. I can replace the opreport binary with a bash script that just does
cat opout
where opout is the output I generate by running opreport -X -details on the command line and it still hangs. However, it actually works if I trim down the output (remove some of the data segments at the end).
So, I'm currently thinking that the issue is with the handing of opreport's input/output streams by the plugin. This happens in org.eclipse.linuxtools.oprofile.core.linux.OpxmlRunner around line 218. I think the plugin needs to be reading opreport's output as it runs instead of waiting for it to terminate. If opreport's output fills up the inputstream's buffer, it'll cause the hang.
From http://download.oracle.com/javase/1.4.2/docs/api/java/lang/P rocess.html :
Because some native platforms only provide limited buffer size for standard input and output streams, failure to promptly write the input stream or read the output stream of the subprocess may cause the subprocess to block, and even deadlock.
I'll try to test a patch myself, altho I'm not entirely clear on how to turn this source code into an eclipse plugin...
[Updated on: Thu, 31 March 2011 22:48] Report message to a moderator
|
|
|
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.02274 seconds