Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 5 additions & 8 deletions src/tests/tracing/eventlistener/EventListenerThreadPool.cs
Original file line number Diff line number Diff line change
Expand Up @@ -103,15 +103,12 @@ public static int TestEntryPoint()

WaitHandle.WaitAll(waitEvents, TimeSpan.FromMinutes(1));

if (!TestLibrary.Utilities.IsNativeAot)
listener.TPWaitWorkerThreadEvent.WaitOne(TimeSpan.FromMinutes(1));
if (listener.TPWorkerThreadWaitCount == 0)
{
listener.TPWaitWorkerThreadEvent.WaitOne(TimeSpan.FromMinutes(1));
if (listener.TPWorkerThreadWaitCount == 0)
{
Console.WriteLine("Test Failed: Did not see the expected event.");
Console.WriteLine($"ThreadPoolWorkerThreadWaitCount: {listener.TPWorkerThreadWaitCount}");
return -1;
}
Console.WriteLine("Test Failed: Did not see the expected event.");
Console.WriteLine($"ThreadPoolWorkerThreadWaitCount: {listener.TPWorkerThreadWaitCount}");
return -1;
}

if (!(listener.TPIOPack >= listener.TPIOPackGoal &&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
<!-- Tracing tests routinely time out with jitstress and gcstress -->
<GCStressIncompatible>true</GCStressIncompatible>
<JitOptimizationSensitive>true</JitOptimizationSensitive>
<!-- We expect to see events from the portable threadpool, AOT defaults to Windows threadpool -->
<UseWindowsThreadPool Condition="'$(TestBuildMode)' == 'nativeaot'">false</UseWindowsThreadPool>
</PropertyGroup>
<ItemGroup>
<Compile Include="EventListenerThreadPool.cs" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,22 +22,16 @@ public static int TestEntryPoint()
new EventPipeProvider("Microsoft-Windows-DotNETRuntime", EventLevel.Warning, 0b1000_0000_0000_0000)
};

bool enableRundown = TestLibrary.Utilities.IsNativeAot? false: true;
Dictionary<string, ExpectedEventCount> _expectedEventCounts = TestLibrary.Utilities.IsNativeAot? _expectedEventCountsNativeAOT: _expectedEventCountsCoreCLR;

return IpcTraceTest.RunAndValidateEventCounts(_expectedEventCounts, _eventGeneratingAction, providers, 1024, enableRundownProvider:enableRundown);
return IpcTraceTest.RunAndValidateEventCounts(_expectedEventCounts, _eventGeneratingAction, providers, 1024);
}

private static Dictionary<string, ExpectedEventCount> _expectedEventCountsCoreCLR = new Dictionary<string, ExpectedEventCount>()
private static Dictionary<string, ExpectedEventCount> _expectedEventCounts = new Dictionary<string, ExpectedEventCount>()
{
{ "Microsoft-Windows-DotNETRuntime", new ExpectedEventCount(1000, 0.2f) },
{ "Microsoft-Windows-DotNETRuntimeRundown", -1 },
{ "Microsoft-DotNETCore-SampleProfiler", -1 }
};
private static Dictionary<string, ExpectedEventCount> _expectedEventCountsNativeAOT = new Dictionary<string, ExpectedEventCount>()
{
{ "Microsoft-Windows-DotNETRuntime", new ExpectedEventCount(1000, 0.2f) }
};

private static Action _eventGeneratingAction = () =>
{
for (int i = 0; i < 1000; i++)
Expand Down
13 changes: 2 additions & 11 deletions src/tests/tracing/eventpipe/eventsvalidation/GCEvents.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,25 +23,16 @@ public static int TestEntryPoint()
new EventPipeProvider("Microsoft-Windows-DotNETRuntime", EventLevel.Informational, 0b1)
};

bool enableRundown = TestLibrary.Utilities.IsNativeAot? false: true;
Dictionary<string, ExpectedEventCount> _expectedEventCounts = TestLibrary.Utilities.IsNativeAot? _expectedEventCountsNativeAOT: _expectedEventCountsCoreCLR;

return IpcTraceTest.RunAndValidateEventCounts(_expectedEventCounts, _eventGeneratingAction, providers, 1024, _DoesTraceContainEvents, enableRundownProvider:enableRundown);
return IpcTraceTest.RunAndValidateEventCounts(_expectedEventCounts, _eventGeneratingAction, providers, 1024, _DoesTraceContainEvents);
}

private static Dictionary<string, ExpectedEventCount> _expectedEventCountsCoreCLR = new Dictionary<string, ExpectedEventCount>()
private static Dictionary<string, ExpectedEventCount> _expectedEventCounts = new Dictionary<string, ExpectedEventCount>()
{
{ "Microsoft-Windows-DotNETRuntime", -1 },
{ "Microsoft-Windows-DotNETRuntimeRundown", -1 },
{ "Microsoft-DotNETCore-SampleProfiler", -1 }
};

