@@ -25,8 +25,8 @@ public static int TestEntryPoint()
25
25
// Validation is done with _DoesTraceContainEvents
26
26
new Dictionary < string , ExpectedEventCount > ( ) { { "Microsoft-Windows-DotNETRuntime" , - 1 } } ,
27
27
_eventGeneratingActionForGC ,
28
- //GCKeyword (0x1): 0b1
29
- new List < EventPipeProvider > ( ) { new EventPipeProvider ( "Microsoft-Windows-DotNETRuntime" , EventLevel . Informational , 0b1 ) } ,
28
+ // GCKeyword (0x1): 0b1, GCAllocationTick requries Verbose level
29
+ new List < EventPipeProvider > ( ) { new EventPipeProvider ( "Microsoft-Windows-DotNETRuntime" , EventLevel . Verbose , 0b1 ) } ,
30
30
1024 , _DoesTraceContainGCEvents , enableRundownProvider : false ) ;
31
31
32
32
// Run the 2nd test scenario only if the first one passes
@@ -35,7 +35,7 @@ public static int TestEntryPoint()
35
35
ret = IpcTraceTest . RunAndValidateEventCounts (
36
36
new Dictionary < string , ExpectedEventCount > ( ) { { "Microsoft-DotNETCore-EventPipe" , 1 } } ,
37
37
_eventGeneratingActionForExceptions ,
38
- //ExceptionKeyword (0x8000): 0b1000_0000_0000_0000
38
+ // ExceptionKeyword (0x8000): 0b1000_0000_0000_0000
39
39
new List < EventPipeProvider > ( ) { new EventPipeProvider ( "Microsoft-Windows-DotNETRuntime" , EventLevel . Warning , 0b1000_0000_0000_0000 ) } ,
40
40
1024 , _DoesTraceContainExceptionEvents , enableRundownProvider : false ) ;
41
41
@@ -64,6 +64,9 @@ public static int TestEntryPoint()
64
64
RuntimeEventValidation eventValidation = new RuntimeEventValidation ( ) ;
65
65
eventValidation = null ;
66
66
GC . Collect ( ) ;
67
+
68
+ // Explicitly targeting AllocationTick event
69
+ GC . KeepAlive ( new int [ 1000 ] ) ;
67
70
}
68
71
} ;
69
72
@@ -114,6 +117,9 @@ public static int TestEntryPoint()
114
117
source . Clr . GCSuspendEEStart += ( eventData ) => GCSuspendEEEvents += 1 ;
115
118
source . Clr . GCSuspendEEStop += ( eventData ) => GCSuspendEEEndEvents += 1 ;
116
119
120
+ int GCAllocationTickEvents = 0 ;
121
+ source . Clr . GCAllocationTick += ( eventData ) => GCAllocationTickEvents += 1 ;
122
+
117
123
return ( ) => {
118
124
Logger . logger . Log ( "Event counts validation" ) ;
119
125
@@ -132,7 +138,10 @@ public static int TestEntryPoint()
132
138
bool GCSuspendEEStartStopResult = GCSuspendEEEvents >= 50 && GCSuspendEEEndEvents >= 50 ;
133
139
Logger . logger . Log ( "GCSuspendEEStartStopResult check: " + GCSuspendEEStartStopResult ) ;
134
140
135
- return GCStartStopResult && GCRestartEEStartStopResult && GCSuspendEEStartStopResult ? 100 : - 1 ;
141
+ Logger . logger . Log ( "GCAllocationTickEvents: " + GCAllocationTickEvents ) ;
142
+ bool GCAllocationTickResult = GCAllocationTickEvents > 0 ;
143
+
144
+ return GCStartStopResult && GCRestartEEStartStopResult && GCSuspendEEStartStopResult && GCAllocationTickResult ? 100 : - 1 ;
136
145
} ;
137
146
} ;
138
147
0 commit comments