@@ -8,7 +8,7 @@ namespace BenchmarkDotNet.Diagnostics.Windows.Tracing
8
8
{
9
9
public sealed class EngineEventLogParser : TraceEventParser
10
10
{
11
- private static volatile TraceEvent [ ] templates ;
11
+ private static volatile TraceEvent [ ] ? templates ;
12
12
13
13
public EngineEventLogParser ( TraceEventSource source , bool dontRegister = false ) : base ( source , dontRegister ) { }
14
14
@@ -114,69 +114,69 @@ public event Action<IterationEvent> WorkloadActualStop
114
114
115
115
protected override string GetProviderName ( ) { return ProviderName ; }
116
116
117
- private static IterationEvent BenchmarkStartTemplate ( Action < IterationEvent > action )
117
+ private static IterationEvent BenchmarkStartTemplate ( Action < IterationEvent > ? action )
118
118
{ // action, eventid, taskid, taskName, taskGuid, opcode, opcodeName, providerGuid, providerName
119
119
return new IterationEvent ( action , EngineEventSource . BenchmarkStartEventId , ( int ) EngineEventSource . Tasks . Benchmark , nameof ( EngineEventSource . Tasks . Benchmark ) , Guid . Empty , ( int ) EventOpcode . Start , nameof ( EventOpcode . Start ) , ProviderGuid , ProviderName ) ;
120
120
}
121
121
122
- private static IterationEvent BenchmarkStopTemplate ( Action < IterationEvent > action )
122
+ private static IterationEvent BenchmarkStopTemplate ( Action < IterationEvent > ? action )
123
123
{ // action, eventid, taskid, taskName, taskGuid, opcode, opcodeName, providerGuid, providerName
124
124
return new IterationEvent ( action , EngineEventSource . BenchmarkStopEventId , ( int ) EngineEventSource . Tasks . Benchmark , nameof ( EngineEventSource . Tasks . Benchmark ) , Guid . Empty , ( int ) EventOpcode . Stop , nameof ( EventOpcode . Stop ) , ProviderGuid , ProviderName ) ;
125
125
}
126
126
127
- private static IterationEvent OverheadJittingStartTemplate ( Action < IterationEvent > action )
127
+ private static IterationEvent OverheadJittingStartTemplate ( Action < IterationEvent > ? action )
128
128
=> CreateIterationStartTemplate ( action , EngineEventSource . OverheadJittingStartEventId , EngineEventSource . Tasks . OverheadJitting ) ;
129
129
130
- private static IterationEvent OverheadJittingStopTemplate ( Action < IterationEvent > action )
130
+ private static IterationEvent OverheadJittingStopTemplate ( Action < IterationEvent > ? action )
131
131
=> CreateIterationStopTemplate ( action , EngineEventSource . OverheadJittingStopEventId , EngineEventSource . Tasks . OverheadJitting ) ;
132
132
133
- private static IterationEvent WorkloadJittingStartTemplate ( Action < IterationEvent > action )
133
+ private static IterationEvent WorkloadJittingStartTemplate ( Action < IterationEvent > ? action )
134
134
=> CreateIterationStartTemplate ( action , EngineEventSource . WorkloadJittingStartEventId , EngineEventSource . Tasks . WorkloadJitting ) ;
135
135
136
- private static IterationEvent WorkloadJittingStopTemplate ( Action < IterationEvent > action )
136
+ private static IterationEvent WorkloadJittingStopTemplate ( Action < IterationEvent > ? action )
137
137
=> CreateIterationStopTemplate ( action , EngineEventSource . WorkloadJittingStopEventId , EngineEventSource . Tasks . WorkloadJitting ) ;
138
138
139
- private static IterationEvent WorkloadPilotStartTemplate ( Action < IterationEvent > action )
139
+ private static IterationEvent WorkloadPilotStartTemplate ( Action < IterationEvent > ? action )
140
140
=> CreateIterationStartTemplate ( action , EngineEventSource . WorkloadPilotStartEventId , EngineEventSource . Tasks . WorkloadPilot ) ;
141
141
142
- private static IterationEvent WorkloadPilotStopTemplate ( Action < IterationEvent > action )
142
+ private static IterationEvent WorkloadPilotStopTemplate ( Action < IterationEvent > ? action )
143
143
=> CreateIterationStopTemplate ( action , EngineEventSource . WorkloadPilotStopEventId , EngineEventSource . Tasks . WorkloadPilot ) ;
144
144
145
- private static IterationEvent OverheadWarmupStartTemplate ( Action < IterationEvent > action )
145
+ private static IterationEvent OverheadWarmupStartTemplate ( Action < IterationEvent > ? action )
146
146
=> CreateIterationStartTemplate ( action , EngineEventSource . OverheadWarmupStartEventId , EngineEventSource . Tasks . OverheadWarmup ) ;
147
147
148
- private static IterationEvent OverheadWarmupStopTemplate ( Action < IterationEvent > action )
148
+ private static IterationEvent OverheadWarmupStopTemplate ( Action < IterationEvent > ? action )
149
149
=> CreateIterationStopTemplate ( action , EngineEventSource . OverheadWarmupStopEventId , EngineEventSource . Tasks . OverheadWarmup ) ;
150
150
151
- private static IterationEvent WorkloadWarmupStartTemplate ( Action < IterationEvent > action )
151
+ private static IterationEvent WorkloadWarmupStartTemplate ( Action < IterationEvent > ? action )
152
152
=> CreateIterationStartTemplate ( action , EngineEventSource . WorkloadWarmupStartEventId , EngineEventSource . Tasks . WorkloadWarmup ) ;
153
153
154
- private static IterationEvent WorkloadWarmupStopTemplate ( Action < IterationEvent > action )
154
+ private static IterationEvent WorkloadWarmupStopTemplate ( Action < IterationEvent > ? action )
155
155
=> CreateIterationStopTemplate ( action , EngineEventSource . WorkloadWarmupStopEventId , EngineEventSource . Tasks . WorkloadWarmup ) ;
156
156
157
- private static IterationEvent OverheadActualStartTemplate ( Action < IterationEvent > action )
157
+ private static IterationEvent OverheadActualStartTemplate ( Action < IterationEvent > ? action )
158
158
=> CreateIterationStartTemplate ( action , EngineEventSource . OverheadActualStartEventId , EngineEventSource . Tasks . OverheadActual ) ;
159
159
160
- private static IterationEvent OverheadActualStopTemplate ( Action < IterationEvent > action )
160
+ private static IterationEvent OverheadActualStopTemplate ( Action < IterationEvent > ? action )
161
161
=> CreateIterationStopTemplate ( action , EngineEventSource . OverheadActualStopEventId , EngineEventSource . Tasks . OverheadActual ) ;
162
162
163
- private static IterationEvent WorkloadActualStartTemplate ( Action < IterationEvent > action )
163
+ private static IterationEvent WorkloadActualStartTemplate ( Action < IterationEvent > ? action )
164
164
=> CreateIterationStartTemplate ( action , EngineEventSource . WorkloadActualStartEventId , EngineEventSource . Tasks . WorkloadActual ) ;
165
165
166
- private static IterationEvent WorkloadActualStopTemplate ( Action < IterationEvent > action )
166
+ private static IterationEvent WorkloadActualStopTemplate ( Action < IterationEvent > ? action )
167
167
=> CreateIterationStopTemplate ( action , EngineEventSource . WorkloadActualStopEventId , EngineEventSource . Tasks . WorkloadActual ) ;
168
168
169
- private static IterationEvent CreateIterationStartTemplate ( Action < IterationEvent > action , int eventId , EventTask eventTask )
169
+ private static IterationEvent CreateIterationStartTemplate ( Action < IterationEvent > ? action , int eventId , EventTask eventTask )
170
170
{ // action, eventid, taskid, taskName, taskGuid, opcode, opcodeName, providerGuid, providerName
171
171
return new IterationEvent ( action , eventId , ( int ) eventTask , eventTask . ToString ( ) , Guid . Empty , ( int ) EventOpcode . Start , nameof ( EventOpcode . Start ) , ProviderGuid , ProviderName ) ;
172
172
}
173
173
174
- private static IterationEvent CreateIterationStopTemplate ( Action < IterationEvent > action , int eventId , EventTask eventTask )
174
+ private static IterationEvent CreateIterationStopTemplate ( Action < IterationEvent > ? action , int eventId , EventTask eventTask )
175
175
{ // action, eventid, taskid, taskName, taskGuid, opcode, opcodeName, providerGuid, providerName
176
176
return new IterationEvent ( action , eventId , ( int ) eventTask , eventTask . ToString ( ) , Guid . Empty , ( int ) EventOpcode . Stop , nameof ( EventOpcode . Stop ) , ProviderGuid , ProviderName ) ;
177
177
}
178
178
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 )
180
180
{
181
181
if ( templates == null )
182
182
{
0 commit comments