Skip to content
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

Update EventPipeStress #3049

Merged
merged 1 commit into from
May 7, 2022
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
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net5.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
Expand Down
9 changes: 7 additions & 2 deletions src/tests/EventPipeStress/Orchestrator/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
using Microsoft.Diagnostics.Tracing;

using Process = System.Diagnostics.Process;
using System.Runtime.Versioning;

namespace Orchestrator
{
Expand Down Expand Up @@ -191,6 +192,10 @@ static Func<int, TestResult> UseFS(bool rundown, int bufferSize)
};
}

[SupportedOSPlatformGuard("Windows")]
[SupportedOSPlatformGuard("Linux")]
static bool IsWindowsOrLinux => OperatingSystem.IsLinux() || OperatingSystem.IsWindows();

static async Task<int> Orchestrate(
IConsole console,
CancellationToken ct,
Expand Down Expand Up @@ -254,7 +259,8 @@ static async Task<int> Orchestrate(
eventWritingProc.Start();

Console.WriteLine($"Executing: {eventWritingProc.StartInfo.FileName} {eventWritingProc.StartInfo.Arguments}");
if (!RuntimeInformation.IsOSPlatform(OSPlatform.OSX))

if (IsWindowsOrLinux)
{
// Set affinity and priority
ulong affinityMask = 0;
Expand All @@ -263,7 +269,6 @@ static async Task<int> Orchestrate(
affinityMask |= ((ulong)1 << j);
}
eventWritingProc.ProcessorAffinity = (IntPtr)((ulong)eventWritingProc.ProcessorAffinity & affinityMask);
eventWritingProc.PriorityClass = ProcessPriorityClass.RealTime; // Set the process priority to highest possible
}

// Start listening to the event.
Expand Down
2 changes: 1 addition & 1 deletion src/tests/EventPipeStress/Stress/Stress.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net5.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
Expand Down