private static Dictionary<string, ExpectedEventCount> _expectedEventCountsNativeAOT = new Dictionary<string, ExpectedEventCount>()
{
{ "Microsoft-Windows-DotNETRuntime", -1 }
};


private static Action _eventGeneratingAction = () =>
{
for (int i = 0; i < 50; i++)
Expand Down
12 changes: 2 additions & 10 deletions src/tests/tracing/eventpipe/eventsvalidation/GCFinalizers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,24 +23,16 @@ public static int TestEntryPoint()
new EventPipeProvider("Microsoft-Windows-DotNETRuntime", EventLevel.Informational, 0b1)
};

bool enableRundown = TestLibrary.Utilities.IsNativeAot? false: true;
Dictionary<string, ExpectedEventCount> _expectedEventCounts = TestLibrary.Utilities.IsNativeAot? _expectedEventCountsNativeAOT: _expectedEventCountsCoreCLR;

return IpcTraceTest.RunAndValidateEventCounts(_expectedEventCounts, _eventGeneratingAction, providers, 1024, _DoesTraceContainEvents, enableRundownProvider:enableRundown);
return IpcTraceTest.RunAndValidateEventCounts(_expectedEventCounts, _eventGeneratingAction, providers, 1024, _DoesTraceContainEvents);
}

private static Dictionary<string, ExpectedEventCount> _expectedEventCountsCoreCLR = new Dictionary<string, ExpectedEventCount>()
private static Dictionary<string, ExpectedEventCount> _expectedEventCounts = new Dictionary<string, ExpectedEventCount>()
{
{ "Microsoft-Windows-DotNETRuntime", -1 },
{ "Microsoft-Windows-DotNETRuntimeRundown", -1 },
{ "Microsoft-DotNETCore-SampleProfiler", -1 }
};

private static Dictionary<string, ExpectedEventCount> _expectedEventCountsNativeAOT = new Dictionary<string, ExpectedEventCount>()
{
{ "Microsoft-Windows-DotNETRuntime", -1 }
};

private static Action _eventGeneratingAction = () =>
{
for (int i = 0; i < 50; i++)
Expand Down
3 changes: 1 addition & 2 deletions src/tests/tracing/eventpipe/gcdump/gcdump.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,7 @@ public static int TestEntryPoint()
new EventPipeProvider("Microsoft-Windows-DotNETRuntime", eventLevel: EventLevel.Verbose, keywords: (long)ClrTraceEventParser.Keywords.GCHeapSnapshot)
};

bool enableRundown = TestLibrary.Utilities.IsNativeAot? false: true;
return IpcTraceTest.RunAndValidateEventCounts(_expectedEventCounts, _eventGeneratingAction, providers, 1024, _DoesRundownContainMethodEvents, enableRundownProvider: enableRundown);
return IpcTraceTest.RunAndValidateEventCounts(_expectedEventCounts, _eventGeneratingAction, providers, 1024, _DoesRundownContainMethodEvents);
}

private static Dictionary<string, ExpectedEventCount> _expectedEventCounts = new Dictionary<string, ExpectedEventCount>()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,29 +37,20 @@ public static int TestEntryPoint()
new EventPipeProvider("Microsoft-DotNETCore-SampleProfiler", EventLevel.Verbose)
};

bool enableRundown = TestLibrary.Utilities.IsNativeAot? false: true;

Dictionary<string, ExpectedEventCount> _expectedEventCounts = TestLibrary.Utilities.IsNativeAot? _expectedEventCountsNativeAOT: _expectedEventCountsCoreCLR;
var ret = IpcTraceTest.RunAndValidateEventCounts(_expectedEventCounts, _eventGeneratingAction, providers, 1024, enableRundownProvider: enableRundown);
var ret = IpcTraceTest.RunAndValidateEventCounts(_expectedEventCounts, _eventGeneratingAction, providers, 1024);
if (ret < 0)
return ret;
else
return 100;
}

private static Dictionary<string, ExpectedEventCount> _expectedEventCountsCoreCLR = new Dictionary<string, ExpectedEventCount>()
private static Dictionary<string, ExpectedEventCount> _expectedEventCounts = new Dictionary<string, ExpectedEventCount>()
{
{ "MyEventSource", new ExpectedEventCount(100_000, 0.30f) },
{ "Microsoft-Windows-DotNETRuntimeRundown", -1 },
{ "Microsoft-DotNETCore-SampleProfiler", -1 }
};

private static Dictionary<string, ExpectedEventCount> _expectedEventCountsNativeAOT = new Dictionary<string, ExpectedEventCount>()
{
{ "MyEventSource", 100_000 },
{ "Microsoft-DotNETCore-EventPipe", 1 }
};

private static Action _eventGeneratingAction = () =>
{
for (int i = 0; i < 100_000; i++)
Expand Down
Loading