diff options
author | Googler <noreply@google.com> | 2017-04-28 21:35:48 +0200 |
---|---|---|
committer | Vladimir Moskva <vladmos@google.com> | 2017-04-30 23:12:08 +0200 |
commit | 47577f8b4e28d4c3ceab7d25d2ffb5a98cf90114 (patch) | |
tree | 082cd139ae7275a3bdd9d840b967faa875adbaee /src/main/java/com/google/devtools/build/lib/profiler | |
parent | 067bf92b6fab31cfbe141a9063fcf573a8348cc6 (diff) |
Convert LLVM raw profiles to indexed format if necessary.
Here is what is done today:
bazel build -c opt --fdo_optimize=<path_to_profdata_file> //target
The .profdata file is the LLVM profiles in indexed format and bazel creates a
symlink to it from bazel-fdo/_fdo/... and compiles the target.
However, the instrumented binary generates a .profraw file and hence the
conversion to .profdata must be done manually using the llvm-profdata binary
which is shipped along with the crosstool as:
$ llvm-profdata -merge -o <path_to_profdata_file> <path_profraw_file>
We are trying to avoid this intermediate step in this change by baking this
into bazel.
This implementation does the following:
* In CppConfiguration.java, adds new tool llvm-profdata.
* In CcToolchain.java, in function create, if LLVM instrumented FDO is desired,
the profile format is checked and the profile conversion takes place.
* FdoSupport.java checks for LLVM instrumented FDO is bypassed.
RELNOTES[NEW]: Raw LLVM profiles are now supported.
PiperOrigin-RevId: 154569896
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/profiler')
0 files changed, 0 insertions, 0 deletions