unable to decode llvmpro.out for path profiling

Hi, I am using Path Profiling to path profile a C code. I’m using this commands:

$ llvm-gcc -c -emit-llvm file.c -o file.bc
$ opt --insert-hotpath-profiling file.bc -o file.ins.bc
$ llc -march=x86 file.ins.bc -o file.ins.s
$ gcc -I llvm2.9/runtime/PathProfling.c -I llvm2.9/runtime/CommonProfiling.c
$ ./a.out

This will give me path profile of of program in ‘llvmpro.out’

to decode this profile data I tried as:
$ llvm-prof -A file.ins.bc llvmprof.out
this gives error:
llvm-prof: Unknown packet type #5!

I also tried to decode the “llvmprof.out” manually and found that it dumps different profile data for different input files.

For example for bzip2.c is dumps like this:

Pty = 1
SavedArgslength=10
SavedArgs=(null)

4* random data , that i cant figure out

Profile Header: 5
functionCount = 47
Function Id = 4 NumPathsExecuted = 36

path1 : count1
path2 : count2 and so on…

But also this format is not same for all input file. For gzip.c and gcc.c it stores data in some different manner.

I urgently need some suggestions and solutions about this problem.

Thanks in advance

Gaurav Kumar

Hi Guarav,