Skip to contentSkip to conversation

How do you profile an executable that loads shared libraries?

DISCUSSION Scott Simpson 2 participants 2 messages Feb 18, 2009 – Feb 19, 2009

lore
Share & tools
lore
#0 lore raw

I have an executable that loads shared libraries. I compiled with "-g -pg" and then I ran gprof on the gmon.out file. I don't see any of the shared libraries that the program loaded in my gprof output. How do you profile shared libraries?

Also, I saw on the ld.so man page the LD_PROFILE variable but I found information on the net that says variable should not be used when using -pg.

Can someone help me out? I can't find information *anywhere* on profiling shared libraries using gprof or the LD_PROFILE variable.

Sorry to post here. I don't know where else to post.

#1 lore raw
Quoted 5 lines · Scott Simpson

I have an executable that loads shared libraries. I compiled with "-g -pg" and then I ran gprof on the gmon.out file. I don't see any of the shared libraries that the program loaded in my gprof output. How do you profile shared libraries?

Quoted 8 lines

Also, I saw on the ld.so man page the LD_PROFILE variable but I found information on the net that says variable should not be used when using -pg.

Can someone help me out? I can't find information *anywhere* on profiling shared libraries using gprof or the LD_PROFILE variable.

Sorry to post here. I don't know where else to post.

Can't really help you with gprof, but in most cases it's likely much easier to use oprofile instead, then you don't have to recompile your app..