[PATCH] D110277: [compiler-rt][profile] Do not emit binary IDs for corrupted-profile.c test

Leonard Chan via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 22 11:53:27 PDT 2021


leonardchan created this revision.
leonardchan added reviewers: phosek, gulfem, aeubanks.
Herald added a subscriber: dberris.
leonardchan requested review of this revision.
Herald added a project: Sanitizers.
Herald added a subscriber: Sanitizers.

This test specifically checks that profiles are not mergeable if there's a change in the CounterPtr in the profile header. The test manually changes CounterPtr by explicitly calling memset on some offset into the profile file. This test would fail if binary IDs were emitted because the offset calculation does not take into account the binary ID sizes.

Rather than calculating the binary IDs sizes and updating the calculation, we can just opt for not emitting binary IDs to simplify the calculation (which wouldn't require any changes). Binary IDs in profdata is orthogonal to what this test aims to check, so it should be ok to just ignore them.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D110277

Files:
  compiler-rt/test/profile/Linux/corrupted-profile.c


Index: compiler-rt/test/profile/Linux/corrupted-profile.c
===================================================================
--- compiler-rt/test/profile/Linux/corrupted-profile.c
+++ compiler-rt/test/profile/Linux/corrupted-profile.c
@@ -1,6 +1,6 @@
 // RUN: rm -f %t.profraw
 // RUN: touch %t.profraw
-// RUN: %clang_profgen -o %t %s
+// RUN: %clang_profgen -Wl,--build-id=none -o %t %s
 // RUN: %t %t.profraw
 // RUN: %t %t.profraw modifyfile
 // RUN: cp %t.profraw %t.profraw.old


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D110277.374309.patch
Type: text/x-patch
Size: 485 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210922/0887c6ec/attachment.bin>


More information about the llvm-commits mailing list