Tuesday, September 25, 2007

Profiling LLVM

It is possible to use gprof to profile the LLVM tools such as llc and such. It is necessary to build LLVM with the profiling functions enabled. To do this, go to the LLVM root and type:

make -j2 ENABLE_PROFILING=1

That will build a 'Profile' directory containing all the binaries of LLVM tools. Now, every time you run llc it will produce the gmon.out file containing profiling information. This file can be read with gprof using the command line:

gprof $PATH_TO_LLC/llc > out.prof

0 Comments:

Post a Comment

<< Home