<div dir="ltr">Bruce,<div><br></div><div>Can valgrind give me the execution counts for each Instruction in the LLVM bitcode?</div><div><br></div><div>Thanks,</div><div>Steve</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, May 28, 2015 at 9:34 AM, Bruce Hoult <span dir="ltr"><<a href="mailto:bruce@hoult.org" target="_blank">bruce@hoult.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">That seems like a job for valgrind?<div><br></div><div>Assuming you're on a supported platform, but these days that includes all the common Mac/Linux/Android platforms except ARM64.</div></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="h5">On Thu, May 28, 2015 at 4:08 PM, Stephen Thomas <span dir="ltr"><<a href="mailto:stephen.warner.thomas@gmail.com" target="_blank">stephen.warner.thomas@gmail.com</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><div dir="ltr">Hi,<div><br></div><div>I'd like a simple and fast way to collect the number of times each Instruction was executed in a given run of the application. As far as I can tell, there are a number of approaches I can take:</div><div><br></div><div>- Use PIN. This would require using DWARF debug info and Instruction debug info to attempt to map instructions in the binary to instructions in the bitcode; not 100% sure how accurate this will be.</div><div><br></div><div>- Use llvm-prof. Two questions here. First, I've seen on <a href="https://urldefense.proofpoint.com/v2/url?u=https-3A__stackoverflow.com_questions_14617067_collecting-2Dllvm-2Dedge-2Dprofiling-2Dwith-2Dllvm-2Dprof&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=Mfk2qtn1LTDThVkh6-oGglNfMADXfJdty4_bhmuhMHA&m=HtoNbGGO3zcoVy6n3_8lqn7ZXiNnqiQKim27ER3buUQ&s=kf8XiNx6628Vrx9TCVI4rrnisNDMVf8ZcuKA6V0udhE&e=" target="_blank">Stack Overflow</a> an option to `opt` called `--insert-edge-profiling`. However, that option doesn't seem to be available in 3.6? Second, it appears that such profiling only records execution counts at the Function level, not at the individual Instruction level. Is that correct?</div><div><br></div><div>- Write a new tool similar to <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__clang.llvm.org_docs_AddressSanitizer.html&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=Mfk2qtn1LTDThVkh6-oGglNfMADXfJdty4_bhmuhMHA&m=HtoNbGGO3zcoVy6n3_8lqn7ZXiNnqiQKim27ER3buUQ&s=B48ymTvL2IOafrTkfbB7YJl2y6OdfQtG7_I7dfiuNPU&e=" target="_blank">AddressSanitizer.</a> This may work, but seems like overkill.</div><div><br></div><div>Is there an easier way to achieve my goal that I'm missing?</div><div><br></div><div>Thanks,</div><div>Steve</div>
</div>
<br></div></div>_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:LLVMdev@cs.uiuc.edu" target="_blank">LLVMdev@cs.uiuc.edu</a>         <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
<br></blockquote></div><br></div>
</blockquote></div><br></div>