[LLVMdev] Linux Perf support in the LLVM tree

Diego Novillo dnovillo at google.com
Thu Aug 21 11:43:05 PDT 2014


In http://reviews.llvm.org/D4850, I proposed porting a tool that
converts Linux Perf profiles to LLVM. This tool would be invoked via
llvm-profdata using a new 'convert' command.

Unfortunately, there are some wrinkles in this port that are likely
going to represent ongoing maintenance issues, as well as some
licencing concerns due to some kernel headers used by the Perf parser.

To make things simpler, I am changing my plans a bit. Since LLVM
already has a canonical format that sample profilers must emit
(http://clang.llvm.org/docs/UsersManual.html#sample-profile-format),
any sample profiler (not just Linux Perf) that writes its profiles in
that format can already be handled by LLVM. When using Linux Perf, a
Perf->LLVM conversion tool is available at
https://github.com/google/autofdo.

Therefore, I'm dropping the patch http://reviews.llvm.org/D4850 to
maintain the current status. The current format supported by LLVM is
simple to generate from any sample profiler, so we can use it as an
exchange format. The backend currently reads it directly, but in the
near future I will introduce a more compact representation for which I
will add a 'convert' operation to llvm-profdata.

This way, we can easily add support for other sample profilers using
the exchange format defined in
http://clang.llvm.org/docs/UsersManual.html#sample-profile-format. We
control that format, so we can make changes to it independently of
what other sample profilers generate.


Thanks. Diego.



More information about the llvm-dev mailing list