[PATCH] D36351: [lld][ELF] Add profile guided section layout

Peter Collingbourne via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 7 14:52:01 PDT 2017


pcc added a comment.

In https://reviews.llvm.org/D36351#864001, @pcc wrote:

> In https://reviews.llvm.org/D36351#863966, @ruiu wrote:
>
> > > I have a local patch to AutoFDO that I use to create profiles. I can upload it somewhere if you'd like.
> >
> > Thanks. But the paper says that they used `perf` command to get profiling data. Why did you have to use AutoFDO?
>
>
> As far as I know the missing piece is a tool that converts LBR data collected by `perf` into a weighted call graph. AutoFDO already has support for creating weighted call graphs from `perf` LBR data, so I just needed to teach it to output the graph in a different format.


Here is my patched copy of autofdo: https://github.com/pcc/autofdo/tree/lld-cgprofile

Once you've built it, you can use it like this:

  perf record --pfm-events=br_inst_retired:near_taken -b ./your_binary
  /path/to/create_lld_profile -binary ./your_binary perf.data

Then the profile will be in `cgprofile.txt`.


Repository:
  rL LLVM

https://reviews.llvm.org/D36351





More information about the llvm-commits mailing list