[compiler-rt] d442bf0 - mmapForContinuousMode: Calculate FileOffsetToBitmap from FileOffsetToCounters. NFC.

NAKAMURA Takumi via llvm-commits llvm-commits at lists.llvm.org
Sun Jun 16 05:58:25 PDT 2024


Author: NAKAMURA Takumi
Date: 2024-06-16T21:57:31+09:00
New Revision: d442bf043537fd4bc0c2fc5a4d77337b0d482ea9

URL: https://github.com/llvm/llvm-project/commit/d442bf043537fd4bc0c2fc5a4d77337b0d482ea9
DIFF: https://github.com/llvm/llvm-project/commit/d442bf043537fd4bc0c2fc5a4d77337b0d482ea9.diff

LOG: mmapForContinuousMode: Calculate FileOffsetToBitmap from FileOffsetToCounters. NFC.

Added: 
    

Modified: 
    compiler-rt/lib/profile/InstrProfilingFile.c

Removed: 
    


################################################################################
diff  --git a/compiler-rt/lib/profile/InstrProfilingFile.c b/compiler-rt/lib/profile/InstrProfilingFile.c
index 5960ac56c311a..b88e0b4b0b2ab 100644
--- a/compiler-rt/lib/profile/InstrProfilingFile.c
+++ b/compiler-rt/lib/profile/InstrProfilingFile.c
@@ -177,8 +177,7 @@ static int mmapForContinuousMode(uint64_t CurrentFileOffset, FILE *File) {
   uint64_t PageAlignedBitmapLength =
       NumBitmapBytes + PaddingBytesAfterBitmapBytes;
   uint64_t FileOffsetToBitmap =
-      CurrentFileOffset + sizeof(__llvm_profile_header) + DataSize +
-      PaddingBytesBeforeCounters + CountersSize + PaddingBytesAfterCounters;
+      FileOffsetToCounters + CountersSize + PaddingBytesAfterCounters;
   void *BitmapMmap =
       mmap((void *)BitmapBegin, PageAlignedBitmapLength, PROT_READ | PROT_WRITE,
            MAP_FIXED | MAP_SHARED, Fileno, FileOffsetToBitmap);


        


More information about the llvm-commits mailing list