[LLVMdev] Profiling dynamically loaded libraries
Chris Lattner
sabre at nondot.org
Thu Jun 8 22:31:42 PDT 2006
On Thu, 8 Jun 2006, Domagoj Babic wrote:
> 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
--
http://nondot.org/sabre/
http://llvm.org/
More information about the llvm-dev
mailing list