[LLVMdev] instrument a byte code with llvm
nabila.abdessaied at gmail.com
Thu Apr 7 02:16:06 PDT 2011
My work consist in :
1)translating the c code program into a bc code with llvm-gcc (done)
2)write a pass to be used to instrument the bc code resulted from 2 ( i will
use insert block profiling pass so done )
3)Use LLVM's llc program to generate C or assembly code of your instrumented
program (not yet).
4) Compile the C/asm code to native code with gcc and link it with any
native code libraries that it needs.
5) Run the program and gather the information from your instrumentation
wihich i find the same with this article
but the last command in that article doesn't works fr me:
llvm-prof -print-all-code <executable>.1.bc
llvm-prof: Error opening 'llvmprof.out': No such file or directory
i found that profile.pl which takes a single bytecode file and parameters
could do all the work of instrumenting, running and executing llvm-prof in
but i try this :
sudo /usr/local/llvm-2.8/utils/profile.pl -edge hello.bc
Error opening '/usr/lib/llvm-2.8/lib/profile_rt.so':
/usr/lib/llvm-2.8/lib/profile_rt.so: cannot open shared object file: No such
file or directory
-load request ignored.
LLVM ERROR: Program used external function 'llvm_start_edge_profiling' which
could not be resolved!
and when i tried to make each command in the profile.pl manually step by
step i found this problems
opt -q -f -insert-block-profiling hello.bc -o result.bc.inst
opt: Unknown command line argument '-insert-block-profiling'. Try: 'opt
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the llvm-dev