<div dir="ltr">There's a good example of a function pass in "Getting Started with LLVM Core Libraries", but I'm really quite certain that there are already some excellent profiling tools out there. Are you sure that you're not re-inventing the wheel? Can you tell me more about what the final end goal is?</div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jul 17, 2015 at 10:31 AM, Wehrli Johan <span dir="ltr"><<a href="mailto:johan.wehrli@heig-vd.ch" target="_blank">johan.wehrli@heig-vd.ch</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Yeah I have already see pintool but I need this to work with ARM and Intel.<br>
<br>
If I remember correctly, pintool does not work on ARM (or quite bad).<br>
<br>
My goal with the instrumentation is, once I have the information (time + call), to choose (during a second compilation) if some of my passes are applicable or not.<br>
<br>
Greetings,<br>
<br>
Johan<br>
<span class=""><br>
On 17 Jul 2015, at 16:09, Kenneth Adam Miller <<a href="mailto:kennethadammiller@gmail.com">kennethadammiller@gmail.com</a><mailto:<a href="mailto:kennethadammiller@gmail.com">kennethadammiller@gmail.com</a>>> wrote:<br>
<br>
Have you seen intel pintools? You might not need to write near as much code, however it may not suit your use case because the compiler can see information that otherwise might be missed in the context of a fully compiled binary. Please let me know your thoughts and then we can pick up from there.<br>
<br>
</span><span class="">On Fri, Jul 17, 2015 at 2:43 AM, Wehrli Johan <<a href="mailto:johan.wehrli@heig-vd.ch">johan.wehrli@heig-vd.ch</a><mailto:<a href="mailto:johan.wehrli@heig-vd.ch">johan.wehrli@heig-vd.ch</a>>> wrote:<br>
Hi everyone,<br>
<br>
I would like to instrument my code in order to know the number of times a function is called and its execution time.<br>
<br>
After some research, I find several leads in llvm/lib/ProfilData/ and llvm/lib/Transform/Instrumentation/ but nothing conclusive.<br>
<br>
Does anyone know if this is already possible with LLVM or has a good suggestion for the beginning?<br>
<br>
I saw the -fprofile-instr-generate, -fprofile-instr-use, -fprofile-arcs, -ftest-coverage parameters but I can’t get the information I want with it.<br>
<br>
It seem that the easiest solution is to write a pass who will instrument the code.<br>
<br>
Greetings,<br>
<br>
Johan<br>
<br>
_______________________________________________<br>
LLVM Developers mailing list<br>
</span><a href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a><mailto:<a href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a>>         <a href="http://llvm.cs.uiuc.edu" rel="noreferrer" target="_blank">http://llvm.cs.uiuc.edu</a><<a href="http://llvm.cs.uiuc.edu/" rel="noreferrer" target="_blank">http://llvm.cs.uiuc.edu/</a>><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" rel="noreferrer" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
<br>
<br>
</blockquote></div><br></div>