Help regarding profiling information

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

Help regarding profiling information

Murali Nethi
Hi,

I am trying to obtain basic block profiles for mediabench g721
benchmark. I have successfully built llvm in profile_enabling mode.
Then so as to find out the block execution frequency, I ran the
command, analyze encode.out-cbe. It generated gmon.out which I read
using gprof. However, I did not get the basic block level execution
frequency. Can anybody help me as to how I can extract the basic block
execution frequency using llvm?

Thanks
Murali

_______________________________________________
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: Help regarding profiling information

Reid Spencer
On Wed, 2005-07-27 at 14:07 -0400, Murali Nethi wrote:
> Hi,
>
> I am trying to obtain basic block profiles for mediabench g721
> benchmark. I have successfully built llvm in profile_enabling mode.

The ENABLE_PROFILE variable to make builds profiling mode for the LLVM
tools, not for the programs you process with those tools.

> Then so as to find out the block execution frequency, I ran the
> command, analyze encode.out-cbe. It generated gmon.out which I read
> using gprof.

The gmon.out file is for the analyze program, not for the program you're
analyzing.

>  However, I did not get the basic block level execution
> frequency. Can anybody help me as to how I can extract the basic block
> execution frequency using llvm?

You need to use one of the instrumentation passes. In particular, the
block profiler, which can be found in
lib/Transforms/Instrumentation/BlockProfiling.cpp.

You can use it like this:

opt -insert-function-profiling -insert-block-profiling YourBytecode.bc > ProfiledBytecode.bc

This will insert the necessary instructions to do the profiling at run
time when you execute the program. You can then use llvm-prof to get the
profiling information.

To make all this easier, please review llvm/utils/profile.pl which is a
perl script that runs the necessary LLVM programs correctly to produce
the profiling information.

>
> Thanks
> Murali
>
> _______________________________________________
> 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

signature.asc (196 bytes) Download Attachment