dotnet / dotnet/BenchmarkDotNet

EtwProfiler throws

Open
#2,685 2 comments 0 reactions 0 assignees View on GitHub
Area:Diagnosers
Dominant language
C#
Stars
11.5k
Forks
1.1k
Avg merge
6d 11h
Merged PRs (30d)
12

Description

When trying to profile the benchmark, I'm getting this exception. No special configuration was used, just the attribute.

.csproj:

```xml

```

```
Unhandled exception. System.ArgumentNullException: Value cannot be null. (Parameter 'key')
at System.ArgumentNullException.Throw(String paramName)
at System.ArgumentNullException.ThrowIfNull(Object argument, String paramName)
at System.Collections.Generic.SortedDictionary`2.TryGetValue(TKey key, TValue& value)
at Microsoft.Diagnostics.Tracing.Session.TraceEventProviders.GetProviderGuidByName(String name)
at Microsoft.Diagnostics.Tracing.Session.TraceEventSession.EnableProvider(String providerName, TraceEventLevel providerLevel, UInt64 matchAnyKeywords, TraceEventProviderOptions options)
at BenchmarkDotNet.Diagnostics.Windows.UserSession.EnableProviders()
at BenchmarkDotNet.Diagnostics.Windows.EtwProfiler.Start(DiagnoserActionParameters parameters)
at BenchmarkDotNet.Diagnostics.Windows.EtwProfiler.Handle(HostSignal signal, DiagnoserActionParameters parameters)
at BenchmarkDotNet.Diagnosers.CompositeDiagnoser.Handle(HostSignal signal, DiagnoserActionParameters parameters)
at BenchmarkDotNet.Toolchains.DotNetCli.DotNetCliExecutor.Execute(BenchmarkCase benchmarkCase, BenchmarkId benchmarkId, ILogger logger, ArtifactsPaths artifactsPaths, IDiagnoser diagnoser, String executableName, IResolver resolver, Int32 launchIndex)
at BenchmarkDotNet.Toolchains.DotNetCli.DotNetCliExecutor.Execute(ExecuteParameters executeParameters)
at BenchmarkDotNet.Running.BenchmarkRunnerClean.RunExecute(ILogger logger, BenchmarkCase benchmarkCase, BenchmarkId benchmarkId, IToolchain toolchain, BuildResult buildResult, IResolver resolver, IDiagnoser diagnoser, Int32 launchIndex)
at BenchmarkDotNet.Running.BenchmarkRunnerClean.Execute(ILogger logger, BenchmarkCase benchmarkCase, BenchmarkId benchmarkId, IToolchain toolchain, BuildResult buildResult, IResolver resolver)
at BenchmarkDotNet.Running.BenchmarkRunnerClean.RunCore(BenchmarkCase benchmarkCase, BenchmarkId benchmarkId, ILogger logger, IResolver resolver, BuildResult buildResult)
at BenchmarkDotNet.Running.BenchmarkRunnerClean.Run(BenchmarkRunInfo benchmarkRunInfo, Dictionary`2 buildResults, IResolver resolver, ILogger logger, EventProcessor eventProcessor, List`1 artifactsToCleanup, String resultsFolderPath, String logFilePath, Int32 totalBenchmarkCount, StartedClock& runsChronometer, Int32& benchmarksToRunCount, TaskbarProgress taskbarProgress)
at BenchmarkDotNet.Running.BenchmarkRunnerClean.Run(BenchmarkRunInfo[] benchmarkRunInfos)
at BenchmarkDotNet.Running.BenchmarkRunner.RunWithDirtyAssemblyResolveHelper(Type type, IConfig config, String[] args)
at BenchmarkDotNet.Running.BenchmarkRunner.<>c__DisplayClass0_0`1.b__0()
at BenchmarkDotNet.Running.BenchmarkRunner.RunWithExceptionHandling(Func`1 run)
at BenchmarkDotNet.Running.BenchmarkRunner.Run[T](IConfig config, String[] args)
at F434C893D347D378BD1CFEE9E250135FD99E920ADDCBBE6AEE63D66CD410CFDAA__Runner.<>c__1`1.b__1_0() in C:\Users\domin\dev\DotProduct\Metis\Benchmarks\Program.cs:line 20
at F434C893D347D378BD1CFEE9E250135FD99E920ADDCBBE6AEE63D66CD410CFDAA__Runner.Run(ImmutableArray`1 selection) in C:\Users\domin\dev\DotProduct\Metis\Benchmarks\Program.cs:line 28
at Program.$(String[] args) in C:\Users\domin\dev\DotProduct\Metis\Benchmarks\Program.cs:line 11
```

Note: I've also tried creating an explicit configuration where I'd pass an empty list of providers, but it still fails. After checking the code of UserSession.EnableProviders(), it seems like the only culprit could be https://github.com/dotnet/BenchmarkDotNet/blob/cac4f6e7342eb28e73f59d21ca87f48cfce7b6ba/src/BenchmarkDotNet.Diagnostics.Windows/Sessions.cs#L46C46-L46C63

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.