<div dir="ltr">buildbot@sanitizer-buildbot-vb-wlz1:/b/sanitizer-x86_64-linux/build/compiler_rt_build$ /b/sanitizer-x86_64-linux/build/llvm_build64/bin/clang   -m64  -ldl  -fprofile-instr-generate -Wl,--build-id=none -O2 -o /b/sanitizer-x86_64-linux/build/compiler_rt_build/test/profile/Profile-x86_64/Linux/Output/binary-id.c.tmp /b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/profile/Linux/binary-id.c<br>buildbot@sanitizer-buildbot-vb-wlz1:/b/sanitizer-x86_64-linux/build/compiler_rt_build$ env LLVM_PROFILE_FILE=/b/sanitizer-x86_64-linux/build/compiler_rt_build/test/profile/Profile-x86_64/Linux/Output/binary-id.c.tmp.profraw  /b/sanitizer-x86_64-linux/build/compiler_rt_build/test/profile/Profile-x86_64/Linux/Output/binary-id.c.tmp<br>buildbot@sanitizer-buildbot-vb-wlz1:/b/sanitizer-x86_64-linux/build/compiler_rt_build$ ../llvm_build64/bin/llvm-profdata show --binary-ids  /b/sanitizer-x86_64-linux/build/compiler_rt_build/test/profile/Profile-x86_64/Linux/Output/binary-id.c.tmp.profraw > /b/sanitizer-x86_64-linux/build/compiler_rt_build/test/profile/Profile-x86_64/Linux/Output/binary-id.c.tmp.out<br>buildbot@sanitizer-buildbot-vb-wlz1:/b/sanitizer-x86_64-linux/build/compiler_rt_build$ ../llvm_build64/bin/llvm-profdata show --binary-ids  /b/sanitizer-x86_64-linux/build/compiler_rt_build/test/profile/Profile-x86_64/Linux/Output/binary-id.c.tmp.profraw <br>Instrumentation level: Front-end<br>Total functions: 3<br>Maximum function count: 1<br>Maximum internal block count: 0<br>buildbot@sanitizer-buildbot-vb-wlz1:/b/sanitizer-x86_64-linux/build/compiler_rt_build$ ../llvm_build64/bin/llvm-profdata merge -o /b/sanitizer-x86_64-linux/build/compiler_rt_build/test/profile/Profile-x86_64/Linux/Output/binary-id.c.tmp.profdata /b/sanitizer-x86_64-linux/build/compiler_rt_build/test/profile/Profile-x86_64/Linux/Output/binary-id.c.tmp.profraw<br>buildbot@sanitizer-buildbot-vb-wlz1:/b/sanitizer-x86_64-linux/build/compiler_rt_build$ /b/sanitizer-x86_64-linux/build/llvm_build64/bin/clang   -m64  -ldl  -fprofile-instr-generate -Wl,--build-id -O2 -o /b/sanitizer-x86_64-linux/build/compiler_rt_build/test/profile/Profile-x86_64/Linux/Output/binary-id.c.tmp /b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/profile/Linux/binary-id.c<br>buildbot@sanitizer-buildbot-vb-wlz1:/b/sanitizer-x86_64-linux/build/compiler_rt_build$ env LLVM_PROFILE_FILE=/b/sanitizer-x86_64-linux/build/compiler_rt_build/test/profile/Profile-x86_64/Linux/Output/binary-id.c.tmp.profraw  /b/sanitizer-x86_64-linux/build/compiler_rt_build/test/profile/Profile-x86_64/Linux/Output/binary-id.c.tmp<br>buildbot@sanitizer-buildbot-vb-wlz1:/b/sanitizer-x86_64-linux/build/compiler_rt_build$ ../llvm_build64/bin/llvm-profdata show --binary-ids  /b/sanitizer-x86_64-linux/build/compiler_rt_build/test/profile/Profile-x86_64/Linux/Output/binary-id.c.tmp.profraw <br>Instrumentation level: Front-end<br>Total functions: 3<br>Maximum function count: 1<br>Maximum internal block count: 0<br><div><br></div><div><br></div><div>And no Binary IDs</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, 8 Dec 2021 at 10:07, Gulfem Savrun Yeniceri via Phabricator <<a href="mailto:reviews@reviews.llvm.org">reviews@reviews.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">gulfem added a comment.<br>
<br>
In D102039#3171276 <<a href="https://reviews.llvm.org/D102039#3171276" rel="noreferrer" target="_blank">https://reviews.llvm.org/D102039#3171276</a>>, @vitalybuka wrote:<br>
<br>
> Yes, looks like both LLVM servers are down <a href="https://lab.llvm.org/" rel="noreferrer" target="_blank">https://lab.llvm.org/</a><br>
> FYI The special about that staging bot is that it is Ubuntu with recent<br>
> glibc 2.34. Our primary bot runs exactly the same build on Debian with<br>
> glibc 2.28 and the test passes there. It can be glibc or other dependencies.<br>
<br>
I tried to reproduce it on my machine, but I it uses Debian (not Ubuntu), so the issue did not reproduce.<br>
With that patch, we started embedding build id (a unique identifier) into llvm profiles.<br>
That test basically enables build id in the binary by using `-Wl,--build-id -O2` option.<br>
It then generates a llvm profile, and tries to read embedded build id from the profile.<br>
What is the output of the following command?<br>
<br>
  /b/sanitizer-x86_64-linux/build/llvm_build64/bin/clang   -m64  -ldl  -fprofile-instr-generate -Wl,--build-id -O2 -o /b/sanitizer-x86_64-linux/build/compiler_rt_build/test/profile/Profile-x86_64/Linux/Output/binary-id.c.tmp /b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/profile/Linux/binary-id.c<br>
  readelf -n /b/sanitizer-x86_64-linux/build/compiler_rt_build/test/profile/Profile-x86_64/Linux/Output/binary-id.c.tmp <br>
<br>
If we have build id in the binary, `readelf` (you can also use `llvm-readelf` instead) should have some output like that:<br>
<br>
  Displaying notes found in: .note.gnu.build-id<br>
    Owner                Data size        Description<br>
    GNU                  0x00000014       NT_GNU_BUILD_ID (unique build ID bitstring)<br>
      Build ID: 8699f6e0c4e12b872aae7e1f37fa6ba2564e9702<br>
<br>
If we have build id in the binary, we should then check whether build id is embedded in the profile:<br>
<br>
  env LLVM_PROFILE_FILE=/b/sanitizer-x86_64-linux/build/compiler_rt_build/test/profile/Profile-x86_64/Linux/Output/binary-id.c.tmp.profraw  /b/sanitizer-x86_64-linux/build/compiler_rt_build/test/profile/Profile-x86_64/Linux/Output/binary-id.c.tmp<br>
  llvm-profdata show --binary-ids  /b/sanitizer-x86_64-linux/build/compiler_rt_build/test/profile/Profile-x86_64/Linux/Output/binary-id.c.tmp.profraw <br>
<br>
What is the output of the above command?<br>
<br>
<br>
Repository:<br>
  rG LLVM Github Monorepo<br>
<br>
CHANGES SINCE LAST ACTION<br>
  <a href="https://reviews.llvm.org/D102039/new/" rel="noreferrer" target="_blank">https://reviews.llvm.org/D102039/new/</a><br>
<br>
<a href="https://reviews.llvm.org/D102039" rel="noreferrer" target="_blank">https://reviews.llvm.org/D102039</a><br>
<br>
</blockquote></div>