Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Linux Tools Project » oprofile problem: "No profiling data is on the system"
oprofile problem: "No profiling data is on the system" [message #541046] Fri, 18 June 2010 07:14 Go to next message
Jesper Eskilson is currently offline Jesper EskilsonFriend
Messages: 134
Registered: July 2009
Senior Member
I'm trying to get the oprofile plugin to work, and I think I've gotten
most issues sorted out (getting oprofile to work is a unfortunately a
usability nightmare for a variety of reasons).

First, I'm using Ubuntu 10.04 64-bit, and the OProfile Eclipse plugins
from the nightly builds site:

http://download.eclipse.org/technology/linuxtools/updates-ni ghtly

OProfile seems to work decently when run on the command line:

$ opcontrol --image=...
$ opcontrol --start
$ ... execute my program ...
$ opcontrol --shutdown
$ opreport -l

This spews out a lot of info, but it also complains:

WARNING! The OProfile kernel driver reports sample buffer overflows.

Not sure what to do about that. Looking at the oprofiled.log file it
seems that at least 30k sample were gathered from each of the 4 cores,
and only a single sample lost due to cpu buffer overflow. (The OProfile
documentation about sample rates and buffer size assume deep knowledge
about kernel internals which I don't have.) The output from opreport -l
only shows a handful of samples in my program, despite the program
running for at least 30 seconds. I though the --image option would
restrict profiling to the given image, but opreport -l shows data from
(seemingly) every process on the system.

Running "opxml info" also works fine, and spews out a decent about of XML.

The problem with the Eclipse OProfile view is that I cannot get any data
into it, it just reports "No profiling data is on the system". Where
does it expect the data to go?

(I realize that getting oprofile to work "out-of-the-box" is more or
less an impossible task, but nonetheless I think that "improved
usability" should be on the list of "future plans" at
http://www.eclipse.org/linuxtools/projectPages/oprofile/).

--
Jesper Eskilson
Developer
IAR Systems
Re: oprofile problem: "No profiling data is on the system" [message #541188 is a reply to message #541046] Fri, 18 June 2010 15:22 Go to previous messageGo to next message
Severin Gehwolf is currently offline Severin GehwolfFriend
Messages: 40
Registered: June 2010
Member
Hi Jesper,

Could you do the following:

1. Profile your binary from with Eclipse (Profile as => Profile with Oprofile)
2. After it shows "No profiling data is on the system" go to a terminal and type:

$ opcontrol --status | grep "Image filter"

Does this show the correct path to your binary?

Oprofile stores profiling samples in /var/lib/oprofile if you do not specify "--session-dir=...". But it sometimes gets confused by samples still existing from previous runs. So, could you do:

$ rm -rf /var/lib/oprofile
$ opcontrol --image=...
$ opcontrol --start
$ ... execute my program ...
$ opcontrol --shutdown
$ opreport -l

to confirm that opreport -l shows data collected by the last run?

It could be that you are affected by the following bug:
https://bugzilla.redhat.com/show_bug.cgi?id=605425

Agreed, there's definitely room for improvement regarding installation procedure of the oprofile plugin. There's work under way to improve this. See also:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=315770

Let me know how it goes.

Cheers,
Severin
Re: oprofile problem: "No profiling data is on the system" [message #541444 is a reply to message #541188] Mon, 21 June 2010 08:17 Go to previous messageGo to next message
Jesper Eskilson is currently offline Jesper EskilsonFriend
Messages: 134
Registered: July 2009
Senior Member
On 06/18/2010 05:22 PM, Severin Gehwolf wrote:
> Hi Jesper,
>
> Could you do the following:
>
> 1. Profile your binary from with Eclipse (Profile as => Profile with
> Oprofile)
> 2. After it shows "No profiling data is on the system" go to a terminal
> and type:
>
> $ opcontrol --status | grep "Image filter"
>
> Does this show the correct path to your binary?

Yes.

> Oprofile stores profiling samples in /var/lib/oprofile if you do not
> specify "--session-dir=...". But it sometimes gets confused by samples
> still existing from previous runs. So, could you do:
>
> $ rm -rf /var/lib/oprofile
> $ opcontrol --image=...
> $ opcontrol --start
> $ ... execute my program ...
> $ opcontrol --shutdown
> $ opreport -l
>
> to confirm that opreport -l shows data collected by the last run?

opreport -l says:

> WARNING! The OProfile kernel driver reports sample buffer overflows.
> Such overflows can result in incorrect sample attribution, invalid sample
> files and other symptoms. See the oprofiled.log for details.
> You should adjust your sampling frequency to eliminate (or at least minimize)
> these overflows.
> error: no sample files found: profile specification too strict ?

oprofiled.log says:

> oprofiled started Mon Jun 21 10:11:48 2010
> kernel pointer size: 8
>
> Mon Jun 21 10:13:17 2010
>
>
> -- OProfile Statistics --
> Nr. sample dumps: 88
> Nr. non-backtrace samples: 332733
> Nr. kernel samples: 131545
> Nr. lost samples (no kernel/user): 0
> Nr. lost kernel samples: 0
> Nr. incomplete code structs: 0
> Nr. samples lost due to sample file open failure: 0
> Nr. samples lost due to no permanent mapping: 0
> Nr. event lost due to buffer overflow: 0
> Nr. samples lost due to no mapping: 3277
> Nr. backtraces skipped due to no file mapping: 0
> Nr. samples lost due to no mm: 455
>
> ---- Statistics for cpu : 3
> Nr. samples lost cpu buffer overflow: 3
> Nr. samples received: 120011
> Nr. backtrace aborted: 0
> Nr. samples lost invalid pc: 0
>
> ---- Statistics for cpu : 2
> Nr. samples lost cpu buffer overflow: 0
> Nr. samples received: 162454
> Nr. backtrace aborted: 0
> Nr. samples lost invalid pc: 0
>
> ---- Statistics for cpu : 1
> Nr. samples lost cpu buffer overflow: 1
> Nr. samples received: 194366
> Nr. backtrace aborted: 0
> Nr. samples lost invalid pc: 0
>
> ---- Statistics for cpu : 0
> Nr. samples lost cpu buffer overflow: 0
> Nr. samples received: 218887
> Nr. backtrace aborted: 0
> Nr. samples lost invalid pc: 0
> oprofiled stopped Mon Jun 21 10:13:17 2010




> It could be that you are affected by the following bug:
> https://bugzilla.redhat.com/show_bug.cgi?id=605425

The binary is located on a local harddrive, so that bug does not seem to
apply.

> Agreed, there's definitely room for improvement regarding installation
> procedure of the oprofile plugin. There's work under way to improve
> this. See also:
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=315770
>
> Let me know how it goes.
>
> Cheers,
> Severin


--
Jesper Eskilson
Developer
IAR Systems
Re: oprofile problem: "No profiling data is on the system" [message #541533 is a reply to message #541444] Mon, 21 June 2010 13:27 Go to previous messageGo to next message
Severin Gehwolf is currently offline Severin GehwolfFriend
Messages: 40
Registered: June 2010
Member
>> Oprofile stores profiling samples in /var/lib/oprofile if you do not
>> specify "--session-dir=...". But it sometimes gets confused by samples
>> still existing from previous runs. So, could you do:
>>
>> $ rm -rf /var/lib/oprofile
>> $ opcontrol --image=...
>> $ opcontrol --start
>> $ ... execute my program ...
>> $ opcontrol --shutdown
>> $ opreport -l
>>
>> to confirm that opreport -l shows data collected by the last run?
>
> opreport -l says:
>
>> WARNING! The OProfile kernel driver reports sample buffer overflows.
>> Such overflows can result in incorrect sample attribution, invalid sample
>> files and other symptoms. See the oprofiled.log for details.
>> You should adjust your sampling frequency to eliminate (or at least minimize)
>> these overflows.
>> error: no sample files found: profile specification too strict ?

Ok, this is telling me that profiling also doesn't work on the command line. My guess is, there aren't any samples in /var/lib/oprofile. You could check this by "cd /var/lib/oprofile; find | grep samples".

Could you try tuning your profiling settings (e.g. using "opcontrol --event=..." and "opcontrol --status") until you get profiling data on the command line. Alternatively, do you have a simple binary to test if oprofile works for you at all? This factorial example (C++) works for me on my machine:

unsigned long long factorial1(unsigned long long);
unsigned long long factorial2(unsigned long long);

int main() {
	for (int i = 0; i < 1000000; i++) {
		factorial1(20);
		factorial2(20);
	}
}

unsigned long long factorial1(unsigned long long n) {
	if (n <= 1)
		return 1;
	else
		return n * factorial1(n-1);
}

unsigned long long factorial2(unsigned long long n) {
	unsigned long long ret = 1;
	for (unsigned int i = 1; i <= n; i++)
		ret *= i;
	return ret;
}


Once you are able to profile your binary on the command line you can try again from within Eclipse.

Let us know how it goes.

Cheers,
Severin
Re: oprofile problem: "No profiling data is on the system" [message #550072 is a reply to message #541533] Thu, 29 July 2010 04:23 Go to previous messageGo to next message
Chris Buckley is currently offline Chris BuckleyFriend
Messages: 8
Registered: July 2010
Junior Member
I'm getting the same error message I'm running Fedora 13, which comes with Oprofile already installed.

In my case, I've tracked it down to a bad pathname, but I don't know how to change it.

After running the profile run within eclipse, examining the file /root/.oprofile/daemonrc :

SESSION_DIR=/var/lib/oprofile
CHOSEN_EVENTS_0=CPU_CLK_UNHALTED:100000:0:1:1
NR_CHOSEN=1
SEPARATE_LIB=0
SEPARATE_KERNEL=0
SEPARATE_THREAD=0
SEPARATE_CPU=0
VMLINUX=none
IMAGE_FILTER=/home/chrisb/smart/smart/bin/smart
CPU_BUF_SIZE=0
CALLGRAPH=0
XENIMAGE=none

shows that it is expecting the binary at /home/chrisb/smart/smart/bin/smart where /home/chrisb/smart is my workspace name, smart is the project name, and bin/smart is the binary within the project.

However, there's no such binary. I have the workspace and the actual project separated on different filesystems. The actual binary is at /d1/smart/src/bin/smart. The other eclipse commands handle this fine (I'm reasonably new to eclipse, but have been running compile/debug for a couple of months.). The profile configuration simply lists "bin/smart" as the application, which should be correct.

Oprofile works fine when run at the command line with the correct IMAGE_FILTER. But how do I tell eclipse to use the correct pathname?

Re: oprofile problem: "No profiling data is on the system" [message #550173 is a reply to message #550072] Thu, 29 July 2010 13:02 Go to previous messageGo to next message
Severin Gehwolf is currently offline Severin GehwolfFriend
Messages: 40
Registered: June 2010
Member
Hi Chris,

A few questions:

1.) How did you generate the binary? Did you build/compile it in Eclipse?

2.) Do you have your binaries linked into the workspace? (I.e. are you trying to profile external files; files _not_ in your workspace directory tree). If there is no /home/chrisb/smart/smart/bin/smart how did you attempt to profile it? Usually you would right-click on the binary => Profile as => Oprofile.

3.) You mention that workspace and project are on different filesystems. What's the relationship between /home/chrisb/smart/smart/bin/smart and /d1/smart/src/bin/smart? Is bin/smart (in /home) linked to bin/smart (in /d1).

Could you try profiling your binary by having your project and workspace on the same filesystem (Preferrably on a non-nfs filesystem; see bug above related to NFS)? Any luck with that?

Thanks,
Severin
Re: oprofile problem: "No profiling data is on the system" [message #550204 is a reply to message #550173] Thu, 29 July 2010 14:12 Go to previous messageGo to next message
Chris Buckley is currently offline Chris BuckleyFriend
Messages: 8
Registered: July 2010
Junior Member
Severin Gehwolf wrote on Thu, 29 July 2010 09:02
Hi Chris,

A few questions:

1.) How did you generate the binary? Did you build/compile it in Eclipse?

2.) Do you have your binaries linked into the workspace? (I.e. are you trying to profile external files; files _not_ in your workspace directory tree). If there is no /home/chrisb/smart/smart/bin/smart how did you attempt to profile it? Usually you would right-click on the binary => Profile as => Oprofile.

3.) You mention that workspace and project are on different filesystems. What's the relationship between /home/chrisb/smart/smart/bin/smart and /d1/smart/src/bin/smart? Is bin/smart (in /home) linked to bin/smart (in /d1).

Could you try profiling your binary by having your project and workspace on the same filesystem (Preferrably on a non-nfs filesystem; see bug above related to NFS)? Any luck with that?

Thanks,
Severin

Thanks for the quick reply.
1. binaries built/compiled within Eclipse
2. Binaries are in the namespace. Invoked by either right click on binary or by top menu Run ->profile configurations->select the correct one->profile. The binary was selected in "Profile Configuration" from the project choices offered (ie, is "bin/smart")
3. After setting up workspace, /home/chrisb/smart has only "dot directories" in it, nothing user visible (the pointers to the pre-existing smart directories on /d1/smart are all internal to those "dot directories"). As I said, this all works for compile and debugging, but not for profiling.

After posting my message I tried the obvious work-around and it does actually work. If I manually create a symbolic link in /home/chrisb/smart called smart pointing to /d1/smart/src, then profiling within Eclipse works well (and is quite useful already!) But the only reason I knew to do that was this one pathname in /root/.oprofile/daemonrc - there wasn't anything in Eclipse that suggested I do that. Is there some way I could have found what pathnames Eclipse is using in circumstances like this?

In any case, Eclipse should not have constructed that pathname; the profile binary image was not there. It sounds like the Oprofile code uses a different algorithm to construct the binary location than the debugger does (and that algorithm is incorrect here).
Re: oprofile problem: "No profiling data is on the system" [message #550253 is a reply to message #550204] Thu, 29 July 2010 15:54 Go to previous messageGo to next message
Severin Gehwolf is currently offline Severin GehwolfFriend
Messages: 40
Registered: June 2010
Member
Sorry, I'm still a bit confused as to what your filesystem setup is...

Chris Buckley wrote on Thu, 29 July 2010 10:12

3. After setting up workspace, /home/chrisb/smart has only "dot directories" in it, nothing user visible (the pointers to the pre-existing smart directories on /d1/smart are all internal to those "dot directories"). As I said, this all works for compile and debugging, but not for profiling.



What's your mount setup? What does
ls /home/chrisb/smart/smart/
show? Is the binary in there? If yes, you could use the filename of your binary as "C++ Application" location (note this has to be relative to your project) in "Run" => "Profile Configurations" => New Oprofile Config => Tab "Main"

Chris Buckley wrote on Thu, 29 July 2010 10:12

After posting my message I tried the obvious work-around and it does actually work. If I manually create a symbolic link in /home/chrisb/smart called smart pointing to /d1/smart/src, then profiling within Eclipse works well (and is quite useful already!)



Cool!

Chris Buckley wrote on Thu, 29 July 2010 10:12

But the only reason I knew to do that was this one pathname in /root/.oprofile/daemonrc - there wasn't anything in Eclipse that suggested I do that. Is there some way I could have found what pathnames Eclipse is using in circumstances like this?



Good point. We might provide some troubleshooting pointers in future. Thanks!

Chris Buckley wrote on Thu, 29 July 2010 10:12

In any case, Eclipse should not have constructed that pathname; the profile binary image was not there. It sounds like the Oprofile code uses a different algorithm to construct the binary location than the debugger does (and that algorithm is incorrect here).



The only problem I seem to be able to reproduce is that the plugin uses project relative paths in every case. I.e. say you specify "/bin/smart" as "C++ Application" binary to profile and your path to the project is "/home/chrisb/smart/smart". This would lead to a
opcontrol --image=/home/chrisb/smart/smart//bin/smart
call, which in turn sets
IMAGE_FILTER=/home/chrisb/smart/smart/bin/smart
in /root/.oprofile/daemonrc. Is that what's happening for you?

I created a bug for this anyway: https://bugs.eclipse.org/bugs/show_bug.cgi?id=321240

Thanks,
Severin
Re: oprofile problem: "No profiling data is on the system" [message #550278 is a reply to message #550253] Thu, 29 July 2010 17:52 Go to previous messageGo to next message
Chris Buckley is currently offline Chris BuckleyFriend
Messages: 8
Registered: July 2010
Junior Member
I agree everything should be relative to the project. The problem is that at some point Eclipse is making it relative to the workspace path instead.

Right-clicking on the smart project and choosing Properties, I get the location as correctly being /d1/smart/smart.17.0/src
That is the path I would expect the relative pathnames to be from (but isn't).

The workspace I'm using at the moment is /home/chrisb/smart
/bin/ls -al /home/chrisb/smart
total 12
drwxrwxr-x.  3 chrisb chrisb 4096 Jul 29 07:21 .
drwx------. 43 chrisb chrisb 4096 Jul 29 12:55 ..
drwxrwxr-x.  4 chrisb chrisb 4096 Jul 16 13:10 .metadata
lrwxrwxrwx.  1 chrisb chrisb   16 Jul 29 07:21 smart -> /smart/smart/src

where I manually added that symbolic link to smart today (there are other symbolic links involved as well - this path is the same as the project pathname.)

When Oprofile is run, it tells opcontrol that the image path is
/home/chrisb/smart/smart/bin/smart.
(the evidence for this is in the /root/.oprofile/daemonrc file).
But there is nothing anywhere in Eclipse (that I can find) that says there is any code whatsoever under /home/chrisb/smart, and there isn't any code there (before I manually added that symbolic link). This image path is just wrong!

The workspace was created following the Eclipse tutorials of how to create a project out of an existing code base. I realize that many folks probably choose to have the workspace location be the project location and wouldn't have this problem, but I chose not to.

So is this enough detail to tell you what's going on? As I said, it's pretty clearly an Eclipse bug; I see no way that it should be using a path relative to the workspace path as opposed to the project path.

Thanks for your responses!

Re: oprofile problem: "No profiling data is on the system" [message #551246 is a reply to message #550278] Thu, 05 August 2010 17:34 Go to previous messageGo to next message
Severin Gehwolf is currently offline Severin GehwolfFriend
Messages: 40
Registered: June 2010
Member
Hi Chris,

Sorry for the late reply. I was able to reproduce the problem. It looks like the oprofile plugin is behaving that way when the project is external (i.e. project is not inside the current workspace).

I've opened a bug, so you can keep track: https://bugs.eclipse.org/bugs/show_bug.cgi?id=321905

Thanks for reporting this!

Severin
Re: oprofile problem: "No profiling data is on the system" [message #551259 is a reply to message #551246] Thu, 05 August 2010 18:13 Go to previous messageGo to next message
Chris Buckley is currently offline Chris BuckleyFriend
Messages: 8
Registered: July 2010
Junior Member
Thanks for getting back to this, and formulating the bug report.

It's always nice to be reassured that a software project is being maintained well!
Chris
Re: oprofile problem: "No profiling data is on the system" [message #569360 is a reply to message #541046] Fri, 18 June 2010 15:22 Go to previous messageGo to next message
Severin Gehwolf is currently offline Severin GehwolfFriend
Messages: 40
Registered: June 2010
Member
Hi Jesper,

Could you do the following:

1. Profile your binary from with Eclipse (Profile as => Profile with Oprofile)
2. After it shows "No profiling data is on the system" go to a terminal and type:

$ opcontrol --status | grep "Image filter"

Does this show the correct path to your binary?

Oprofile stores profiling samples in /var/lib/oprofile if you do not specify "--session-dir=...". But it sometimes gets confused by samples still existing from previous runs. So, could you do:

$ rm -rf /var/lib/oprofile
$ opcontrol --image=...
$ opcontrol --start
$ ... execute my program ...
$ opcontrol --shutdown
$ opreport -l

to confirm that opreport -l shows data collected by the last run?

It could be that you are affected by the following bug:
https://bugzilla.redhat.com/show_bug.cgi?id=605425

Agreed, there's definitely room for improvement regarding installation procedure of the oprofile plugin. There's work under way to improve this. See also:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=315770

Let me know how it goes.

Cheers,
Severin
Re: oprofile problem: "No profiling data is on the system" [message #569428 is a reply to message #541188] Mon, 21 June 2010 08:17 Go to previous messageGo to next message
Jesper Eskilson is currently offline Jesper EskilsonFriend
Messages: 134
Registered: July 2009
Senior Member
On 06/18/2010 05:22 PM, Severin Gehwolf wrote:
> Hi Jesper,
>
> Could you do the following:
>
> 1. Profile your binary from with Eclipse (Profile as => Profile with
> Oprofile)
> 2. After it shows "No profiling data is on the system" go to a terminal
> and type:
>
> $ opcontrol --status | grep "Image filter"
>
> Does this show the correct path to your binary?

Yes.

> Oprofile stores profiling samples in /var/lib/oprofile if you do not
> specify "--session-dir=...". But it sometimes gets confused by samples
> still existing from previous runs. So, could you do:
>
> $ rm -rf /var/lib/oprofile
> $ opcontrol --image=...
> $ opcontrol --start
> $ ... execute my program ...
> $ opcontrol --shutdown
> $ opreport -l
>
> to confirm that opreport -l shows data collected by the last run?

opreport -l says:

> WARNING! The OProfile kernel driver reports sample buffer overflows.
> Such overflows can result in incorrect sample attribution, invalid sample
> files and other symptoms. See the oprofiled.log for details.
> You should adjust your sampling frequency to eliminate (or at least minimize)
> these overflows.
> error: no sample files found: profile specification too strict ?

oprofiled.log says:

> oprofiled started Mon Jun 21 10:11:48 2010
> kernel pointer size: 8
>
> Mon Jun 21 10:13:17 2010
>
>
> -- OProfile Statistics --
> Nr. sample dumps: 88
> Nr. non-backtrace samples: 332733
> Nr. kernel samples: 131545
> Nr. lost samples (no kernel/user): 0
> Nr. lost kernel samples: 0
> Nr. incomplete code structs: 0
> Nr. samples lost due to sample file open failure: 0
> Nr. samples lost due to no permanent mapping: 0
> Nr. event lost due to buffer overflow: 0
> Nr. samples lost due to no mapping: 3277
> Nr. backtraces skipped due to no file mapping: 0
> Nr. samples lost due to no mm: 455
>
> ---- Statistics for cpu : 3
> Nr. samples lost cpu buffer overflow: 3
> Nr. samples received: 120011
> Nr. backtrace aborted: 0
> Nr. samples lost invalid pc: 0
>
> ---- Statistics for cpu : 2
> Nr. samples lost cpu buffer overflow: 0
> Nr. samples received: 162454
> Nr. backtrace aborted: 0
> Nr. samples lost invalid pc: 0
>
> ---- Statistics for cpu : 1
> Nr. samples lost cpu buffer overflow: 1
> Nr. samples received: 194366
> Nr. backtrace aborted: 0
> Nr. samples lost invalid pc: 0
>
> ---- Statistics for cpu : 0
> Nr. samples lost cpu buffer overflow: 0
> Nr. samples received: 218887
> Nr. backtrace aborted: 0
> Nr. samples lost invalid pc: 0
> oprofiled stopped Mon Jun 21 10:13:17 2010




> It could be that you are affected by the following bug:
> https://bugzilla.redhat.com/show_bug.cgi?id=605425

The binary is located on a local harddrive, so that bug does not seem to
apply.

> Agreed, there's definitely room for improvement regarding installation
> procedure of the oprofile plugin. There's work under way to improve
> this. See also:
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=315770
>
> Let me know how it goes.
>
> Cheers,
> Severin


--
Jesper Eskilson
Developer
IAR Systems
Re: oprofile problem: "No profiling data is on the system" [message #569452 is a reply to message #541444] Mon, 21 June 2010 13:27 Go to previous messageGo to next message
Severin Gehwolf is currently offline Severin GehwolfFriend
Messages: 40
Registered: June 2010
Member
>> Oprofile stores profiling samples in /var/lib/oprofile if you do not
>> specify "--session-dir=...". But it sometimes gets confused by samples
>> still existing from previous runs. So, could you do:
>>
>> $ rm -rf /var/lib/oprofile
>> $ opcontrol --image=...
>> $ opcontrol --start
>> $ ... execute my program ...
>> $ opcontrol --shutdown
>> $ opreport -l
>>
>> to confirm that opreport -l shows data collected by the last run?
>
> opreport -l says:
>
>> WARNING! The OProfile kernel driver reports sample buffer overflows.
>> Such overflows can result in incorrect sample attribution, invalid sample
>> files and other symptoms. See the oprofiled.log for details.
>> You should adjust your sampling frequency to eliminate (or at least minimize)
>> these overflows.
>> error: no sample files found: profile specification too strict ?

Ok, this is telling me that profiling also doesn't work on the command line. My guess is, there aren't any samples in /var/lib/oprofile. You could check this by "cd /var/lib/oprofile; find | grep samples".

Could you try tuning your profiling settings (e.g. using "opcontrol --event=..." and "opcontrol --status") until you get profiling data on the command line. Alternatively, do you have a simple binary to test if oprofile works for you at all? This factorial example (C++) works for me on my machine:


unsigned long long factorial1(unsigned long long);
unsigned long long factorial2(unsigned long long);

int main() {
for (int i = 0; i < 1000000; i++) {
factorial1(20);
factorial2(20);
}
}

unsigned long long factorial1(unsigned long long n) {
if (n <= 1)
return 1;
else
return n * factorial1(n-1);
}

unsigned long long factorial2(unsigned long long n) {
unsigned long long ret = 1;
for (unsigned int i = 1; i <= n; i++)
ret *= i;
return ret;
}


Once you are able to profile your binary on the command line you can try again from within Eclipse.

Let us know how it goes.

Cheers,
Severin
Re: oprofile problem: "No profiling data is on the system" [message #569845 is a reply to message #541533] Thu, 29 July 2010 04:25 Go to previous messageGo to next message
Chris Buckley is currently offline Chris BuckleyFriend
Messages: 8
Registered: July 2010
Junior Member
I'm getting the same error message I'm running Fedora 13, which comes with Oprofile already installed.

In my case, I've tracked it down to a bad pathname, but I don't know how to change it.

After running the profile run within eclipse, examining the file /root/.oprofile/daemonrc :

SESSION_DIR=/var/lib/oprofile
CHOSEN_EVENTS_0=CPU_CLK_UNHALTED:100000:0:1:1
NR_CHOSEN=1
SEPARATE_LIB=0
SEPARATE_KERNEL=0
SEPARATE_THREAD=0
SEPARATE_CPU=0
VMLINUX=none
IMAGE_FILTER=/home/chrisb/smart/smart/bin/smart
CPU_BUF_SIZE=0
CALLGRAPH=0
XENIMAGE=none

shows that it is expecting the binary at /home/chrisb/smart/smart/bin/smart where /home/chrisb/smart is my workspace name, smart is the project name, and bin/smart is the binary within the project.

However, there's no such binary. I have the workspace and the actual project separated on different filesystems. The actual binary is at /d1/smart/src/bin/smart. The other eclipse commands handle this fine (I'm reasonably new to eclipse, but have been running compile/debug for a couple of months.). The profile configuration simply lists "bin/smart" as the application, which should be correct.

Oprofile works fine when run at the command line with the correct IMAGE_FILTER. But how do I tell eclipse to use the correct pathname?
Re: oprofile problem: "No profiling data is on the system" [message #569867 is a reply to message #569845] Thu, 29 July 2010 13:02 Go to previous messageGo to next message
Severin Gehwolf is currently offline Severin GehwolfFriend
Messages: 40
Registered: June 2010
Member
Hi Chris,

A few questions:

1.) How did you generate the binary? Did you build/compile it in Eclipse?

2.) Do you have your binaries linked into the workspace? (I.e. are you trying to profile external files; files _not_ in your workspace directory tree). If there is no /home/chrisb/smart/smart/bin/smart how did you attempt to profile it? Usually you would right-click on the binary => Profile as => Oprofile.

3.) You mention that workspace and project are on different filesystems. What's the relationship between /home/chrisb/smart/smart/bin/smart and /d1/smart/src/bin/smart? Is bin/smart (in /home) linked to bin/smart (in /d1).

Could you try profiling your binary by having your project and workspace on the same filesystem (Preferrably on a non-nfs filesystem; see bug above related to NFS)? Any luck with that?

Thanks,
Severin
Re: oprofile problem: "No profiling data is on the system" [message #569894 is a reply to message #550173] Thu, 29 July 2010 14:12 Go to previous messageGo to next message
Chris Buckley is currently offline Chris BuckleyFriend
Messages: 8
Registered: July 2010
Junior Member
Severin Gehwolf wrote on Thu, 29 July 2010 09:02
> Hi Chris,
>
> A few questions:
>
> 1.) How did you generate the binary? Did you build/compile it in Eclipse?
>
> 2.) Do you have your binaries linked into the workspace? (I.e. are you trying to profile external files; files _not_ in your workspace directory tree). If there is no /home/chrisb/smart/smart/bin/smart how did you attempt to profile it? Usually you would right-click on the binary => Profile as => Oprofile.
>
> 3.) You mention that workspace and project are on different filesystems. What's the relationship between /home/chrisb/smart/smart/bin/smart and /d1/smart/src/bin/smart? Is bin/smart (in /home) linked to bin/smart (in /d1).
>
> Could you try profiling your binary by having your project and workspace on the same filesystem (Preferrably on a non-nfs filesystem; see bug above related to NFS)? Any luck with that?
>
> Thanks,
> Severin

Thanks for the quick reply.
1. binaries built/compiled within Eclipse
2. Binaries are in the namespace. Invoked by either right click on binary or by top menu Run ->profile configurations->select the correct one->profile. The binary was selected in "Profile Configuration" from the project choices offered (ie, is "bin/smart")
3. After setting up workspace, /home/chrisb/smart has only "dot directories" in it, nothing user visible (the pointers to the pre-existing smart directories on /d1/smart are all internal to those "dot directories"). As I said, this all works for compile and debugging, but not for profiling.

After posting my message I tried the obvious work-around and it does actually work. If I manually create a symbolic link in /home/chrisb/smart called smart pointing to /d1/smart/src, then profiling within Eclipse works well (and is quite useful already!) But the only reason I knew to do that was this one pathname in /root/.oprofile/daemonrc - there wasn't anything in Eclipse that suggested I do that. Is there some way I could have found what pathnames Eclipse is using in circumstances like this?

In any case, Eclipse should not have constructed that pathname; the profile binary image was not there. It sounds like the Oprofile code uses a different algorithm to construct the binary location than the debugger does (and that algorithm is incorrect here).
Re: oprofile problem: "No profiling data is on the system" [message #569908 is a reply to message #550204] Thu, 29 July 2010 15:54 Go to previous messageGo to next message
Severin Gehwolf is currently offline Severin GehwolfFriend
Messages: 40
Registered: June 2010
Member
Sorry, I'm still a bit confused as to what your filesystem setup is...

Chris Buckley wrote on Thu, 29 July 2010 10:12
> 3. After setting up workspace, /home/chrisb/smart has only "dot directories" in it, nothing user visible (the pointers to the pre-existing smart directories on /d1/smart are all internal to those "dot directories"). As I said, this all works for compile and debugging, but not for profiling.


What's your mount setup? What does ls /home/chrisb/smart/smart/ show? Is the binary in there? If yes, you could use the filename of your binary as "C++ Application" location (note this has to be relative to your project) in "Run" => "Profile Configurations" => New Oprofile Config => Tab "Main"

Chris Buckley wrote on Thu, 29 July 2010 10:12
> After posting my message I tried the obvious work-around and it does actually work. If I manually create a symbolic link in /home/chrisb/smart called smart pointing to /d1/smart/src, then profiling within Eclipse works well (and is quite useful already!)


Cool!

Chris Buckley wrote on Thu, 29 July 2010 10:12
> But the only reason I knew to do that was this one pathname in /root/.oprofile/daemonrc - there wasn't anything in Eclipse that suggested I do that. Is there some way I could have found what pathnames Eclipse is using in circumstances like this?


Good point. We might provide some troubleshooting pointers in future. Thanks!

Chris Buckley wrote on Thu, 29 July 2010 10:12
> In any case, Eclipse should not have constructed that pathname; the profile binary image was not there. It sounds like the Oprofile code uses a different algorithm to construct the binary location than the debugger does (and that algorithm is incorrect here).


The only problem I seem to be able to reproduce is that the plugin uses project relative paths in every case. I.e. say you specify "/bin/smart" as "C++ Application" binary to profile and your path to the project is "/home/chrisb/smart/smart". This would lead to a opcontrol --image=/home/chrisb/smart/smart//bin/smart call, which in turn sets IMAGE_FILTER=/home/chrisb/smart/smart/bin/smart in /root/.oprofile/daemonrc. Is that what's happening for you?

I created a bug for this anyway: https://bugs.eclipse.org/bugs/show_bug.cgi?id=321240

Thanks,
Severin
Re: oprofile problem: "No profiling data is on the system" [message #569936 is a reply to message #569908] Thu, 29 July 2010 17:52 Go to previous messageGo to next message
Chris Buckley is currently offline Chris BuckleyFriend
Messages: 8
Registered: July 2010
Junior Member
I agree everything should be relative to the project. The problem is that at some point Eclipse is making it relative to the workspace path instead.

Right-clicking on the smart project and choosing Properties, I get the location as correctly being /d1/smart/smart.17.0/src
That is the path I would expect the relative pathnames to be from (but isn't).

The workspace I'm using at the moment is /home/chrisb/smart
/bin/ls -al /home/chrisb/smart
total 12
drwxrwxr-x. 3 chrisb chrisb 4096 Jul 29 07:21 .
drwx------. 43 chrisb chrisb 4096 Jul 29 12:55 ..
drwxrwxr-x. 4 chrisb chrisb 4096 Jul 16 13:10 .metadata
lrwxrwxrwx. 1 chrisb chrisb 16 Jul 29 07:21 smart -> /smart/smart/src
where I manually added that symbolic link to smart today (there are other symbolic links involved as well - this path is the same as the project pathname.)

When Oprofile is run, it tells opcontrol that the image path is
/home/chrisb/smart/smart/bin/smart.
(the evidence for this is in the /root/.oprofile/daemonrc file).
But there is nothing anywhere in Eclipse (that I can find) that says there is any code whatsoever under /home/chrisb/smart, and there isn't any code there (before I manually added that symbolic link). This image path is just wrong!

The workspace was created following the Eclipse tutorials of how to create a project out of an existing code base. I realize that many folks probably choose to have the workspace location be the project location and wouldn't have this problem, but I chose not to.

So is this enough detail to tell you what's going on? As I said, it's pretty clearly an Eclipse bug; I see no way that it should be using a path relative to the workspace path as opposed to the project path.

Thanks for your responses!
Re: oprofile problem: "No profiling data is on the system" [message #569958 is a reply to message #569936] Thu, 05 August 2010 17:34 Go to previous messageGo to next message
Severin Gehwolf is currently offline Severin GehwolfFriend
Messages: 40
Registered: June 2010
Member
Hi Chris,

Sorry for the late reply. I was able to reproduce the problem. It looks like the oprofile plugin is behaving that way when the project is external (i.e. project is not inside the current workspace).

I've opened a bug, so you can keep track: https://bugs.eclipse.org/bugs/show_bug.cgi?id=321905

Thanks for reporting this!

Severin
Re: oprofile problem: "No profiling data is on the system" [message #569986 is a reply to message #551246] Thu, 05 August 2010 18:13 Go to previous message
Chris Buckley is currently offline Chris BuckleyFriend
Messages: 8
Registered: July 2010
Junior Member
Thanks for getting back to this, and formulating the bug report.

It's always nice to be reassured that a software project is being maintained well!
Chris
Previous Topic:create gmon.out (gprof) witin Eclipse
Next Topic:After upgrade to 2.0 Autotools does not work
Goto Forum:
  


Current Time: Sat Apr 20 03:10:21 GMT 2024

Powered by FUDForum. Page generated in 0.04573 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top