How to use profiling runtime for program profiling?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

How to use profiling runtime for program profiling?

Haifeng He
Hi, all

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?

Thanks

Haifeng
_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Reply | Threaded
Open this post in threaded view
|

Re: How to use profiling runtime for program profiling?

Plessl Christian
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,
  Christian



_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Reply | Threaded
Open this post in threaded view
|

Re: How to use profiling runtime for program profiling?

Haifeng He
Thank for the reply. It works if I link the runtime library manually.

Best,
Haifeng

On Jan 30, 2008 2:23 AM, Christian Plessl <[hidden email]> 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,
>   Christian
>
>
>
> _______________________________________________
> LLVM Developers mailing list
> [hidden email]         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>
_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Reply | Threaded
Open this post in threaded view
|

Re: How to use profiling runtime for program profiling?

Haifeng He
In reply to this post by Plessl Christian
Thanks. It works if I link the runtime manually.

Haifeng

On Jan 30, 2008 2:23 AM, Christian Plessl <[hidden email]> 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,
>   Christian
>
>
>
> _______________________________________________
> LLVM Developers mailing list
> [hidden email]         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>
_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev