[LLVMdev] How to use profiling runtime for program profiling?
hehaifeng2nd at gmail.com
Thu Jan 31 18:07:00 PST 2008
Thanks. It works if I link the runtime manually.
On Jan 30, 2008 2:23 AM, Christian Plessl <christian at plesslweb.ch> wrote:
> Hi Haifeng
> > I have a question about how to profile program with LLVM. When I tried
> > to compile the instrumented version of program after using "-insert-
> > block-profiling", I got
> > error complaining " undefined reference to
> > `llvm_start_block_profiling'.
> > I found that there is a "runtime"directory in llvm source directory
> > but in the Makefile, it said llvm gcc 4 and above already included
> > the libraries. I was using llvm
> > gcc 4. Why would I still get the error?
> I experienced the same error on Mac OS X when using the binary
> distribution of llvm-gcc 4.0 and building llvm from SVN head. It seems
> that the comment in the Makefile is wrong. I had to explicitly build
> the runtime using 'make -C runtime install'.
> You will also find the utils/profile.pl script useful, which passes
> profiling options to opt for instrumenting the bytecode and calls lli
> with the correct arguments and paths for loading the profiling library
> profile_rt.so (which defines 'llvm_start_block_profiling' etc.)
> Best regards,
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu
More information about the llvm-dev