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 -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20060608/d9603c24/attachment.html>
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 projectThis *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/
Apparently Analagous Threads
- Profiling C functions called from R.
- Problem with compiling shared C/C++ library for loading into R (Linux)
- Problem with compiling shared C/C++ library for loading into R (Linux)
- [LLVMdev] Help regarding profiling information
- Beware of dangerous enviroment (Re: Overflows in minicom)