Skip to content

Commit 0b0cab3

Browse files
committed
Fix failing test on NativeAOT
Fixes #109828 This test hadn't been updated to account for NativeAOT's lack of type names in the new randomized sampling allocation events.
1 parent 0cecd7d commit 0b0cab3

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/tests/tracing/eventpipe/randomizedallocationsampling/allocationsampling.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,11 @@ public static int TestEntryPoint()
6969
AllocationSampledData payload = new AllocationSampledData(eventData, source.PointerSize);
7070
// uncomment to see the allocation events payload
7171
//Logger.logger.Log($"{payload.AllocationKind} | ({payload.ObjectSize}) {payload.TypeName} = 0x{payload.Address}");
72-
if (payload.TypeName == "Tracing.Tests.Object128")
72+
if (payload.TypeName == "Tracing.Tests.Object128" ||
73+
(payload.TypeName == "NULL" && payload.ObjectSize == 128 + 16) ||
74+
(payload.TypeName == "NULL" && payload.ObjectSize == 128 + 8)) // NativeAOT doesn't report type names but we can use the size as a good proxy
75+
// A real profiler would resolve the TypeID from PDBs but replicating that would
76+
// make the test more complicated
7377
{
7478
Object128Count++;
7579
}

0 commit comments

Comments
 (0)