Skip to content

Commit a77a739

Browse files
committed
[profile] Suppress spurious 'expected profile to require unlock' warning
In %c (continuous sync) mode, avoid attempting to unlock an already-unlocked profile. The profile is only locked when profile merging is enabled.
1 parent 5b3bf8b commit a77a739

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

compiler-rt/lib/profile/InstrProfilingFile.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -668,7 +668,8 @@ static void initializeProfileForContinuousMode(void) {
668668
FileOffsetToCounters);
669669
}
670670

671-
unlockProfile(&ProfileRequiresUnlock, File);
671+
if (ProfileRequiresUnlock)
672+
unlockProfile(&ProfileRequiresUnlock, File);
672673
#endif // defined(__Fuchsia__) || defined(_WIN32)
673674
}
674675

compiler-rt/test/profile/ContinuousSyncMode/multiple-DSOs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
// RUN: %clang_pgogen -dynamiclib -o %t.dso1.dylib %t.dso1.c
66
// RUN: %clang_pgogen -dynamiclib -o %t.dso2.dylib %t.dso2.c
77
// RUN: %clang_pgogen -o %t.exe %s %t.dso1.dylib %t.dso2.dylib
8-
// RUN: env LLVM_PROFILE_FILE="%c%t.profraw" %run %t.exe
8+
// RUN: env LLVM_PROFILE_FILE="%c%t.profraw" %run %t.exe 2>&1 | count 0
99
// RUN: llvm-profdata show --counts --all-functions %t.profraw | FileCheck %s
1010

1111
// CHECK-LABEL: Counters:

0 commit comments

Comments
 (0)