@@ -8,7 +8,7 @@ namespace BenchmarkDotNet.Diagnostics.Windows.Tracing
88{
99 public sealed class EngineEventLogParser : TraceEventParser
1010 {
11- private static volatile TraceEvent [ ] templates ;
11+ private static volatile TraceEvent [ ] ? templates ;
1212
1313 public EngineEventLogParser ( TraceEventSource source , bool dontRegister = false ) : base ( source , dontRegister ) { }
1414
@@ -114,69 +114,69 @@ public event Action<IterationEvent> WorkloadActualStop
114114
115115 protected override string GetProviderName ( ) { return ProviderName ; }
116116
117- private static IterationEvent BenchmarkStartTemplate ( Action < IterationEvent > action )
117+ private static IterationEvent BenchmarkStartTemplate ( Action < IterationEvent > ? action )
118118 { // action, eventid, taskid, taskName, taskGuid, opcode, opcodeName, providerGuid, providerName
119119 return new IterationEvent ( action , EngineEventSource . BenchmarkStartEventId , ( int ) EngineEventSource . Tasks . Benchmark , nameof ( EngineEventSource . Tasks . Benchmark ) , Guid . Empty , ( int ) EventOpcode . Start , nameof ( EventOpcode . Start ) , ProviderGuid , ProviderName ) ;
120120 }
121121
122- private static IterationEvent BenchmarkStopTemplate ( Action < IterationEvent > action )
122+ private static IterationEvent BenchmarkStopTemplate ( Action < IterationEvent > ? action )
123123 { // action, eventid, taskid, taskName, taskGuid, opcode, opcodeName, providerGuid, providerName
124124 return new IterationEvent ( action , EngineEventSource . BenchmarkStopEventId , ( int ) EngineEventSource . Tasks . Benchmark , nameof ( EngineEventSource . Tasks . Benchmark ) , Guid . Empty , ( int ) EventOpcode . Stop , nameof ( EventOpcode . Stop ) , ProviderGuid , ProviderName ) ;
125125 }
126126
127- private static IterationEvent OverheadJittingStartTemplate ( Action < IterationEvent > action )
127+ private static IterationEvent OverheadJittingStartTemplate ( Action < IterationEvent > ? action )
128128 => CreateIterationStartTemplate ( action , EngineEventSource . OverheadJittingStartEventId , EngineEventSource . Tasks . OverheadJitting ) ;
129129
130- private static IterationEvent OverheadJittingStopTemplate ( Action < IterationEvent > action )
130+ private static IterationEvent OverheadJittingStopTemplate ( Action < IterationEvent > ? action )
131131 => CreateIterationStopTemplate ( action , EngineEventSource . OverheadJittingStopEventId , EngineEventSource . Tasks . OverheadJitting ) ;
132132
133- private static IterationEvent WorkloadJittingStartTemplate ( Action < IterationEvent > action )
133+ private static IterationEvent WorkloadJittingStartTemplate ( Action < IterationEvent > ? action )
134134 => CreateIterationStartTemplate ( action , EngineEventSource . WorkloadJittingStartEventId , EngineEventSource . Tasks . WorkloadJitting ) ;
135135
136- private static IterationEvent WorkloadJittingStopTemplate ( Action < IterationEvent > action )
136+ private static IterationEvent WorkloadJittingStopTemplate ( Action < IterationEvent > ? action )
137137 => CreateIterationStopTemplate ( action , EngineEventSource . WorkloadJittingStopEventId , EngineEventSource . Tasks . WorkloadJitting ) ;
138138
139- private static IterationEvent WorkloadPilotStartTemplate ( Action < IterationEvent > action )
139+ private static IterationEvent WorkloadPilotStartTemplate ( Action < IterationEvent > ? action )
140140 => CreateIterationStartTemplate ( action , EngineEventSource . WorkloadPilotStartEventId , EngineEventSource . Tasks . WorkloadPilot ) ;
141141
142- private static IterationEvent WorkloadPilotStopTemplate ( Action < IterationEvent > action )
142+ private static IterationEvent WorkloadPilotStopTemplate ( Action < IterationEvent > ? action )
143143 => CreateIterationStopTemplate ( action , EngineEventSource . WorkloadPilotStopEventId , EngineEventSource . Tasks . WorkloadPilot ) ;
144144
145- private static IterationEvent OverheadWarmupStartTemplate ( Action < IterationEvent > action )
145+ private static IterationEvent OverheadWarmupStartTemplate ( Action < IterationEvent > ? action )
146146 => CreateIterationStartTemplate ( action , EngineEventSource . OverheadWarmupStartEventId , EngineEventSource . Tasks . OverheadWarmup ) ;
147147
148- private static IterationEvent OverheadWarmupStopTemplate ( Action < IterationEvent > action )
148+ private static IterationEvent OverheadWarmupStopTemplate ( Action < IterationEvent > ? action )
149149 => CreateIterationStopTemplate ( action , EngineEventSource . OverheadWarmupStopEventId , EngineEventSource . Tasks . OverheadWarmup ) ;
150150
151- private static IterationEvent WorkloadWarmupStartTemplate ( Action < IterationEvent > action )
151+ private static IterationEvent WorkloadWarmupStartTemplate ( Action < IterationEvent > ? action )
152152 => CreateIterationStartTemplate ( action , EngineEventSource . WorkloadWarmupStartEventId , EngineEventSource . Tasks . WorkloadWarmup ) ;
153153
154- private static IterationEvent WorkloadWarmupStopTemplate ( Action < IterationEvent > action )
154+ private static IterationEvent WorkloadWarmupStopTemplate ( Action < IterationEvent > ? action )
155155 => CreateIterationStopTemplate ( action , EngineEventSource . WorkloadWarmupStopEventId , EngineEventSource . Tasks . WorkloadWarmup ) ;
156156
157- private static IterationEvent OverheadActualStartTemplate ( Action < IterationEvent > action )
157+ private static IterationEvent OverheadActualStartTemplate ( Action < IterationEvent > ? action )
158158 => CreateIterationStartTemplate ( action , EngineEventSource . OverheadActualStartEventId , EngineEventSource . Tasks . OverheadActual ) ;
159159
160- private static IterationEvent OverheadActualStopTemplate ( Action < IterationEvent > action )
160+ private static IterationEvent OverheadActualStopTemplate ( Action < IterationEvent > ? action )
161161 => CreateIterationStopTemplate ( action , EngineEventSource . OverheadActualStopEventId , EngineEventSource . Tasks . OverheadActual ) ;
162162
163- private static IterationEvent WorkloadActualStartTemplate ( Action < IterationEvent > action )
163+ private static IterationEvent WorkloadActualStartTemplate ( Action < IterationEvent > ? action )
164164 => CreateIterationStartTemplate ( action , EngineEventSource . WorkloadActualStartEventId , EngineEventSource . Tasks . WorkloadActual ) ;
165165
166- private static IterationEvent WorkloadActualStopTemplate ( Action < IterationEvent > action )
166+ private static IterationEvent WorkloadActualStopTemplate ( Action < IterationEvent > ? action )
167167 => CreateIterationStopTemplate ( action , EngineEventSource . WorkloadActualStopEventId , EngineEventSource . Tasks . WorkloadActual ) ;
168168
169- private static IterationEvent CreateIterationStartTemplate ( Action < IterationEvent > action , int eventId , EventTask eventTask )
169+ private static IterationEvent CreateIterationStartTemplate ( Action < IterationEvent > ? action , int eventId , EventTask eventTask )
170170 { // action, eventid, taskid, taskName, taskGuid, opcode, opcodeName, providerGuid, providerName
171171 return new IterationEvent ( action , eventId , ( int ) eventTask , eventTask . ToString ( ) , Guid . Empty , ( int ) EventOpcode . Start , nameof ( EventOpcode . Start ) , ProviderGuid , ProviderName ) ;
172172 }
173173
174- private static IterationEvent CreateIterationStopTemplate ( Action < IterationEvent > action , int eventId , EventTask eventTask )
174+ private static IterationEvent CreateIterationStopTemplate ( Action < IterationEvent > ? action , int eventId , EventTask eventTask )
175175 { // action, eventid, taskid, taskName, taskGuid, opcode, opcodeName, providerGuid, providerName
176176 return new IterationEvent ( action , eventId , ( int ) eventTask , eventTask . ToString ( ) , Guid . Empty , ( int ) EventOpcode . Stop , nameof ( EventOpcode . Stop ) , ProviderGuid , ProviderName ) ;
177177 }
178178
179- protected override void EnumerateTemplates ( Func < string , string , EventFilterResponse > eventsToObserve , Action < TraceEvent > callback )
179+ protected override void EnumerateTemplates ( Func < string , string , EventFilterResponse > ? eventsToObserve , Action < TraceEvent > callback )
180180 {
181181 if ( templates == null )
182182 {
0 commit comments