Profiling dynamically loaded libraries

Hi,

Standard approach to profiling dynamically loaded libraries with
gprof doesn’t seem to work with LLVM:

export LD_PROFILE=Mylib.so
export LD_PROFILE_OUTPUT=.
make ENABLE_PROFILING=1 // compiling my project

opt -load Profile/Mylib.so -options…

but no Mylib.so.profile (or gmon.out) is produced. Profiling
libc.so.6 usage by “ls -l”, however, works fine.

Could anyone explain me what am I doing wrong?

Thx.
Domagoj

Other possibly relevant info:
Makefile contains:
LIBRARYNAME=Mylib
SHARED_LIBRARY=1
LOADABLE_MODULE=1

Platform: Suse Linux
gprof 2.15.94.0.2.2
gcc 3.3.5 20050117

Standard approach to profiling dynamically loaded libraries with
gprof doesn't seem to work with LLVM:

export LD_PROFILE=Mylib.so
export LD_PROFILE_OUTPUT=.

I've never used these before.

make ENABLE_PROFILING=1 // compiling my project

This *should* work, but hasn't been tested for a very long time. You could try passing VERBOSE=1 to make to see if it is compiling LLVM right. Also, make sure that both LLVM and your project are compiled with that.

opt -load Profile/Mylib.so -options...

but no Mylib.so.profile (or gmon.out) is produced. Profiling
libc.so.6 usage by "ls -l", however, works fine.

Could anyone explain me what am I doing wrong?

I don't know, other than you should make sure that LLVM is compiled with profile info too.

-Chris