Skip to content

Make TraceCollector work on Linux #4706

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

Open
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

VincentBu
Copy link
Contributor

Since PerfView only works on Windows, we use dotnet-trace as trace collector on Linux.

@@ -11,7 +11,7 @@ public static (string, string) Build(MicrobenchmarkConfiguration configuration,
string filter = benchmark ?? configuration.MicrobenchmarkConfigurations.Filter;

// Base command: Add mandatory commands.
string command = $"run -f {frameworkVersion} --filter \"{filter}\" -c Release --noOverwrite --no-build";
string command = $"run -f {frameworkVersion} --filter \"{filter}\" -c Release --inProcess --noOverwrite --no-build";
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given that dotnet-trace only collect the first app(-- <command>) or specified process(--process-id <PID>), we start inProcess run for microbenchmarks

}



// If a trace is requested, ensure the file exists. If not, there is was an error and alert the user.
if (configuration.TraceConfigurations?.Type != "none")
{
// Not checking Linux here since the local run only allows for Windows.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change this comment since we are now checking Linux.

{ CollectType.threadtime, "collect_threadTime" }
};

internal static readonly Dictionary<CollectType, string> LinuxLocalRunCollectTypeMap = new()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should probably rename:

internal static readonly Dictionary<CollectType, string> LinuxCollectTypeMap = new()
to LinuxServerRunCollectTypeMap.


internal static readonly Dictionary<CollectType, string> LinuxLocalRunCollectTypeMap = new()
{
{ CollectType.gc, "--clrevents gc" },
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

{
{ CollectType.gc, "--clrevents gc" },
{ CollectType.cpu, "--clrevents gc+stack --clreventlevel informational" },
{ CollectType.threadtime, "--clrevents gc --clreventlevel Verbose" },
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This configuration doesn't match with the threadtime based trace collection - let's get rid of this until we find a good enough alternative.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants