Repository navigation
Minor event pipe profiler improvements - #1381
Conversation
|
@WojciechNagorski could you please take a look? |
| // parameterless constructor required by DiagnosersLoader to support creating this profiler via console line args | ||
| public EventPipeProfiler() { } | ||
| // we use performExtraBenchmarksRun = false for better first user experience | ||
| public EventPipeProfiler() :this(profile: EventPipeProfile.CpuSampling, performExtraBenchmarksRun: false) { } |
There was a problem hiding this comment.
Why this constructor has the performExtraBenchmarksRun parameter with false value as a default. In the second constructor, this parameter has 'true', I think It is not consistent.
There was a problem hiding this comment.
because this ctor is used when users specify console line arguments and they simply cant control it from command line level.
We do the same thing for ETWProfiler:
So, in general, we do it to improve first user experience (shorter time to get the results)
| public string ShortName => "EventPipe"; | ||
|
|
||
| private void ConvertToSpeedscope(BenchmarkCase benchmarkCase, string traceFilePath) | ||
| private static ImmutableHashSet<EventPipeProvider> MapToProviders(EventPipeProfile profile, IReadOnlyCollection<EventPipeProvider> providers) |
There was a problem hiding this comment.
This function has a little different behavior than my old code and the dotnet trace tool.
There you can find the documentation of dotnet trace: https://docs.microsoft.com/en-us/dotnet/core/diagnostics/dotnet-trace
- --providers <list-of-comma-separated-providers>
A comma-separated list of EventPipe providers to be enabled. These providers supplement any providers implied by --profile . If there's any inconsistency for a particular provider, this configuration takes precedence over the implicit configuration from the profile.
So for example a user could send:
- profile =
EventPipeProfile.CpuSampling - providers =
new EventPipeProvider("Microsoft-Windows-DotNETRuntime", EventLevel.Verbose, (long) ClrTraceEventParser.Keywords.Default)
new EventPipeProfiler(EventPipeProfile.CpuSampling, new [] { new EventPipeProvider("Microsoft-Windows-DotNETRuntime", EventLevel.Verbose, (long) ClrTraceEventParser.Keywords.Default | ClrTraceEventParser.Keywords.JitTracing)});This should give all the providers sent by the user and all providers resulting from the profile except those that were sent in the providers.
In the above example it should use:
- sent by user -
new EventPipeProvider("Microsoft-Windows-DotNETRuntime", EventLevel.Verbose, (long) ClrTraceEventParser.Keywords.Default | ClrTraceEventParser.Keywords.JitTracing) - from the profile -
new EventPipeProvider("Microsoft-DotNETCore-SampleProfiler", EventLevel.Informational)
This from the profile won't be used:
new EventPipeProvider("Microsoft-Windows-DotNETRuntime", EventLevel.Informational, (long) ClrTraceEventParser.Keywords.Default)
There was a problem hiding this comment.
@WojciechNagorski great catch! I've added tests for that and fixed it. PTAL again
No description provided.