Skip to content

Commit

Permalink
Fix failing test on NativeAOT
Browse files Browse the repository at this point in the history
Fixes dotnet#109828
This test hadn't been updated to account for NativeAOT's lack of type names in the new randomized sampling allocation events.
  • Loading branch information
noahfalk committed Nov 17, 2024
1 parent 0cecd7d commit a614c2b
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,10 @@ public static int TestEntryPoint()
AllocationSampledData payload = new AllocationSampledData(eventData, source.PointerSize);
// uncomment to see the allocation events payload
//Logger.logger.Log($"{payload.AllocationKind} | ({payload.ObjectSize}) {payload.TypeName} = 0x{payload.Address}");
if (payload.TypeName == "Tracing.Tests.Object128")
if (payload.TypeName == "Tracing.Tests.Object128" ||
(payload.TypeName == "NULL" && payload.ObjectSize >= 128)) // NativeAOT doesn't report type names but we can use the size as a good proxy
// A real profiler would resolve the TypeID from PDBs but replicating that would
// make the test more complicated
{
Object128Count++;
}
Expand Down

0 comments on commit a614c2b

Please sign in to comment.