Repository navigation
The EventPipeProfiler cross-platform profiler - #1321
Conversation
|
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 |
adamsitnik
left a comment
There was a problem hiding this comment.
@WojciechNagorski thanks for another great PR!
Please address my comments before we merge it. Thanks!
| # Visual Studio 15 | ||
| VisualStudioVersion = 15.0.27130.2027 | ||
| # Visual Studio Version 16 | ||
| VisualStudioVersion = 16.0.29102.190 |
There was a problem hiding this comment.
please revert all the changes to solution file
There was a problem hiding this comment.
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. |
|
@adamsitnik ping |
adamsitnik
left a comment
There was a problem hiding this comment.
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.
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.
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.
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.
thanks for adding the comment!
| [EventSource(Name = EngineEventSource.SourceName)] | ||
| public class EngineEventSource : EventSource | ||
| { | ||
| const string SourceName = "BenchmarkDotNet.EngineEventSource"; |
There was a problem hiding this comment.
it looks like there is no need to extract const if it's used only in once place. Could you please revert this change?
adamsitnik
left a comment
There was a problem hiding this comment.
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.Clientfrom dotnet/diagnostics#617. This library support only .Net Core 2.1 so I decided that I create a new libraryBenchmarkDotNet.Diagnostics.NETCorethat 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