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

Paweł Bylica via llvm-dev llvm-dev at lists.llvm.org
Wed Jan 5 02:03:58 PST 2022


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.

See bug report: https://github.com/llvm/llvm-project/issues/50966.

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

Bests,
Paweł

On Wed, Jan 5, 2022 at 8:57 AM Ian Collins via llvm-dev <
llvm-dev at lists.llvm.org> wrote:

> 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-dev at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20220105/d9ad1bbe/attachment.html>


More information about the llvm-dev mailing list