<div dir="ltr"><div>Hi Ian,</div><div><br></div><div>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.</div><div><br></div><div>My solution is to add %m to LLVM_PROFILE_FILE. This way each binary will be using independent profile files.</div><div><br></div><div>See bug report: <a href="https://github.com/llvm/llvm-project/issues/50966">https://github.com/llvm/llvm-project/issues/50966</a>.</div><div><br></div><div>Before clang-13 this scenario was working, but I'm not sure this was intended and supported.</div><div><br></div><div>Bests,</div><div>Paweł<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Jan 5, 2022 at 8:57 AM Ian Collins via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hello,  I hop that this is the right place to ask this...<br>
<br>
<br>
My system is Ubuntu 20.04.<br>
<br>
I have a pretty standard build process for some C++ targets that runs a <br>
bunch of tests with instrumentation enabled (-fprofile-instr-generate <br>
and -fcoverage-mapping on compile and link) which has been working fine <br>
up until I changed from clang-12 to clang-13 tools.<br>
<br>
<br>
Now llvm-profdata merge reports "warning: file.profraw: malformed <br>
instrumentation profile data" for each profraw file.<br>
<br>
<br>
The only change is the tool chain.<br>
<br>
<br>
"file" describes the profraw files as LLVM raw profile data, version 6.  <br>
Running any other version of llvm-profdata produces "unsupported <br>
instrumentation profile format version" warnings, so the profraw file <br>
generation appears to be correctly generated.<br>
<br>
<br>
Thanks,<br>
<br>
Ian<br>
<br>
_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
</blockquote></div>