<div dir="ltr"><div>hi,</div><div><span class="Apple-style-span" style="border-collapse: collapse; font-family: verdana, geneva, helvetica, arial, sans-serif; -webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; "><br>
</span></div><div><span class="Apple-style-span" style="border-collapse: collapse; font-family: verdana, geneva, helvetica, arial, sans-serif; -webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; ">My work consist in :</span></div>
<div><font class="Apple-style-span" face="verdana, geneva, helvetica, arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse; -webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px;">1)translating the c code program into a bc code with llvm-gcc (done)</span></font></div>
<div><font class="Apple-style-span" face="verdana, geneva, helvetica, arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse; -webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px;">2)write a pass to be used to instrument the bc code resulted from 2 ( i will use insert block profiling pass so done )</span></font></div>
<div><font class="Apple-style-span" face="verdana, geneva, helvetica, arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse; -webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px;"><meta http-equiv="content-type" content="text/html; charset=utf-8"><span class="Apple-style-span" style="font-family: Verdana, Georgia, serif; font-size: 14px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; ">3)Use LLVM's llc program to generate C or assembly code of your instrumented program (not yet). <br>
4) Compile the C/asm code to native code with gcc and link it with any native code libraries that it needs. <br>5) Run the program and gather the information from your instrumentation instructions. </span></span></font></div>
<div><font class="Apple-style-span" face="verdana, geneva, helvetica, arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse; -webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px;">wihich i find the same with this article </span></font></div>
<div><font class="Apple-style-span" face="verdana, geneva, helvetica, arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse; -webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px;"><br>
</span></font></div><div><font class="Apple-style-span" face="verdana, geneva, helvetica, arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse; -webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px;"><meta http-equiv="content-type" content="text/html; charset=utf-8"><span class="Apple-style-span" style="font-family: arial; border-collapse: separate; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; "> <a href="http://old.nabble.com/Determine-branch-coverage-information-td26141617.html#a26440560">http://old.nabble.com/Determine-branch-coverage-information-td26141617.html#a26440560</a></span></span></font></div>
<div><font class="Apple-style-span" face="verdana, geneva, helvetica, arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse; -webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px;"><meta http-equiv="content-type" content="text/html; charset=utf-8"><span class="Apple-style-span" style="font-family: arial; border-collapse: separate; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; "><div>
but the last command in that article doesn't works fr me: </div><div><span class="Apple-style-span" style="border-collapse: collapse; font-family: verdana, geneva, helvetica, arial, sans-serif; font-size: 13px; -webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; ">llvm-prof -print-all-code <executable>.1.bc </span></div>
<div><font class="Apple-style-span" face="verdana, geneva, helvetica, arial, sans-serif" color="#CC0000"><span class="Apple-style-span" style="border-collapse: collapse; -webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; ">llvm-prof: Error opening 'llvmprof.out': No such file or directory</span></font></div>
<div><font class="Apple-style-span" face="verdana, geneva, helvetica, arial, sans-serif" color="#CC0000"><span class="Apple-style-span" style="border-collapse: collapse; -webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; "><br>
</span></font></div><div><font class="Apple-style-span" face="verdana, geneva, helvetica, arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse; -webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; "><meta http-equiv="content-type" content="text/html; charset=utf-8"><span class="Apple-style-span" style="font-family: arial; border-collapse: separate; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; "><div style="color: rgb(0, 0, 0); ">
i found that <span class="Apple-style-span" style="border-collapse: collapse; font-family: verdana, geneva, helvetica, arial, sans-serif; font-size: 13px; -webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; "><a href="http://profile.pl">profile.pl</a> which takes a single bytecode file and parameters could do all the work of instrumenting, running and executing llvm-prof in one go.</span></div>
<div style="color: rgb(0, 0, 0); "><span class="Apple-style-span" style="border-collapse: collapse; font-family: verdana, geneva, helvetica, arial, sans-serif; font-size: 13px; -webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; ">but i try this :</span></div>
<div style="color: rgb(0, 0, 0); "><div><br></div><div>sudo /usr/local/llvm-2.8/utils/<a href="http://profile.pl">profile.pl</a> -edge hello.bc</div><div><font class="Apple-style-span" color="#CC0000">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</font></div>
<div><font class="Apple-style-span" color="#CC0000">  -load request ignored.</font></div><div><font class="Apple-style-span" color="#CC0000">LLVM ERROR: Program used external function 'llvm_start_edge_profiling' which could not be resolved!</font></div>
<div><br></div><div>and when i tried to make each command in the <a href="http://profile.pl">profile.pl</a>  manually step by step i found this problems </div><div><br></div><div>opt -q -f -insert-block-profiling hello.bc -o result.bc.inst</div>
<div><font class="Apple-style-span" color="#CC0000">opt: Unknown command line argument '-insert-block-profiling'.  Try: 'opt -help'</font></div></div><div style="color: rgb(0, 0, 0); "><font class="Apple-style-span" color="#CC0000"><br>
</font></div><div style="color: rgb(0, 0, 0); "><font class="Apple-style-span" color="#CC0000"><br></font></div><div>thanks</div><div><br></div></span></span></font></div></span></span></font></div><meta http-equiv="content-type" content="text/html; charset=utf-8"><meta http-equiv="content-type" content="text/html; charset=utf-8"></div>