Hi,<br><br>Currently, I am working with version 3.0. I think it would be useful to make it work with new versions.<br><br>What i want to do is to apply edge and path profiling as it is explained in this report: <a href="http://llvm.org/pubs/2010-12-Preuss-PathProfiling.html">http://llvm.org/pubs/2010-12-Preuss-PathProfiling.html</a><br>
<br>Regarding the <br><br>1) naive edge profiling: (with -insert-edge-profiling)<br><br>opt -insert-edge-profiling -o matmul.ep.bc matmul.bc<br>lli -load ../lvm_build/Debug+Asserts/lib/libprofile_rt.so matmul.ep.bc<br>llvm-prof -annotated-llvm matmul.ep.bc<br>
<br>It seems ok. If you check output, you will see edge annotations are inserted in llvm-ir code. I do not think there is a formatted output for edge profiling ? (even though it says that there is a pass called -dot-edge-numbers (suppose to provide dot graph with edge annotations) in the document, the pass is not in current llvm dist. )<br>
<br>Or alternatively, one can run <a href="http://profile.pl">profile.pl</a> script:  <a href="http://profile.pl">profile.pl</a> -annotated-llvm matmul.bc<br><br>2) optimal edge profiling<br><br>opt -insert-optimal-edge-profiling -o matmul.oep.bc matmul.bc<br>

lli -load ../lvm_build/Debug+Asserts/lib/libprofile_rt.so matmul.oep.bc<br>
llvm-prof -annotated-llvm matmul.oep.bc<br><br>or alternatively <a href="http://profile.pl">profile.pl</a> -annotated-llvm matmul.bc, but before running script, i modified the pass as<br><br>my $ProfilePass = "-insert-optimal-edge-profiling"; <br>
<br>both seems working well.<br><br>3) Path profiling:<br><br>If i try to apply the command as i applied for edge profiling<br><br>opt -insert-path-profiling -o matmul.pp.bc matmul.bc<br>lli -load ../llvm_build/Debug+Asserts/lib/libprofile_rt.so matmul.pp.bc (produces llvmprof.out successfully)<br>
llvm-prof matmul.pp.bc <br>llvm-prof: Unknown packet type #5! <br><br>I searched that line in the code, and found out that it is in llvm/lib/Analysis/ProfileInfoLoader.cpp <br><br>default:<br>      errs() << ToolName << ": Unknown packet type #" << PacketType << "!\n";<br>
      exit(1);<br><br>This is where i stuck!<br><br>Furthermore, opt has some passes like:<br><br>-path-profile-loader                      - Load path profile information from file<br>-path-profile-verifier                     - Compare the path profile derived edge profile against the edge profile.<br>
 <br>I have tried to use them, but, indeed, I am not sure how to use them.<br><br>I hope i made it clear enough my problem, your comments are very welcome.<br><br>Thanks.<br>Erkan. <br><br><div class="gmail_quote">On Wed, Apr 18, 2012 at 12:15 PM, #ALOK PRAKASH# <span dir="ltr"><<a href="mailto:ALOK0001@e.ntu.edu.sg">ALOK0001@e.ntu.edu.sg</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">




<div>
<div style="direction:ltr;font-size:10pt;font-family:Tahoma">What version of LLVM are you using? The profiling framework is completely messed up in the newer versions of LLVM.. I used to work with profiling in 2.5 some time ago, and it seemed
 to work fine.. If you really need this to work quickly, you might want to just get the old version and get on with it.. 
<div><br>
</div>
<div>
<div>The newer versions of LLVM need to get the profiling part fixed soon..It is messing up my work as well..I am trying to fix it now.. If you could give me the exact details of the error and your steps, I might be able to work it out...</div>

<div><br>
</div>
<div>Cheers,</div>
<div>Alok</div>
<div><br>
</div>
<div><br>
<div style="font-size:16px;font-family:Times New Roman">
<hr>
<div style="direction:ltr"><font color="#000000" face="Tahoma"><b>From:</b> <a href="mailto:llvmdev-bounces@cs.uiuc.edu" target="_blank">llvmdev-bounces@cs.uiuc.edu</a> [<a href="mailto:llvmdev-bounces@cs.uiuc.edu" target="_blank">llvmdev-bounces@cs.uiuc.edu</a>] on behalf of erkan diken [<a href="mailto:erkandiken@gmail.com" target="_blank">erkandiken@gmail.com</a>]<br>

<b>Sent:</b> Wednesday, 18 April, 2012 5:15:42 PM<br>
<b>To:</b> <a href="mailto:llvmdev@cs.uiuc.edu" target="_blank">llvmdev@cs.uiuc.edu</a><br>
<b>Subject:</b> [LLVMdev] how to get path profile information ?<br>
</font><br>
</div><div><div class="h5">
<div></div>
<div>Dear all,<br>
<br>
I have already checked some related posted messages, such as:<br>
<br>
<a href="http://lists.cs.uiuc.edu/pipermail/llvmdev/2008-January/012315.html" target="_blank">http://lists.cs.uiuc.edu/pipermail/llvmdev/2008-January/012315.html</a> and<br clear="all">
<a href="http://lists.cs.uiuc.edu/pipermail/llvmdev/2008-February/012466.html" target="_blank">http://lists.cs.uiuc.edu/pipermail/llvmdev/2008-February/012466.html</a><br>
<br>
After getting rid of some error messages, I was able to run the following commands:
<br>
<br>
1) opt -insert-path-profiling matmul.bc -o matmul.pp.bc<br>
2) lli -load ../llvm_build/Debug+Asserts/lib/libprofile_rt.so matmul.pp.bc (generates llvmprof.out file)<br>
<br>
and as a last command:<br>
3) opt -path-profile-loader -profile-info-file=llvmprof.out matmul.pp.bc -analyze<br>
<br>
which provides the following output:<br>
<br>
Printing analysis 'Load path profile information from file':<br>
Pass::print not implemented for pass: 'Path Profiling Information Loader'!<br>
<br>
After trying several options, this is where i was able to reach, but still it does not provide what i need.<br>
<br>
I am a bit confused about which commands to apply and in which order and with which parameters.
<br>
Maybe someone who is already using path profiling can provide me some useful information.<br>
<br>
Thanks in advance.<br>
Erkan.<br>
<br>
</div>
</div></div></div>
</div>
</div>
</div>
</div>

</blockquote></div><br><br clear="all"><br>-- <br>Best Regards,<br>Erkan Diken<br>------------------<br><br>