[LLVMdev] RFC - Improvements to PGO profile support

Diego Novillo dnovillo at google.com
Fri May 22 08:57:14 PDT 2015


On Fri, May 22, 2015 at 11:16 AM, Dario Domizioli
<dario.domizioli at gmail.com> wrote:
> Hi all,
>
> I am a bit confused about the documentation of the format of the profile
> data file.
>
> The Clang user guide here describes it as an ASCII text file:
> http://clang.llvm.org/docs/UsersManual.html#sample-profile-format
>
> Whereas the posts above and the referenced link describe it as a stream of
> bytes containing LEB128s:
> http://www.llvm.org/docs/CoverageMappingFormat.html
>
> From experimenting with the latest trunk I can see the latter is correct
> (well, at least the file I get is not ASCII text).
> Should we update the Clang user guide documentation?
> Or am I just getting confused? Are there two formats, one used for coverage
> and one used for PGO?

You are looking at two unrelated formats. The first URL describes the
sampling profiling format. That is not used for coverage, only
optimization.

There are two main profilers in LLVM. The sampling profiler uses
external profilers (e.g., Linux Perf) to produce sample information
that is then matched to the user code.  There is no option to use the
sampling profiler for coverage (it would be a very poor match).

The instrumentation profiler causes Clang to inject tracking code into
the user program. This is the one used for coverage. If you are
interested in coverage, you should read the second URL.

I will clarify the documentation for sampling profiles.


Diego.



More information about the llvm-dev mailing list