[llvm-dev] Is profile data collection broken in clang-13?

1,729 views
Skip to first unread message

Ian Collins via llvm-dev

unread,
Jan 5, 2022, 2:57:09 AM1/5/22
to llvm-dev
Hello,  I hop that this is the right place to ask this...


My system is Ubuntu 20.04.

I have a pretty standard build process for some C++ targets that runs a
bunch of tests with instrumentation enabled (-fprofile-instr-generate
and -fcoverage-mapping on compile and link) which has been working fine
up until I changed from clang-12 to clang-13 tools.


Now llvm-profdata merge reports "warning: file.profraw: malformed
instrumentation profile data" for each profraw file.


The only change is the tool chain.


"file" describes the profraw files as LLVM raw profile data, version 6. 
Running any other version of llvm-profdata produces "unsupported
instrumentation profile format version" warnings, so the profraw file
generation appears to be correctly generated.


Thanks,

Ian

_______________________________________________
LLVM Developers mailing list
llvm...@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev

Ian Collins via llvm-dev

unread,
Jan 5, 2022, 2:59:49 AM1/5/22
to llvm-dev

Paweł Bylica via llvm-dev

unread,
Jan 5, 2022, 5:04:45 AM1/5/22
to Ian Collins, llvm-dev
Hi Ian,

I encountered the same issue after upgrading to clang-13. In my case the problem was related to profiling an application with a shared library. I believe the profraw file gets corrupted when two binaries (main executable and a shared library) are accessing it.

My solution is to add %m to LLVM_PROFILE_FILE. This way each binary will be using independent profile files.


Before clang-13 this scenario was working, but I'm not sure this was intended and supported.

Bests,
Paweł
Reply all
Reply to author
Forward
0 new messages