Skip to content

Checking CI build for segmenting diagnostics eventpipe tests for Android #65489

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 20 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
d9784c7
[tests][eventpipe] Port over Dotnet/Diagnostics files for mobile even…
mdh1418 Jan 26, 2022
18afe52
[tests][eventpipe] Add TCP/IP logic for mobile eventpipe tests
mdh1418 Feb 1, 2022
ddca4c8
[tests] Remove Microsoft.Diagnostics.NETCore.Client package reference
mdh1418 Feb 19, 2022
ae08d90
[tests][eventpipe] Downstream Diagnostics IpcTraceTest DiagnosticsCli…
mdh1418 Feb 19, 2022
cbeb96c
[tests][eventpipe] Downstream Diagnostics roslyn analyzer IpcTraceTes…
mdh1418 Feb 19, 2022
4d6ac95
[tests][eventpipe] Enable TCPIP DiagnosticsClient in IpcTraceTest for…
mdh1418 Feb 19, 2022
3db9749
[tests][eventpipe] Aesthetic IpcTraceTest modifications
mdh1418 Feb 19, 2022
b5c03cf
[tests][eventpipe] Disable subprocesses tests on Android
mdh1418 Feb 17, 2022
296eb88
[tests][eventpipe] Update processinfo
Dec 3, 2021
91bfd24
[tests][eventpipe] Update processinfo2
Dec 3, 2021
508821b
[tests][eventpipe] Update eventsourceerror
mdh1418 Feb 18, 2022
f26a190
[tests][eventpipe] Update bigevent
mdh1418 Feb 18, 2022
65772d1
[tests][eventpipe] Update buffersize
mdh1418 Feb 18, 2022
dfdb581
[tests][eventpipe] Update rundownvalidation
mdh1418 Feb 18, 2022
6c950a8
[tests][eventpipe] Update providervalidation
mdh1418 Feb 18, 2022
f194e56
[tests][eventpipe] Update gcdump
mdh1418 Feb 18, 2022
b029bad
[tests][JIT] Update debuginfo/tester
mdh1418 Feb 18, 2022
94ebb0f
[tests] Segment Microsoft.Diagnostics.NETCore.Client relevant tests f…
mdh1418 Feb 20, 2022
268bf7d
Try to get linux arm coreclr lanes passing
mdh1418 Feb 22, 2022
f79d194
wip
mdh1418 Feb 22, 2022
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
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Diagnostics.Tools.RuntimeClient" Version="$(MicrosoftDiagnosticsToolsRuntimeClientVersion)" />
<PackageReference Include="Microsoft.Diagnostics.NETCore.Client" Version="$(MicrosoftDiagnosticsNETCoreClientVersion)" />
</ItemGroup>

<Target Name="Build" DependsOnTargets="$(TraversalBuildDependsOn)" />
Expand Down
1 change: 1 addition & 0 deletions src/tests/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@

<TestBuildMode Condition="'$(__TestBuildMode)' != ''">$(__TestBuildMode)</TestBuildMode>
<RuntimeFlavor Condition="'$(__RuntimeFlavor)' != ''">$(__RuntimeFlavor)</RuntimeFlavor>
<RuntimeFlavor Condition="'$(RuntimeFlavor)' == ''">coreclr</RuntimeFlavor>

<RestoreDefaultOptimizationDataPackage Condition="'$(RestoreDefaultOptimizationDataPackage)' == ''">false</RestoreDefaultOptimizationDataPackage>
<PortableBuild Condition="'$(PortableBuild)' == ''">true</PortableBuild>
Expand Down
21 changes: 21 additions & 0 deletions src/tests/JIT/Directed/debugging/debuginfo/tester.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
#if UPDATED_NETCORE_CLIENT
using Microsoft.Diagnostics.NETCore.Client;
#else
using Microsoft.Diagnostics.Tools.RuntimeClient;
#endif
using Microsoft.Diagnostics.Tracing;
using Microsoft.Diagnostics.Tracing.Parsers;
using Microsoft.Diagnostics.Tracing.Parsers.Clr;
Expand All @@ -23,6 +27,22 @@ public static unsafe int Main()
var keywords =
ClrTraceEventParser.Keywords.Jit | ClrTraceEventParser.Keywords.JittedMethodILToNativeMap;

#if UPDATED_NETCORE_CLIENT
Console.WriteLine($"NONLEGACY NETCORE.CLIENT");
var dotnetRuntimeProvider = new List<EventPipeProvider>
{
new EventPipeProvider("Microsoft-Windows-DotNETRuntime", eventLevel: EventLevel.Verbose, keywords: (long)keywords)
};

