<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><br><div><blockquote type="cite"><div>On Jul 16, 2014, at 11:20 AM, Diego Novillo <<a href="mailto:dnovillo@google.com">dnovillo@google.com</a>> wrote:</div><br class="Apple-interchange-newline"><div><br><div>A few weeks ago, I announced the availability of a conversion tool that converts Linux Perf sample profiles to LLVM's sample profiler (<a href="https://github.com/google/autofdo">https://github.com/google/autofdo</a>).</div>
<div><br></div><div>I have now ported this tool to the LLVM tree, so it can be made available as part of LLVM. I've got a working version, but I still need to massage the code to use LLVM's own libraries (logging, flags, etc) and adapt it to LLVM's coding guidelines.</div>
<div><br></div><div>I expect to have an initial patch ready in a few days. In the meantime, I would like to open it up for some bike shedding on how this tool will integrate with LLVM. I cannot guarantee that I'll agree to address all feedback myself, but I do want to make sure that the major issues and direction are addressed.</div>
<div><br></div><div>The tool receives two inputs: a profile file and an ELF executable (built with -gmlt). It produces as output a profile in the format expected by -fprofile-sample-use.</div><div><br></div><div>The requirements on the input is that we must be able to map counts to specific source file locations. So, the profiling source must be some kind of sample-based instruction execution counter. Anything that keeps track of how frequently a specific instruction has been executed.</div>
<div><br></div><div>Using the executable's line table information, the tool maps instruction locations back to source locations.</div><div><br></div><div>Currently, the native profile reader for Linux Perf and the writer for LLVM's profile are part of the same tree. They both reside in llvm/tools/llvm-prof-converter.</div></div></blockquote><div><br></div>What do you think about invoking this via the existing “llvm-profdata” tool?  It currently supports two commands: “show” and “merge”. We could add a new “convert” command.</div><div><br></div><div><blockquote type="cite"><div><div><br></div><div>I would like to support more than Linux Perf, eventually. So, I'm thinking that I want to move the LLVM profile writer to llvm/lib/ProfileData and only have the various readers under llvm/tools/llvm-prof-converter.</div>
<div><br></div><div>I don't think I will be working on supporting anything other than Linux Perf for now. But if anyone is interested in supporting profilers in other platforms, please let me know. I want to make sure the implementation doesn't tie itself too much to Linux Perf.</div>
<div><br></div><div><br></div><div>Thanks. Diego.</div>
_______________________________________________<br>LLVM Developers mailing list<br><a href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a>         <a href="http://llvm.cs.uiuc.edu">http://llvm.cs.uiuc.edu</a><br><a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br></div></blockquote></div><br></body></html>