<div dir="ltr"><br>I'm glad to announce the availability of the AutoFDO converter for LLVM. This tool reads a profile generated with Linux Perf (<a href="https://perf.wiki.kernel.org/" class="cremed">https://perf.wiki.kernel.org/</a>) and converts it into a format readable with LLVM's sample-based profiler. The converter shares a significant amount of code with GCC's converter tool (authored by Dehao Chen), so we can support both compilers with it.<br>
<br>At this time, I'm looking for volunteers to try out the tool and use it with their own code. There will be missing documentation, sharp edges and other issues typical of a tool that so far has had limited use.<br>
<br>To download and build the converter:<br><br><font face="courier new, monospace">$ git clone <a href="https://github.com/google/autofdo.git">https://github.com/google/autofdo.git</a> autofdo<br>$ cd autofdo && ./configure && make</font><br>
<br>Note that you will need a compiler with C++11 support (either gcc 4.7+ or a recent Clang/LLVM).<br><br>To use the converter, you need to use Perf with a kernel that supports LBR (any kernel post 3.4 should suffice) and LLVM from trunk (there is some support in the 3.4 release, but there were changes post 3.4 that are only present in trunk). The workflow is:<br>
<br><font face="courier new, monospace">$ clang++ -O2 -gline-tables-only code.cc -o code<br>$ perf record -b ./code<br>$ create_llvm_prof --binary=./code --out=code.prof<br>$ clang++ -O2 -fprofile-sample-use=code.prof code.cc -o code</font><br>
<br>The second version of '<font face="courier new, monospace">code</font>' should run faster than the first one. In theory.<br><br>For issues with the tool itself, please use the issue tracker in github (<a href="https://github.com/google/autofdo/issues" class="cremed">https://github.com/google/autofdo/issues</a>). There is also a mailing list where you can ask questions about it (<a href="https://groups.google.com/forum/#!forum/autofdo)" class="cremed">https://groups.google.com/forum/#!forum/autofdo)</a>.<div>
<br></div><div><br></div><div>Thanks. Diego.</div></div>