return
IpcTraceTest.RunAndValidateEventCounts(
new Dictionary<string, ExpectedEventCount>(),
JitMethods,
dotnetRuntimeProvider,
1024,
ValidateMappings);
#else
Console.WriteLine($"LEGACY TOOLS.RUNTIMECLIENT");
var dotnetRuntimeProvider = new List<Provider>
{
new Provider("Microsoft-Windows-DotNETRuntime", eventLevel: EventLevel.Verbose, keywords: (ulong)keywords)
Expand All @@ -36,6 +56,7 @@ public static unsafe int Main()
JitMethods,
config,
ValidateMappings);
#endif
}

private static void JitMethods()
Expand Down
7 changes: 7 additions & 0 deletions src/tests/JIT/Directed/debugging/debuginfo/tester.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,18 @@
<UnloadabilityIncompatible>true</UnloadabilityIncompatible>
<GCStressIncompatible>true</GCStressIncompatible>
</PropertyGroup>
<PropertyGroup>
<!-- On Linux arm coreclr, the updated tracing/eventpipe/common/Microsoft.Diagnostics.NETCore.Client/Microsoft.Diagnostics.NETCore.Client.csproj project
does not yet work for several eventpipe runtime tests. We segment those tests with the following property and symbol -->
<UseUpdatedNETCoreClient Condition="!('$(TargetOS)' == 'Linux' And '$(TargetArchitecture)' == 'arm' And '$(RuntimeFlavor)' == 'coreclr')">true</UseUpdatedNETCoreClient>
<DefineConstants Condition="'$(UseUpdatedNETCoreClient)' == 'true'">$(DefineConstants);UPDATED_NETCORE_CLIENT</DefineConstants>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="tests_d.ilproj" Aliases="tests_d" />
<ProjectReference Include="tests_r.ilproj" Aliases="tests_r" />
<ProjectReference Include="attribute.csproj" />
<ProjectReference Include="../../../../tracing/eventpipe/common/common.csproj" />
<ProjectReference Condition="'$(UseUpdatedNETCoreClient)' == 'true'" Include="../../../../tracing/eventpipe/common/Microsoft.Diagnostics.NETCore.Client/Microsoft.Diagnostics.NETCore.Client.csproj" />
<Compile Include="$(MSBuildProjectName).cs" />
</ItemGroup>
</Project>
18 changes: 15 additions & 3 deletions src/tests/issues.targets
Original file line number Diff line number Diff line change
Expand Up @@ -3622,9 +3622,6 @@
<ExcludeList Include = "$(XunitTestBinBase)/tracing/eventpipe/complus_config/name_config_with_pid/**">
<Issue>https://github.com/dotnet/runtime/issues/54974</Issue>
</ExcludeList>
<ExcludeList Include = "$(XunitTestBinBase)/tracing/eventpipe/**">
<Issue>Need to update with Microsoft.Diagnostics.NETCore.Client port https://github.com/dotnet/runtime/pull/64358</Issue>
</ExcludeList>
<ExcludeList Include = "$(XunitTestBinBase)/Interop/UnmanagedCallConv/UnmanagedCallConvTest/**">
<Issue>https://github.com/dotnet/runtime/issues/53077</Issue>
</ExcludeList>
Expand All @@ -3637,6 +3634,21 @@
<ExcludeList Include = "$(XunitTestBinBase)/JIT/Regression/JitBlue/DevDiv_461649/DevDiv_461649/**">
<Issue>https://github.com/dotnet/runtime/issues/53353</Issue>
</ExcludeList>
<ExcludeList Include = "$(XunitTestBinBase)/tracing/eventpipe/diagnosticport/**">
<Issue>Cannot run multiple apps on Android for subprocesses</Issue>
</ExcludeList>
<ExcludeList Include = "$(XunitTestBinBase)/tracing/eventpipe/pauseonstart/**">
<Issue>Cannot run multiple apps on Android for subprocesses</Issue>
</ExcludeList>
<ExcludeList Include = "$(XunitTestBinBase)/tracing/eventpipe/processenvironment/**">
<Issue>Cannot run multiple apps on Android for subprocesses</Issue>
</ExcludeList>
<ExcludeList Include = "$(XunitTestBinBase)/tracing/eventpipe/reverse/**">
<Issue>Cannot run multiple apps on Android for subprocesses</Issue>
</ExcludeList>
<ExcludeList Include = "$(XunitTestBinBase)/tracing/eventpipe/reverseouter/**">
<Issue>Cannot run multiple apps on Android for subprocesses</Issue>
</ExcludeList>
</ItemGroup>

