38
38
* IDs depend on the JDK version (see metadata.xml file) and are computed at image build time.
39
39
*/
40
40
public final class JfrEvent {
41
- public static final JfrEvent ThreadStart = create ("jdk.ThreadStart" );
41
+ public static final JfrEvent ThreadStart = create ("jdk.ThreadStart" , 4 );
42
42
public static final JfrEvent ThreadEnd = create ("jdk.ThreadEnd" );
43
43
public static final JfrEvent ThreadCPULoad = create ("jdk.ThreadCPULoad" );
44
44
public static final JfrEvent DataLoss = create ("jdk.DataLoss" );
@@ -60,41 +60,54 @@ public final class JfrEvent {
60
60
public static final JfrEvent SafepointBegin = create ("jdk.SafepointBegin" , JfrEventFlags .HasDuration );
61
61
public static final JfrEvent SafepointEnd = create ("jdk.SafepointEnd" , JfrEventFlags .HasDuration );
62
62
public static final JfrEvent ExecuteVMOperation = create ("jdk.ExecuteVMOperation" , JfrEventFlags .HasDuration );
63
- public static final JfrEvent JavaMonitorEnter = create ("jdk.JavaMonitorEnter" , JfrEventFlags .HasDuration );
64
- public static final JfrEvent ThreadPark = create ("jdk.ThreadPark" , JfrEventFlags .HasDuration );
65
- public static final JfrEvent JavaMonitorWait = create ("jdk.JavaMonitorWait" , JfrEventFlags .HasDuration );
66
- public static final JfrEvent JavaMonitorInflate = create ("jdk.JavaMonitorInflate" , JfrEventFlags .HasDuration );
67
- public static final JfrEvent ObjectAllocationInNewTLAB = create ("jdk.ObjectAllocationInNewTLAB" );
63
+ public static final JfrEvent JavaMonitorEnter = create ("jdk.JavaMonitorEnter" , 5 , JfrEventFlags .HasDuration );
64
+ public static final JfrEvent ThreadPark = create ("jdk.ThreadPark" , 5 , JfrEventFlags .HasDuration );
65
+ public static final JfrEvent JavaMonitorWait = create ("jdk.JavaMonitorWait" , 5 , JfrEventFlags .HasDuration );
66
+ public static final JfrEvent JavaMonitorInflate = create ("jdk.JavaMonitorInflate" , 5 , JfrEventFlags .HasDuration );
67
+ public static final JfrEvent ObjectAllocationInNewTLAB = create ("jdk.ObjectAllocationInNewTLAB" , 5 );
68
68
public static final JfrEvent GCHeapSummary = create ("jdk.GCHeapSummary" );
69
69
public static final JfrEvent ThreadAllocationStatistics = create ("jdk.ThreadAllocationStatistics" );
70
- public static final JfrEvent SystemGC = create ("jdk.SystemGC" , JfrEventFlags .HasDuration );
71
- public static final JfrEvent AllocationRequiringGC = create ("jdk.AllocationRequiringGC" );
72
- public static final JfrEvent OldObjectSample = create ("jdk.OldObjectSample" );
73
- public static final JfrEvent ObjectAllocationSample = create ("jdk.ObjectAllocationSample" , JfrEventFlags .SupportsThrottling );
70
+ public static final JfrEvent SystemGC = create ("jdk.SystemGC" , 5 , JfrEventFlags .HasDuration );
71
+ public static final JfrEvent AllocationRequiringGC = create ("jdk.AllocationRequiringGC" , 5 );
72
+ public static final JfrEvent OldObjectSample = create ("jdk.OldObjectSample" , 7 );
73
+ public static final JfrEvent ObjectAllocationSample = create ("jdk.ObjectAllocationSample" , 5 , JfrEventFlags .SupportsThrottling );
74
74
public static final JfrEvent NativeMemoryUsage = create ("jdk.NativeMemoryUsage" );
75
75
public static final JfrEvent NativeMemoryUsageTotal = create ("jdk.NativeMemoryUsageTotal" );
76
76
77
77
private final long id ;
78
78
private final String name ;
79
79
private final int flags ;
80
+ private final int skipCount ;
80
81
81
82
@ Platforms (Platform .HOSTED_ONLY .class )
82
- public static JfrEvent create (String name , JfrEventFlags ... flags ) {
83
- return new JfrEvent (name , flags );
83
+ private static JfrEvent create (String name , JfrEventFlags ... flags ) {
84
+ return new JfrEvent (name , - 1 , flags );
84
85
}
85
86
86
87
@ Platforms (Platform .HOSTED_ONLY .class )
87
- private JfrEvent (String name , JfrEventFlags ... flags ) {
88
+ private static JfrEvent create (String name , int skipCount , JfrEventFlags ... flags ) {
89
+ return new JfrEvent (name , skipCount , flags );
90
+ }
91
+
92
+ @ Platforms (Platform .HOSTED_ONLY .class )
93
+ private JfrEvent (String name , int skipCount , JfrEventFlags ... flags ) {
88
94
this .id = JfrMetadataTypeLibrary .lookupPlatformEvent (name );
89
95
this .name = name ;
90
96
this .flags = EnumBitmask .computeBitmask (flags );
97
+ this .skipCount = skipCount ;
91
98
}
92
99
93
100
@ Uninterruptible (reason = CALLED_FROM_UNINTERRUPTIBLE_CODE , mayBeInlined = true )
94
101
public long getId () {
95
102
return id ;
96
103
}
97
104
105
+ @ Uninterruptible (reason = CALLED_FROM_UNINTERRUPTIBLE_CODE , mayBeInlined = true )
106
+ public int getSkipCount () {
107
+ assert skipCount >= 0 : "method may only be called for events that need a stack trace" ;
108
+ return skipCount ;
109
+ }
110
+
98
111
@ Uninterruptible (reason = CALLED_FROM_UNINTERRUPTIBLE_CODE , mayBeInlined = true )
99
112
public String getName () {
100
113
return name ;
0 commit comments