Skip to content

Commit e33be4d

Browse files
authored
Fix failing test on NativeAOT (#109853)
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 bf8ddd3 commit e33be4d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,10 @@ 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)) // NativeAOT doesn't report type names but we can use the size as a good proxy
74+
// A real profiler would resolve the TypeID from PDBs but replicating that would
75+
// make the test more complicated
7376
{
7477
Object128Count++;
7578
}

0 commit comments

Comments
 (0)