[Profile] Add a warning when lock file failed in __llvm_profile_set_file_object with continuous mode

This commit is contained in:
Zequan Wu 2021-10-01 14:37:09 -07:00
parent 86046516e4
commit ab694cd845
1 changed files with 4 additions and 1 deletions

View File

@ -1153,7 +1153,10 @@ COMPILER_RT_VISIBILITY int __llvm_profile_set_file_object(FILE *File,
fileno(File));
return 1;
}
lprofLockFileHandle(File);
if (lprofLockFileHandle(File) != 0) {
PROF_WARN("Data may be corrupted during profile merging : %s\n",
"Fail to obtain file lock due to system limit.");
}
uint64_t ProfileFileSize = 0;
if (getProfileFileSizeForMerging(File, &ProfileFileSize) == -1) {
lprofUnlockFileHandle(File);