-
Notifications
You must be signed in to change notification settings - Fork 12.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[profile] Add binary id into profiles
This patch adds binary id into profiles to easily associate binaries with the corresponding profiles. There is an RFC that discusses the motivation, design and implementation in more detail: https://lists.llvm.org/pipermail/llvm-dev/2021-June/151154.html Differential Revision: https://reviews.llvm.org/D102039
- Loading branch information
1 parent
120b187
commit e50a388
Showing
23 changed files
with
256 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// REQUIRES: linux | ||
// RUN: %clang_profgen -Wl,--build-id=none -O2 -o %t %s | ||
// RUN: env LLVM_PROFILE_FILE=%t.profraw %run %t | ||
// RUN: llvm-profdata show --binary-ids %t.profraw > %t.out | ||
// RUN: FileCheck %s --check-prefix=NO-BINARY-ID < %t.out | ||
// RUN: llvm-profdata merge -o %t.profdata %t.profraw | ||
|
||
// RUN: %clang_profgen -Wl,--build-id -O2 -o %t %s | ||
// RUN: env LLVM_PROFILE_FILE=%t.profraw %run %t | ||
// RUN: llvm-profdata show --binary-ids %t.profraw > %t.profraw.out | ||
// RUN: FileCheck %s --check-prefix=BINARY-ID-RAW-PROF < %t.profraw.out | ||
|
||
void foo() { | ||
} | ||
|
||
void bar() { | ||
} | ||
|
||
int main() { | ||
foo(); | ||
bar(); | ||
return 0; | ||
} | ||
|
||
// NO-BINARY-ID: Instrumentation level: Front-end | ||
// NO-BINARY-ID-NEXT: Total functions: 3 | ||
// NO-BINARY-ID-NEXT: Maximum function count: 1 | ||
// NO-BINARY-ID-NEXT: Maximum internal block count: 0 | ||
// NO-BINARY-ID-NOT: Binary IDs: | ||
|
||
// BINARY-ID-RAW-PROF: Instrumentation level: Front-end | ||
// BINARY-ID-RAW-PROF-NEXT: Total functions: 3 | ||
// BINARY-ID-RAW-PROF-NEXT: Maximum function count: 1 | ||
// BINARY-ID-RAW-PROF-NEXT: Maximum internal block count: 0 | ||
// BINARY-ID-RAW-PROF-NEXT: Binary IDs: | ||
// BINARY-ID-RAW-PROF-NEXT: {{[0-9a-f]+}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.