-
-
Notifications
You must be signed in to change notification settings - Fork 981
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
The EventPipeProfiler cross-platform profiler #1321
The EventPipeProfiler cross-platform profiler #1321
Conversation
…to task-EventPipeProfiler
I've tested the proposed I've sent dotnet/diagnostics#700 in order to add .NET Standard 2.0 support to |
@adamsitnik Thanks. I'm going to finish this task this week. |
dotnet/diagnostics#700 got merged and it targets .NET Standard 2.0 now, so IMHO we can add this dependency to main BenchmarkDotNet project and just add the new profiler plugin there |
@adamsitnik Great. Today I will move |
I've pushed the updated version of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@WojciechNagorski thanks for another great PR!
Please address my comments before we merge it. Thanks!
BenchmarkDotNet.sln
Outdated
# Visual Studio 15 | ||
VisualStudioVersion = 15.0.27130.2027 | ||
# Visual Studio Version 16 | ||
VisualStudioVersion = 16.0.29102.190 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please revert all the changes to solution file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will revert the version of Visual Studio. But I think that guilds should be changed, dotnet/project-system#3079 (comment)
and
dotnet/project-system#2863
What do you think?
@adamsitnik I made the changes you asked for. I have questions for two topics. |
…to task-EventPipeProfiler
…to task-EventPipeProfiler
…to task-EventPipeProfiler
@adamsitnik ping |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great to me, thank you @WojciechNagorski !
Please let me know if you have some time to address my feedback today. If not, I am going to merge it as it is and send a minor improvement PR.
Once again big thanks!
{ | ||
CpuSampling, | ||
GcVerbose, | ||
GcCollect |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it would be great to add Jit
to this list with inlining and tail call info enabled
Path.GetDirectoryName(fileName).CreateIfNotExists(); | ||
benchmarkToTraceFile[parameters.BenchmarkCase] = fileName; | ||
|
||
collectingTask = new Task(() => |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: we have quite a deep nesting here. in a perfect world, we would move this logic to a separate method and avoid closure capture
|
||
public string ShortName => "EventPipe"; | ||
|
||
private void ConvertToSpeedscope(BenchmarkCase benchmarkCase, string traceFilePath) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this class is responsible for profiling using event pipe (EventPipeProfiler
) could you please move everything that is related to exporting to speedscope to a dedicated type?
} | ||
} | ||
|
||
// Method copied from https://github.com/dotnet/diagnostics/blob/2c23d3265dd8f642a8d6cf4bb8a135a5ff8b00c2/src/Tools/dotnet-trace/TraceFileFormatConverter.cs#L64 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for adding the comment!
public class EngineEventSource : EventSource | ||
{ | ||
const string SourceName = "BenchmarkDotNet.EngineEventSource"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it looks like there is no need to extract const if it's used only in once place. Could you please revert this change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like I need to approve it again after pushing GH suggestions...
@adamsitnik I will try to fix it now. |
@WojciechNagorski don't worry about this, I am going to send a small PR with the improvements |
@adamsitnik Ok, so I won't change anything. There you can find what I've done so far: #1382 |
Changes for #1315
Currently, I use a local build of
Microsoft.Diagnostics.NETCore.Client
from dotnet/diagnostics#617. This library support only .Net Core 2.1 so I decided that I create a new libraryBenchmarkDotNet.Diagnostics.NETCore
that contains EventPipeProfiler.(I don't like the name "NETCore" but I wanted to do it like in
Microsoft.Diagnostics.NETCore.Client
)You can run this profiler via command line:
Example trace file.zip