<ItemGroup Condition=" $(TargetOS) == 'Android' And '$(TargetArchitecture)' == 'arm64' " >
Expand Down
1 change: 1 addition & 0 deletions src/tests/profiler/common/profiler_common.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@
<Compile Include="DiagnosticsIPCWorkaround.cs" />
<ProjectReference Include="$(TestSourceDir)Common/CoreCLRTestLibrary/CoreCLRTestLibrary.csproj" />
<ProjectReference Include="$(TestSourceDir)tracing/eventpipe/common/common.csproj" />
<ProjectReference Include="$(TestSourceDir)tracing/eventpipe/common/Microsoft.Diagnostics.NETCore.Client/Microsoft.Diagnostics.NETCore.Client.csproj" />
</ItemGroup>
</Project>
1 change: 1 addition & 0 deletions src/tests/profiler/eventpipe/eventpipe.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,6 @@
<ProjectReference Include="$(TestSourceDir)Common/CoreCLRTestLibrary/CoreCLRTestLibrary.csproj" />
<ProjectReference Include="../common/profiler_common.csproj" />
<ProjectReference Include="$(MSBuildThisFileDirectory)/../native/CMakeLists.txt" />
<ProjectReference Include="$(TestSourceDir)tracing/eventpipe/common/Microsoft.Diagnostics.NETCore.Client/Microsoft.Diagnostics.NETCore.Client.csproj" />
</ItemGroup>
</Project>
1 change: 1 addition & 0 deletions src/tests/profiler/eventpipe/reverse_startup.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,6 @@
<ProjectReference Include="../common/profiler_common.csproj" />
<ProjectReference Include="$(TestSourceDir)tracing/eventpipe/common/common.csproj" />
<ProjectReference Include="$(MSBuildThisFileDirectory)/../native/CMakeLists.txt" />
<ProjectReference Include="$(TestSourceDir)tracing/eventpipe/common/Microsoft.Diagnostics.NETCore.Client/Microsoft.Diagnostics.NETCore.Client.csproj" />
</ItemGroup>
</Project>
25 changes: 20 additions & 5 deletions src/tests/tracing/eventpipe/bigevent/bigevent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,14 @@
using System.Threading;
using System.Threading.Tasks;
using System.Collections.Generic;
using Microsoft.Diagnostics.Tools.RuntimeClient;
using Microsoft.Diagnostics.Tracing;
using Tracing.Tests.Common;
using Microsoft.Diagnostics.Tracing.Parsers.Clr;
#if (UPDATED_NETCORE_CLIENT == true)
using Microsoft.Diagnostics.NETCore.Client;
#else
using Microsoft.Diagnostics.Tools.RuntimeClient;
#endif

namespace Tracing.Tests.BigEventsValidation
{
Expand All @@ -26,10 +30,10 @@ private BigEventSource()
}

public static BigEventSource Log = new BigEventSource();

public void BigEvent()
{
WriteEvent(1, bigString);
WriteEvent(1, bigString);
}

public void SmallEvent()
Expand All @@ -38,28 +42,39 @@ public void SmallEvent()
}
}


