llvm-prof: Error opening 'llvmprof.out': Illegal seek

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

llvm-prof: Error opening 'llvmprof.out': Illegal seek

reem abdelkader
Hi there,

Does anyone knows the reason of this error:

llvm-prof: Error opening 'llvmprof.out': Illegal seek
Reply | Threaded
Open this post in threaded view
|

Re: llvm-prof: Error opening 'llvmprof.out': Illegal seek

reem abdelkader
It is solved.

The problem was trying to profile while the llvmprof.out has not been generated.

Below, the sequence of instructions that worked with me


$ clang -03 -emit-llvm hello.c -c -o hello.bc
$ opt -insert-edge-profiling hello.bc -o hello.profile.bc

$ llc hello.profile.bc -o hello.profile.s

$ clang -o hello.profile hello.profile.s <LLVM_HOME_DIR>/build/Debug+Asserts/lib/libprofile_rt.so

$ ./hello.profile

$ llvm-prof hello.profile.bc


and the output is:

===-------------------------------------------------------------------------===
LLVM profiling output for execution:
 

===-------------------------------------------------------------------------===
Function execution frequencies:

 ##   Frequency
  1.     1/1 main

===-------------------------------------------------------------------------===
Top 20 most frequently executed basic blocks:

 ##      %%
        Frequency
  1.   100%     1/1 main() -