[clang] ee73d24 - [MemProf] Collect access density statistics during profiling
Teresa Johnson via cfe-commits
cfe-commits at lists.llvm.org
Thu Jan 12 17:54:06 PST 2023
Author: Teresa Johnson
Date: 2023-01-12T17:53:23-08:00
New Revision: ee73d240ab1dc026f99e7e9062c921928d2b138c
URL: https://github.com/llvm/llvm-project/commit/ee73d240ab1dc026f99e7e9062c921928d2b138c
DIFF: https://github.com/llvm/llvm-project/commit/ee73d240ab1dc026f99e7e9062c921928d2b138c.diff
LOG: [MemProf] Collect access density statistics during profiling
Track min/max/avg access density (accesses per byte and accesses per
byte per lifetime second) metrics directly during profiling. This allows
more accurate use of these metrics in profile analysis and use, instead
of trying to compute them from already aggregated data in the profile.
This required regenerating some of the raw profile and executable inputs
for a few tests. While here, make the llvm-profdata memprof tests more
resilient to differences in things like memory mapping, timestamps and
cpu ids to make future test updates easier.
Differential Revision: https://reviews.llvm.org/D141558
Added:
Modified:
clang/test/CodeGen/Inputs/memprof.exe
clang/test/CodeGen/Inputs/memprof.memprofraw
compiler-rt/include/profile/MIBEntryDef.inc
compiler-rt/include/profile/MemProfData.inc
llvm/include/llvm/ProfileData/MIBEntryDef.inc
llvm/include/llvm/ProfileData/MemProfData.inc
llvm/test/Transforms/PGOProfile/Inputs/memprof.exe
llvm/test/Transforms/PGOProfile/Inputs/memprof.memprofraw
llvm/test/tools/llvm-profdata/Inputs/basic.memprofexe
llvm/test/tools/llvm-profdata/Inputs/basic.memprofraw
llvm/test/tools/llvm-profdata/Inputs/inline.memprofexe
llvm/test/tools/llvm-profdata/Inputs/inline.memprofraw
llvm/test/tools/llvm-profdata/Inputs/multi.memprofexe
llvm/test/tools/llvm-profdata/Inputs/multi.memprofraw
llvm/test/tools/llvm-profdata/Inputs/pic.memprofexe
llvm/test/tools/llvm-profdata/Inputs/pic.memprofraw
llvm/test/tools/llvm-profdata/memprof-basic.test
llvm/test/tools/llvm-profdata/memprof-inline.test
llvm/test/tools/llvm-profdata/memprof-multi.test
Removed:
################################################################################
diff --git a/clang/test/CodeGen/Inputs/memprof.exe b/clang/test/CodeGen/Inputs/memprof.exe
index 955c0d6b0e87a..c3b28a8ed9d3d 100755
Binary files a/clang/test/CodeGen/Inputs/memprof.exe and b/clang/test/CodeGen/Inputs/memprof.exe
diff er
diff --git a/clang/test/CodeGen/Inputs/memprof.memprofraw b/clang/test/CodeGen/Inputs/memprof.memprofraw
index 07a3310c122af..7ae89bff648af 100644
Binary files a/clang/test/CodeGen/Inputs/memprof.memprofraw and b/clang/test/CodeGen/Inputs/memprof.memprofraw
diff er
diff --git a/compiler-rt/include/profile/MIBEntryDef.inc b/compiler-rt/include/profile/MIBEntryDef.inc
index f5c6f0e4924b2..794163ae10386 100644
--- a/compiler-rt/include/profile/MIBEntryDef.inc
+++ b/compiler-rt/include/profile/MIBEntryDef.inc
@@ -45,3 +45,9 @@ MIBEntryDef(NumLifetimeOverlaps = 16, NumLifetimeOverlaps, uint32_t)
MIBEntryDef(NumSameAllocCpu = 17, NumSameAllocCpu, uint32_t)
MIBEntryDef(NumSameDeallocCpu = 18, NumSameDeallocCpu, uint32_t)
MIBEntryDef(DataTypeId = 19, DataTypeId, uint64_t)
+MIBEntryDef(TotalAccessDensity = 20, TotalAccessDensity, uint64_t)
+MIBEntryDef(MinAccessDensity = 21, MinAccessDensity, uint32_t)
+MIBEntryDef(MaxAccessDensity = 22, MaxAccessDensity, uint32_t)
+MIBEntryDef(TotalLifetimeAccessDensity = 23, TotalLifetimeAccessDensity, uint64_t)
+MIBEntryDef(MinLifetimeAccessDensity = 24, MinLifetimeAccessDensity, uint32_t)
+MIBEntryDef(MaxLifetimeAccessDensity = 25, MaxLifetimeAccessDensity, uint32_t)
diff --git a/compiler-rt/include/profile/MemProfData.inc b/compiler-rt/include/profile/MemProfData.inc
index ca354ee332929..c533073da751f 100644
--- a/compiler-rt/include/profile/MemProfData.inc
+++ b/compiler-rt/include/profile/MemProfData.inc
@@ -32,7 +32,7 @@
(uint64_t)'o' << 24 | (uint64_t)'f' << 16 | (uint64_t)'r' << 8 | (uint64_t)129)
// The version number of the raw binary format.
-#define MEMPROF_RAW_VERSION 1ULL
+#define MEMPROF_RAW_VERSION 2ULL
namespace llvm {
namespace memprof {
@@ -127,6 +127,19 @@ MemInfoBlock(uint32_t Size, uint64_t AccessCount, uint32_t AllocTs,
TotalLifetime = DeallocTimestamp - AllocTimestamp;
MinLifetime = TotalLifetime;
MaxLifetime = TotalLifetime;
+ // Access density is accesses per byte. Multiply by 100 to include the
+ // fractional part.
+ TotalAccessDensity = AccessCount * 100 / Size;
+ MinAccessDensity = TotalAccessDensity;
+ MaxAccessDensity = TotalAccessDensity;
+ // Lifetime access density is the access density per second of lifetime.
+ // Multiply by 1000 to convert denominator lifetime to seconds (using a
+ // minimum lifetime of 1ms to avoid divide by 0. Do the multiplication first
+ // to reduce truncations to 0.
+ TotalLifetimeAccessDensity =
+ TotalAccessDensity * 1000 / (TotalLifetime ? TotalLifetime : 1);
+ MinLifetimeAccessDensity = TotalLifetimeAccessDensity;
+ MaxLifetimeAccessDensity = TotalLifetimeAccessDensity;
AllocCpuId = AllocCpu;
DeallocCpuId = DeallocCpu;
NumMigratedCpu = AllocCpuId != DeallocCpuId;
@@ -147,6 +160,24 @@ void Merge(const MemInfoBlock &newMIB) {
MinLifetime = newMIB.MinLifetime < MinLifetime ? newMIB.MinLifetime : MinLifetime;
MaxLifetime = newMIB.MaxLifetime > MaxLifetime ? newMIB.MaxLifetime : MaxLifetime;
+ TotalAccessDensity += newMIB.TotalAccessDensity;
+ MinAccessDensity = newMIB.MinAccessDensity < MinAccessDensity
+ ? newMIB.MinAccessDensity
+ : MinAccessDensity;
+ MaxAccessDensity = newMIB.MaxAccessDensity > MaxAccessDensity
+ ? newMIB.MaxAccessDensity
+ : MaxAccessDensity;
+
+ TotalLifetimeAccessDensity += newMIB.TotalLifetimeAccessDensity;
+ MinLifetimeAccessDensity =
+ newMIB.MinLifetimeAccessDensity < MinLifetimeAccessDensity
+ ? newMIB.MinLifetimeAccessDensity
+ : MinLifetimeAccessDensity;
+ MaxLifetimeAccessDensity =
+ newMIB.MaxLifetimeAccessDensity > MaxLifetimeAccessDensity
+ ? newMIB.MaxLifetimeAccessDensity
+ : MaxLifetimeAccessDensity;
+
// We know newMIB was deallocated later, so just need to check if it was
// allocated before last one deallocated.
NumLifetimeOverlaps += newMIB.AllocTimestamp < DeallocTimestamp;
diff --git a/llvm/include/llvm/ProfileData/MIBEntryDef.inc b/llvm/include/llvm/ProfileData/MIBEntryDef.inc
index f5c6f0e4924b2..794163ae10386 100644
--- a/llvm/include/llvm/ProfileData/MIBEntryDef.inc
+++ b/llvm/include/llvm/ProfileData/MIBEntryDef.inc
@@ -45,3 +45,9 @@ MIBEntryDef(NumLifetimeOverlaps = 16, NumLifetimeOverlaps, uint32_t)
MIBEntryDef(NumSameAllocCpu = 17, NumSameAllocCpu, uint32_t)
MIBEntryDef(NumSameDeallocCpu = 18, NumSameDeallocCpu, uint32_t)
MIBEntryDef(DataTypeId = 19, DataTypeId, uint64_t)
+MIBEntryDef(TotalAccessDensity = 20, TotalAccessDensity, uint64_t)
+MIBEntryDef(MinAccessDensity = 21, MinAccessDensity, uint32_t)
+MIBEntryDef(MaxAccessDensity = 22, MaxAccessDensity, uint32_t)
+MIBEntryDef(TotalLifetimeAccessDensity = 23, TotalLifetimeAccessDensity, uint64_t)
+MIBEntryDef(MinLifetimeAccessDensity = 24, MinLifetimeAccessDensity, uint32_t)
+MIBEntryDef(MaxLifetimeAccessDensity = 25, MaxLifetimeAccessDensity, uint32_t)
diff --git a/llvm/include/llvm/ProfileData/MemProfData.inc b/llvm/include/llvm/ProfileData/MemProfData.inc
index ca354ee332929..c533073da751f 100644
--- a/llvm/include/llvm/ProfileData/MemProfData.inc
+++ b/llvm/include/llvm/ProfileData/MemProfData.inc
@@ -32,7 +32,7 @@
(uint64_t)'o' << 24 | (uint64_t)'f' << 16 | (uint64_t)'r' << 8 | (uint64_t)129)
// The version number of the raw binary format.
-#define MEMPROF_RAW_VERSION 1ULL
+#define MEMPROF_RAW_VERSION 2ULL
namespace llvm {
namespace memprof {
@@ -127,6 +127,19 @@ MemInfoBlock(uint32_t Size, uint64_t AccessCount, uint32_t AllocTs,
TotalLifetime = DeallocTimestamp - AllocTimestamp;
MinLifetime = TotalLifetime;
MaxLifetime = TotalLifetime;
+ // Access density is accesses per byte. Multiply by 100 to include the
+ // fractional part.
+ TotalAccessDensity = AccessCount * 100 / Size;
+ MinAccessDensity = TotalAccessDensity;
+ MaxAccessDensity = TotalAccessDensity;
+ // Lifetime access density is the access density per second of lifetime.
+ // Multiply by 1000 to convert denominator lifetime to seconds (using a
+ // minimum lifetime of 1ms to avoid divide by 0. Do the multiplication first
+ // to reduce truncations to 0.
+ TotalLifetimeAccessDensity =
+ TotalAccessDensity * 1000 / (TotalLifetime ? TotalLifetime : 1);
+ MinLifetimeAccessDensity = TotalLifetimeAccessDensity;
+ MaxLifetimeAccessDensity = TotalLifetimeAccessDensity;
AllocCpuId = AllocCpu;
DeallocCpuId = DeallocCpu;
NumMigratedCpu = AllocCpuId != DeallocCpuId;
@@ -147,6 +160,24 @@ void Merge(const MemInfoBlock &newMIB) {
MinLifetime = newMIB.MinLifetime < MinLifetime ? newMIB.MinLifetime : MinLifetime;
MaxLifetime = newMIB.MaxLifetime > MaxLifetime ? newMIB.MaxLifetime : MaxLifetime;
+ TotalAccessDensity += newMIB.TotalAccessDensity;
+ MinAccessDensity = newMIB.MinAccessDensity < MinAccessDensity
+ ? newMIB.MinAccessDensity
+ : MinAccessDensity;
+ MaxAccessDensity = newMIB.MaxAccessDensity > MaxAccessDensity
+ ? newMIB.MaxAccessDensity
+ : MaxAccessDensity;
+
+ TotalLifetimeAccessDensity += newMIB.TotalLifetimeAccessDensity;
+ MinLifetimeAccessDensity =
+ newMIB.MinLifetimeAccessDensity < MinLifetimeAccessDensity
+ ? newMIB.MinLifetimeAccessDensity
+ : MinLifetimeAccessDensity;
+ MaxLifetimeAccessDensity =
+ newMIB.MaxLifetimeAccessDensity > MaxLifetimeAccessDensity
+ ? newMIB.MaxLifetimeAccessDensity
+ : MaxLifetimeAccessDensity;
+
// We know newMIB was deallocated later, so just need to check if it was
// allocated before last one deallocated.
NumLifetimeOverlaps += newMIB.AllocTimestamp < DeallocTimestamp;
diff --git a/llvm/test/Transforms/PGOProfile/Inputs/memprof.exe b/llvm/test/Transforms/PGOProfile/Inputs/memprof.exe
index b6fe0fab30001..6dd5783eb5acc 100755
Binary files a/llvm/test/Transforms/PGOProfile/Inputs/memprof.exe and b/llvm/test/Transforms/PGOProfile/Inputs/memprof.exe
diff er
diff --git a/llvm/test/Transforms/PGOProfile/Inputs/memprof.memprofraw b/llvm/test/Transforms/PGOProfile/Inputs/memprof.memprofraw
index fc638b2c51000..a5e3a517f1b32 100644
Binary files a/llvm/test/Transforms/PGOProfile/Inputs/memprof.memprofraw and b/llvm/test/Transforms/PGOProfile/Inputs/memprof.memprofraw
diff er
diff --git a/llvm/test/tools/llvm-profdata/Inputs/basic.memprofexe b/llvm/test/tools/llvm-profdata/Inputs/basic.memprofexe
index 7f89f135c9d5c..4d3e4798e4791 100755
Binary files a/llvm/test/tools/llvm-profdata/Inputs/basic.memprofexe and b/llvm/test/tools/llvm-profdata/Inputs/basic.memprofexe
diff er
diff --git a/llvm/test/tools/llvm-profdata/Inputs/basic.memprofraw b/llvm/test/tools/llvm-profdata/Inputs/basic.memprofraw
index af27be1e0a10f..88da4a76e47f0 100644
Binary files a/llvm/test/tools/llvm-profdata/Inputs/basic.memprofraw and b/llvm/test/tools/llvm-profdata/Inputs/basic.memprofraw
diff er
diff --git a/llvm/test/tools/llvm-profdata/Inputs/inline.memprofexe b/llvm/test/tools/llvm-profdata/Inputs/inline.memprofexe
index 9b6fd16e9a272..82aad1948982d 100755
Binary files a/llvm/test/tools/llvm-profdata/Inputs/inline.memprofexe and b/llvm/test/tools/llvm-profdata/Inputs/inline.memprofexe
diff er
diff --git a/llvm/test/tools/llvm-profdata/Inputs/inline.memprofraw b/llvm/test/tools/llvm-profdata/Inputs/inline.memprofraw
old mode 100644
new mode 100755
index 813ee6e47045c..f9f84e227b220
Binary files a/llvm/test/tools/llvm-profdata/Inputs/inline.memprofraw and b/llvm/test/tools/llvm-profdata/Inputs/inline.memprofraw
diff er
diff --git a/llvm/test/tools/llvm-profdata/Inputs/multi.memprofexe b/llvm/test/tools/llvm-profdata/Inputs/multi.memprofexe
index cd14838f2e3b3..507cf982993e7 100755
Binary files a/llvm/test/tools/llvm-profdata/Inputs/multi.memprofexe and b/llvm/test/tools/llvm-profdata/Inputs/multi.memprofexe
diff er
diff --git a/llvm/test/tools/llvm-profdata/Inputs/multi.memprofraw b/llvm/test/tools/llvm-profdata/Inputs/multi.memprofraw
index bf843a9f6ad55..b6b895ff96fa9 100644
Binary files a/llvm/test/tools/llvm-profdata/Inputs/multi.memprofraw and b/llvm/test/tools/llvm-profdata/Inputs/multi.memprofraw
diff er
diff --git a/llvm/test/tools/llvm-profdata/Inputs/pic.memprofexe b/llvm/test/tools/llvm-profdata/Inputs/pic.memprofexe
index e3a6e1f839ece..eb1cd9b4bb778 100755
Binary files a/llvm/test/tools/llvm-profdata/Inputs/pic.memprofexe and b/llvm/test/tools/llvm-profdata/Inputs/pic.memprofexe
diff er
diff --git a/llvm/test/tools/llvm-profdata/Inputs/pic.memprofraw b/llvm/test/tools/llvm-profdata/Inputs/pic.memprofraw
index 7057af59034cf..9b16c8f5dd0b5 100644
Binary files a/llvm/test/tools/llvm-profdata/Inputs/pic.memprofraw and b/llvm/test/tools/llvm-profdata/Inputs/pic.memprofraw
diff er
diff --git a/llvm/test/tools/llvm-profdata/memprof-basic.test b/llvm/test/tools/llvm-profdata/memprof-basic.test
index 324c7952bf0d9..a070845b5ab06 100644
--- a/llvm/test/tools/llvm-profdata/memprof-basic.test
+++ b/llvm/test/tools/llvm-profdata/memprof-basic.test
@@ -39,58 +39,20 @@ additional allocations which do not originate from the main binary are pruned.
CHECK: MemprofProfile:
CHECK-NEXT: Summary:
-CHECK-NEXT: Version: 1
-CHECK-NEXT: NumSegments: 9
+CHECK-NEXT: Version: 2
+CHECK-NEXT: NumSegments: {{[0-9]+}}
CHECK-NEXT: NumMibInfo: 2
CHECK-NEXT: NumAllocFunctions: 1
CHECK-NEXT: NumStackOffsets: 2
CHECK-NEXT: Segments:
CHECK-NEXT: -
CHECK-NEXT: BuildId: <None>
-CHECK-NEXT: Start: 0x200000
-CHECK-NEXT: End: 0x298000
-CHECK-NEXT: Offset: 0x0
+CHECK-NEXT: Start: 0x{{[0-9]+}}
+CHECK-NEXT: End: 0x{{[0-9]+}}
+CHECK-NEXT: Offset: 0x{{[0-9]+}}
CHECK-NEXT: -
-CHECK-NEXT: BuildId: <None>
-CHECK-NEXT: Start: 0x7FFFF7C7C000
-CHECK-NEXT: End: 0x7FFFF7DC5000
-CHECK-NEXT: Offset: 0x26000
-CHECK-NEXT: -
-CHECK-NEXT: BuildId: <None>
-CHECK-NEXT: Start: 0x7FFFF7E1E000
-CHECK-NEXT: End: 0x7FFFF7E30000
-CHECK-NEXT: Offset: 0x3000
-CHECK-NEXT: -
-CHECK-NEXT: BuildId: <None>
-CHECK-NEXT: Start: 0x7FFFF7E36000
-CHECK-NEXT: End: 0x7FFFF7E38000
-CHECK-NEXT: Offset: 0x1000
-CHECK-NEXT: -
-CHECK-NEXT: BuildId: <None>
-CHECK-NEXT: Start: 0x7FFFF7E4A000
-CHECK-NEXT: End: 0x7FFFF7EE5000
-CHECK-NEXT: Offset: 0xF000
-CHECK-NEXT: -
-CHECK-NEXT: BuildId: <None>
-CHECK-NEXT: Start: 0x7FFFF7F83000
-CHECK-NEXT: End: 0x7FFFF7F87000
-CHECK-NEXT: Offset: 0x3000
-CHECK-NEXT: -
-CHECK-NEXT: BuildId: <None>
-CHECK-NEXT: Start: 0x7FFFF7F92000
-CHECK-NEXT: End: 0x7FFFF7FA1000
-CHECK-NEXT: Offset: 0x7000
-CHECK-NEXT: -
-CHECK-NEXT: BuildId: <None>
-CHECK-NEXT: Start: 0x7FFFF7FD0000
-CHECK-NEXT: End: 0x7FFFF7FD2000
-CHECK-NEXT: Offset: 0x0
-CHECK-NEXT: -
-CHECK-NEXT: BuildId: <None>
-CHECK-NEXT: Start: 0x7FFFF7FD3000
-CHECK-NEXT: End: 0x7FFFF7FF3000
-CHECK-NEXT: Offset: 0x1000
-CHECK-NEXT: Records:
+
+CHECK: Records:
CHECK-NEXT: -
CHECK-NEXT: FunctionGUID: {{[0-9]+}}
CHECK-NEXT: AllocSites:
@@ -110,24 +72,30 @@ CHECK-NEXT: MaxAccessCount: 2
CHECK-NEXT: TotalSize: 10
CHECK-NEXT: MinSize: 10
CHECK-NEXT: MaxSize: 10
-CHECK-NEXT: AllocTimestamp: 986
-CHECK-NEXT: DeallocTimestamp: 986
+CHECK-NEXT: AllocTimestamp: {{[0-9]+}}
+CHECK-NEXT: DeallocTimestamp: {{[0-9]+}}
CHECK-NEXT: TotalLifetime: 0
CHECK-NEXT: MinLifetime: 0
CHECK-NEXT: MaxLifetime: 0
-CHECK-NEXT: AllocCpuId: 56
-CHECK-NEXT: DeallocCpuId: 56
+CHECK-NEXT: AllocCpuId: {{[0-9]+}}
+CHECK-NEXT: DeallocCpuId: {{[0-9]+}}
CHECK-NEXT: NumMigratedCpu: 0
CHECK-NEXT: NumLifetimeOverlaps: 0
CHECK-NEXT: NumSameAllocCpu: 0
CHECK-NEXT: NumSameDeallocCpu: 0
CHECK-NEXT: DataTypeId: {{[0-9]+}}
+CHECK-NEXT: TotalAccessDensity: 20
+CHECK-NEXT: MinAccessDensity: 20
+CHECK-NEXT: MaxAccessDensity: 20
+CHECK-NEXT: TotalLifetimeAccessDensity: 20000
+CHECK-NEXT: MinLifetimeAccessDensity: 20000
+CHECK-NEXT: MaxLifetimeAccessDensity: 20000
CHECK-NEXT: -
CHECK-NEXT: Callstack:
CHECK-NEXT: -
CHECK-NEXT: Function: {{[0-9]+}}
CHECK-NEXT: SymbolName: main
-CHECK-NEXT: LineOffset: 5
+CHECK-NEXT: LineOffset: 4
CHECK-NEXT: Column: 15
CHECK-NEXT: Inline: 0
CHECK-NEXT: MemInfoBlock:
@@ -138,15 +106,21 @@ CHECK-NEXT: MaxAccessCount: 2
CHECK-NEXT: TotalSize: 10
CHECK-NEXT: MinSize: 10
CHECK-NEXT: MaxSize: 10
-CHECK-NEXT: AllocTimestamp: 987
-CHECK-NEXT: DeallocTimestamp: 987
+CHECK-NEXT: AllocTimestamp: {{[0-9]+}}
+CHECK-NEXT: DeallocTimestamp: {{[0-9]+}}
CHECK-NEXT: TotalLifetime: 0
CHECK-NEXT: MinLifetime: 0
CHECK-NEXT: MaxLifetime: 0
-CHECK-NEXT: AllocCpuId: 56
-CHECK-NEXT: DeallocCpuId: 56
+CHECK-NEXT: AllocCpuId: {{[0-9]+}}
+CHECK-NEXT: DeallocCpuId: {{[0-9]+}}
CHECK-NEXT: NumMigratedCpu: 0
CHECK-NEXT: NumLifetimeOverlaps: 0
CHECK-NEXT: NumSameAllocCpu: 0
CHECK-NEXT: NumSameDeallocCpu: 0
CHECK-NEXT: DataTypeId: {{[0-9]+}}
+CHECK-NEXT: TotalAccessDensity: 20
+CHECK-NEXT: MinAccessDensity: 20
+CHECK-NEXT: MaxAccessDensity: 20
+CHECK-NEXT: TotalLifetimeAccessDensity: 20000
+CHECK-NEXT: MinLifetimeAccessDensity: 20000
+CHECK-NEXT: MaxLifetimeAccessDensity: 20000
diff --git a/llvm/test/tools/llvm-profdata/memprof-inline.test b/llvm/test/tools/llvm-profdata/memprof-inline.test
index 88c56a97b44d1..87eaa8364d308 100644
--- a/llvm/test/tools/llvm-profdata/memprof-inline.test
+++ b/llvm/test/tools/llvm-profdata/memprof-inline.test
@@ -40,58 +40,20 @@ RUN: llvm-profdata show --memory %p/Inputs/inline.memprofraw --profiled-binary %
CHECK: MemprofProfile:
CHECK-NEXT: Summary:
-CHECK-NEXT: Version: 1
-CHECK-NEXT: NumSegments: 9
+CHECK-NEXT: Version: 2
+CHECK-NEXT: NumSegments: {{[0-9]+}}
CHECK-NEXT: NumMibInfo: 2
CHECK-NEXT: NumAllocFunctions: 2
CHECK-NEXT: NumStackOffsets: 1
CHECK-NEXT: Segments:
CHECK-NEXT: -
CHECK-NEXT: BuildId: <None>
-CHECK-NEXT: Start: 0x200000
-CHECK-NEXT: End: 0x29B000
-CHECK-NEXT: Offset: 0x0
+CHECK-NEXT: Start: 0x{{[0-9]+}}
+CHECK-NEXT: End: 0x{{[0-9]+}}
+CHECK-NEXT: Offset: 0x{{[0-9]+}}
CHECK-NEXT: -
-CHECK-NEXT: BuildId: <None>
-CHECK-NEXT: Start: 0x7F5871485000
-CHECK-NEXT: End: 0x7F58715CD000
-CHECK-NEXT: Offset: 0x26000
-CHECK-NEXT: -
-CHECK-NEXT: BuildId: <None>
-CHECK-NEXT: Start: 0x7F587162D000
-CHECK-NEXT: End: 0x7F587163F000
-CHECK-NEXT: Offset: 0x3000
-CHECK-NEXT: -
-CHECK-NEXT: BuildId: <None>
-CHECK-NEXT: Start: 0x7F5871646000
-CHECK-NEXT: End: 0x7F5871648000
-CHECK-NEXT: Offset: 0x2000
-CHECK-NEXT: -
-CHECK-NEXT: BuildId: <None>
-CHECK-NEXT: Start: 0x7F587165A000
-CHECK-NEXT: End: 0x7F58716F4000
-CHECK-NEXT: Offset: 0xF000
-CHECK-NEXT: -
-CHECK-NEXT: BuildId: <None>
-CHECK-NEXT: Start: 0x7F5871791000
-CHECK-NEXT: End: 0x7F5871795000
-CHECK-NEXT: Offset: 0x3000
-CHECK-NEXT: -
-CHECK-NEXT: BuildId: <None>
-CHECK-NEXT: Start: 0x7F58717A0000
-CHECK-NEXT: End: 0x7F58717AF000
-CHECK-NEXT: Offset: 0x7000
-CHECK-NEXT: -
-CHECK-NEXT: BuildId: <None>
-CHECK-NEXT: Start: 0x7F58717D6000
-CHECK-NEXT: End: 0x7F58717FA000
-CHECK-NEXT: Offset: 0x1000
-CHECK-NEXT: -
-CHECK-NEXT: BuildId: <None>
-CHECK-NEXT: Start: 0x7FFFC77BD000
-CHECK-NEXT: End: 0x7FFFC77BF000
-CHECK-NEXT: Offset: 0x0
-CHECK-NEXT: Records:
+
+CHECK: Records:
CHECK-NEXT: -
CHECK-NEXT: FunctionGUID: 15505678318020221912
CHECK-NEXT: AllocSites:
@@ -129,18 +91,24 @@ CHECK-NEXT: MaxAccessCount: 1
CHECK-NEXT: TotalSize: 1
CHECK-NEXT: MinSize: 1
CHECK-NEXT: MaxSize: 1
-CHECK-NEXT: AllocTimestamp: 894
-CHECK-NEXT: DeallocTimestamp: 894
+CHECK-NEXT: AllocTimestamp: {{[0-9]+}}
+CHECK-NEXT: DeallocTimestamp: {{[0-9]+}}
CHECK-NEXT: TotalLifetime: 0
CHECK-NEXT: MinLifetime: 0
CHECK-NEXT: MaxLifetime: 0
-CHECK-NEXT: AllocCpuId: 23
-CHECK-NEXT: DeallocCpuId: 23
+CHECK-NEXT: AllocCpuId: {{[0-9]+}}
+CHECK-NEXT: DeallocCpuId: {{[0-9]+}}
CHECK-NEXT: NumMigratedCpu: 0
CHECK-NEXT: NumLifetimeOverlaps: 0
CHECK-NEXT: NumSameAllocCpu: 0
CHECK-NEXT: NumSameDeallocCpu: 0
CHECK-NEXT: DataTypeId: {{[0-9]+}}
+CHECK-NEXT: TotalAccessDensity: 100
+CHECK-NEXT: MinAccessDensity: 100
+CHECK-NEXT: MaxAccessDensity: 100
+CHECK-NEXT: TotalLifetimeAccessDensity: 100000
+CHECK-NEXT: MinLifetimeAccessDensity: 100000
+CHECK-NEXT: MaxLifetimeAccessDensity: 100000
CHECK-NEXT: -
CHECK-NEXT: FunctionGUID: 6699318081062747564
CHECK-NEXT: AllocSites:
@@ -178,18 +146,24 @@ CHECK-NEXT: MaxAccessCount: 1
CHECK-NEXT: TotalSize: 1
CHECK-NEXT: MinSize: 1
CHECK-NEXT: MaxSize: 1
-CHECK-NEXT: AllocTimestamp: 894
-CHECK-NEXT: DeallocTimestamp: 894
+CHECK-NEXT: AllocTimestamp: {{[0-9]+}}
+CHECK-NEXT: DeallocTimestamp: {{[0-9]+}}
CHECK-NEXT: TotalLifetime: 0
CHECK-NEXT: MinLifetime: 0
CHECK-NEXT: MaxLifetime: 0
-CHECK-NEXT: AllocCpuId: 23
-CHECK-NEXT: DeallocCpuId: 23
+CHECK-NEXT: AllocCpuId: {{[0-9]+}}
+CHECK-NEXT: DeallocCpuId: {{[0-9]+}}
CHECK-NEXT: NumMigratedCpu: 0
CHECK-NEXT: NumLifetimeOverlaps: 0
CHECK-NEXT: NumSameAllocCpu: 0
CHECK-NEXT: NumSameDeallocCpu: 0
CHECK-NEXT: DataTypeId: {{[0-9]+}}
+CHECK-NEXT: TotalAccessDensity: 100
+CHECK-NEXT: MinAccessDensity: 100
+CHECK-NEXT: MaxAccessDensity: 100
+CHECK-NEXT: TotalLifetimeAccessDensity: 100000
+CHECK-NEXT: MinLifetimeAccessDensity: 100000
+CHECK-NEXT: MaxLifetimeAccessDensity: 100000
CHECK-NEXT: CallSites:
CHECK-NEXT: -
CHECK-NEXT: -
diff --git a/llvm/test/tools/llvm-profdata/memprof-multi.test b/llvm/test/tools/llvm-profdata/memprof-multi.test
index 9140d4dd887dc..cb5b7dfaeb0a7 100644
--- a/llvm/test/tools/llvm-profdata/memprof-multi.test
+++ b/llvm/test/tools/llvm-profdata/memprof-multi.test
@@ -40,8 +40,8 @@ We expect 2 MIB entries, 1 each for the malloc calls in the program.
CHECK: MemprofProfile:
CHECK-NEXT: Summary:
-CHECK-NEXT: Version: 1
-CHECK-NEXT: NumSegments: 9
+CHECK-NEXT: Version: 2
+CHECK-NEXT: NumSegments: {{[0-9]+}}
CHECK-NEXT: NumMibInfo: 2
CHECK-NEXT: NumAllocFunctions: 1
CHECK-NEXT: NumStackOffsets: 2
More information about the cfe-commits
mailing list