public class BigEventsValidation
{
public static int Main(string[] args)
{
// This test tries to send a big event (>100KB) and checks that the app does not crash
// See https://github.com/dotnet/runtime/issues/50515 for the regression issue
#if (UPDATED_NETCORE_CLIENT == true)
Console.WriteLine($"NONLEGACY NETCORE.CLIENT");
var providers = new List<EventPipeProvider>()
{
new EventPipeProvider("BigEventSource", EventLevel.Verbose)
};

return IpcTraceTest.RunAndValidateEventCounts(_expectedEventCounts, _eventGeneratingAction, providers, 1024, _Verify);
#else
Console.WriteLine($"LEGACY TOOLS.RUNTIMECLIENT");
var providers = new List<Provider>()
{
new Provider("BigEventSource")
};

var configuration = new SessionConfiguration(circularBufferSizeMB: 1024, format: EventPipeSerializationFormat.NetTrace, providers: providers);
return IpcTraceTest.RunAndValidateEventCounts(_expectedEventCounts, _eventGeneratingAction, configuration, _Verify);
#endif
}

private static Dictionary<string, ExpectedEventCount> _expectedEventCounts = new Dictionary<string, ExpectedEventCount>()
{
{ "BigEventSource", -1 }
};

private static Action _eventGeneratingAction = () =>
private static Action _eventGeneratingAction = () =>
{
// Write 10 big events
for (int i = 0; i < 10; i++)
Expand Down
7 changes: 7 additions & 0 deletions src/tests/tracing/eventpipe/bigevent/bigevent.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,15 @@
<!-- GCStress timeout: https://github.com/dotnet/runtime/issues/51133 -->
<GCStressIncompatible Condition="'$(TargetArchitecture)' == 'arm64' and '$(TargetOS)' == 'OSX'">true</GCStressIncompatible>
</PropertyGroup>
<PropertyGroup>
<!-- On Linux arm coreclr, the updated tracing/eventpipe/common/Microsoft.Diagnostics.NETCore.Client/Microsoft.Diagnostics.NETCore.Client.csproj project
does not yet work for several eventpipe runtime tests. We segment those tests with the following property and symbol -->
<UseUpdatedNETCoreClient Condition="!('$(TargetOS)' == 'Linux' And '$(TargetArchitecture)' == 'arm' And '$(RuntimeFlavor)' == 'coreclr')">true</UseUpdatedNETCoreClient>
<DefineConstants Condition="'$(UseUpdatedNETCoreClient)' == 'true'">$(DefineConstants);UPDATED_NETCORE_CLIENT</DefineConstants>
</PropertyGroup>
<ItemGroup>
<Compile Include="$(MSBuildProjectName).cs" />
<ProjectReference Include="../common/common.csproj" />
<ProjectReference Condition="'$(UseUpdatedNETCoreClient)' == 'true'" Include="../common/Microsoft.Diagnostics.NETCore.Client/Microsoft.Diagnostics.NETCore.Client.csproj" />
</ItemGroup>
</Project>
29 changes: 27 additions & 2 deletions src/tests/tracing/eventpipe/buffersize/buffersize.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,13 @@
using System.Threading;
using System.Threading.Tasks;
using System.Collections.Generic;
using Microsoft.Diagnostics.Tools.RuntimeClient;
using System.Text.RegularExpressions;
using Tracing.Tests.Common;
#if (UPDATED_NETCORE_CLIENT == true)
using Microsoft.Diagnostics.NETCore.Client;
#else
using Microsoft.Diagnostics.Tools.RuntimeClient;
#endif

namespace Tracing.Tests.BufferValidation
{
Expand All @@ -26,7 +31,26 @@ public static int Main(string[] args)
{
// This tests the resilience of message sending with
// smaller buffers, specifically 1MB and 4MB
#if (UPDATED_NETCORE_CLIENT == true)
Console.WriteLine($"NONLEGACY NETCORE.CLIENT");
var providers = new List<EventPipeProvider>()
{
new EventPipeProvider("MyEventSource", EventLevel.Verbose)
};

var buffersizes = new int[] { 0, 2 }
.Select(x => (int)Math.Pow(2, x));

foreach (var buffersize in buffersizes)
{
var ret = IpcTraceTest.RunAndValidateEventCounts(_expectedEventCounts, _eventGeneratingAction, providers, buffersize);
if (ret != 100)
return ret;
}

return 100;
#else
Console.WriteLine($"LEGACY TOOLS.RUNTIMECLIENT");
var providers = new List<Provider>()
{
new Provider("MyEventSource")
Expand All @@ -45,6 +69,7 @@ public static int Main(string[] args)
}

return 100;
#endif
}

private static Dictionary<string, ExpectedEventCount> _expectedEventCounts = new Dictionary<string, ExpectedEventCount>()
Expand All @@ -56,7 +81,7 @@ public static int Main(string[] args)
{ "MyEventSource", -1 }
};

private static Action _eventGeneratingAction = () =>
private static Action _eventGeneratingAction = () =>
{
foreach (var _ in Enumerable.Range(0,1000))
{
Expand Down
7 changes: 7 additions & 0 deletions src/tests/tracing/eventpipe/buffersize/buffersize.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,15 @@
<JitOptimizationSensitive>true</JitOptimizationSensitive>
<GCStressIncompatible>true</GCStressIncompatible>
</PropertyGroup>
<PropertyGroup>
<!-- On Linux arm coreclr, the updated tracing/eventpipe/common/Microsoft.Diagnostics.NETCore.Client/Microsoft.Diagnostics.NETCore.Client.csproj project
does not yet work for several eventpipe runtime tests. We segment those tests with the following property and symbol -->
<UseUpdatedNETCoreClient Condition="!('$(TargetOS)' == 'Linux' And '$(TargetArchitecture)' == 'arm' And '$(RuntimeFlavor)' == 'coreclr')">true</UseUpdatedNETCoreClient>
<DefineConstants Condition="'$(UseUpdatedNETCoreClient)' == 'true'">$(DefineConstants);UPDATED_NETCORE_CLIENT</DefineConstants>
</PropertyGroup>
<ItemGroup>
<Compile Include="$(MSBuildProjectName).cs" />
<ProjectReference Include="../common/common.csproj" />
<ProjectReference Condition="'$(UseUpdatedNETCoreClient)' == 'true'" Include="../common/Microsoft.Diagnostics.NETCore.Client/Microsoft.Diagnostics.NETCore.Client.csproj" />
</ItemGroup>
</Project>
Loading