1 /*
  2  * Copyright (c) 2015, 2023, Oracle and/or its affiliates. All rights reserved.
  3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  4  *
  5  * This code is free software; you can redistribute it and/or modify it
  6  * under the terms of the GNU General Public License version 2 only, as
  7  * published by the Free Software Foundation.  Oracle designates this
  8  * particular file as subject to the "Classpath" exception as provided
  9  * by Oracle in the LICENSE file that accompanied this code.
 10  *
 11  * This code is distributed in the hope that it will be useful, but WITHOUT
 12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 14  * version 2 for more details (a copy is included in the LICENSE file that
 15  * accompanied this code).
 16  *
 17  * You should have received a copy of the GNU General Public License version
 18  * 2 along with this work; if not, write to the Free Software Foundation,
 19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
 20  *
 21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
 22  * or visit www.oracle.com if you need additional information or have any
 23  * questions.
 24  */
 25 package jdk.test.lib.jfr;
 26 
 27 import jdk.jfr.EventType;
 28 
 29 /**
 30  * Contains id for events that are shipped with the JDK.
 31  *
 32  */
 33 public class EventNames {
 34 
 35     public static final String PREFIX = "jdk.";
 36     private static final String GC_CATEGORY = "GC";
 37 
 38     // JVM Configuration
 39     public static final String JVMInformation = PREFIX + "JVMInformation";
 40     public static final String InitialSystemProperty = PREFIX + "InitialSystemProperty";
 41     public static final String IntFlag = PREFIX + "IntFlag";
 42     public static final String UnsignedIntFlag = PREFIX + "UnsignedIntFlag";
 43     public static final String LongFlag = PREFIX + "LongFlag";
 44     public static final String UnsignedLongFlag = PREFIX + "UnsignedLongFlag";
 45     public static final String DoubleFlag = PREFIX + "DoubleFlag";
 46     public static final String BooleanFlag = PREFIX + "BooleanFlag";
 47     public static final String StringFlag = PREFIX + "StringFlag";
 48     public static final String IntFlagChanged = PREFIX + "IntFlagChanged";
 49     public static final String UnsignedIntFlagChanged = PREFIX + "UnsignedIntFlagChanged";
 50     public static final String LongFlagChanged = PREFIX + "LongFlagChanged";
 51     public static final String UnsignedLongFlagChanged = PREFIX + "UnsignedLongFlagChanged";
 52     public static final String DoubleFlagChanged = PREFIX + "DoubleFlagChanged";
 53     public static final String BooleanFlagChanged = PREFIX + "BooleanFlagChanged";
 54     public static final String StringFlagChanged = PREFIX + "StringFlagChanged";
 55 
 56     // Runtime
 57     public static final String ThreadStart = PREFIX + "ThreadStart";
 58     public static final String ThreadEnd = PREFIX + "ThreadEnd";
 59     public static final String ThreadSleep = PREFIX + "ThreadSleep";
 60     public static final String ThreadPark = PREFIX + "ThreadPark";
 61     public static final String JavaMonitorEnter = PREFIX + "JavaMonitorEnter";
 62     public static final String JavaMonitorWait = PREFIX + "JavaMonitorWait";
 63     public static final String JavaMonitorInflate = PREFIX + "JavaMonitorInflate";
 64     public static final String SyncOnValueBasedClass = PREFIX + "SyncOnValueBasedClass";
 65     public static final String ClassLoad = PREFIX + "ClassLoad";
 66     public static final String ClassDefine = PREFIX + "ClassDefine";
 67     public static final String ClassUnload = PREFIX + "ClassUnload";
 68     public static final String SafepointBegin = PREFIX + "SafepointBegin";
 69     public static final String SafepointStateSynchronization = PREFIX + "SafepointStateSynchronization";
 70     public static final String SafepointCleanup = PREFIX + "SafepointCleanup";
 71     public static final String SafepointCleanupTask = PREFIX + "SafepointCleanupTask";
 72     public static final String SafepointEnd = PREFIX + "SafepointEnd";
 73     public static final String ExecuteVMOperation = PREFIX + "ExecuteVMOperation";
 74     public static final String Shutdown = PREFIX + "Shutdown";
 75     public static final String JavaThreadStatistics = PREFIX + "JavaThreadStatistics";
 76     public static final String ClassLoadingStatistics = PREFIX + "ClassLoadingStatistics";
 77     public static final String ClassLoaderStatistics = PREFIX + "ClassLoaderStatistics";
 78     public static final String ThreadAllocationStatistics = PREFIX + "ThreadAllocationStatistics";
 79     public static final String ExecutionSample = PREFIX + "ExecutionSample";
 80     public static final String NativeMethodSample = PREFIX + "NativeMethodSample";
 81     public static final String ThreadDump = PREFIX + "ThreadDump";
 82     public static final String OldObjectSample = PREFIX + "OldObjectSample";
 83     public static final String SymbolTableStatistics = PREFIX + "SymbolTableStatistics";
 84     public static final String StringTableStatistics = PREFIX + "StringTableStatistics";
 85     public static final String RedefineClasses = PREFIX + "RedefineClasses";
 86     public static final String RetransformClasses = PREFIX + "RetransformClasses";
 87     public static final String ClassRedefinition = PREFIX + "ClassRedefinition";
 88     public static final String FinalizerStatistics = PREFIX + "FinalizerStatistics";
 89     public static final String NativeMemoryUsage = PREFIX + "NativeMemoryUsage";
 90     public static final String NativeMemoryUsageTotal = PREFIX + "NativeMemoryUsageTotal";
 91     public static final String JavaAgent = PREFIX + "JavaAgent";
 92     public static final String NativeAgent = PREFIX + "NativeAgent";
 93 
 94     // This event is hard to test
 95     public static final String ReservedStackActivation = PREFIX + "ReservedStackActivation";
 96 
 97     // GC
 98     public static final String GCHeapMemoryUsage = PREFIX + "GCHeapMemoryUsage";
 99     public static final String GCHeapMemoryPoolUsage = PREFIX + "GCHeapMemoryPoolUsage";
100     public static final String GCHeapSummary = PREFIX + "GCHeapSummary";
101     public static final String MetaspaceSummary = PREFIX + "MetaspaceSummary";
102     public static final String MetaspaceGCThreshold = PREFIX + "MetaspaceGCThreshold";
103     public static final String MetaspaceAllocationFailure = PREFIX + "MetaspaceAllocationFailure";
104     public static final String MetaspaceOOM = PREFIX + "MetaspaceOOM";
105     public static final String MetaspaceChunkFreeListSummary = PREFIX + "MetaspaceChunkFreeListSummary";
106     public static final String PSHeapSummary = PREFIX + "PSHeapSummary";
107     public static final String G1HeapSummary = PREFIX + "G1HeapSummary";
108     public static final String G1HeapRegionInformation = PREFIX + "G1HeapRegionInformation";
109     public static final String G1HeapRegionTypeChange = PREFIX + "G1HeapRegionTypeChange";
110     public static final String ShenandoahHeapRegionInformation = PREFIX + "ShenandoahHeapRegionInformation";
111     public static final String ShenandoahHeapRegionStateChange = PREFIX + "ShenandoahHeapRegionStateChange";
112     public static final String TenuringDistribution = PREFIX + "TenuringDistribution";
113     public static final String GarbageCollection = PREFIX + "GarbageCollection";
114     public static final String ParallelOldGarbageCollection = PREFIX + "ParallelOldGarbageCollection";
115     public static final String ParallelOldCollection = ParallelOldGarbageCollection;
116     public static final String YoungGarbageCollection = PREFIX + "YoungGarbageCollection";
117     public static final String OldGarbageCollection = PREFIX + "OldGarbageCollection";
118     public static final String G1GarbageCollection = PREFIX + "G1GarbageCollection";
119     public static final String G1MMU = PREFIX + "G1MMU";
120     public static final String EvacuationInformation = PREFIX + "EvacuationInformation";
121     public static final String GCReferenceStatistics = PREFIX + "GCReferenceStatistics";
122     public static final String ObjectCountAfterGC = PREFIX + "ObjectCountAfterGC";
123     public static final String PromoteObjectInNewPLAB = PREFIX + "PromoteObjectInNewPLAB";
124     public static final String PromoteObjectOutsidePLAB = PREFIX + "PromoteObjectOutsidePLAB";
125     public static final String PromotionFailed = PREFIX + "PromotionFailed";
126     public static final String EvacuationFailed = PREFIX + "EvacuationFailed";
127     public static final String ConcurrentModeFailure = PREFIX + "ConcurrentModeFailure";
128     public static final String GCPhasePause = PREFIX + "GCPhasePause";
129     public static final String GCPhasePauseLevel1 = PREFIX + "GCPhasePauseLevel1";
130     public static final String GCPhasePauseLevel2 = PREFIX + "GCPhasePauseLevel2";
131     public static final String GCPhasePauseLevel3 = PREFIX + "GCPhasePauseLevel3";
132     public static final String GCPhasePauseLevel4 = PREFIX + "GCPhasePauseLevel4";
133     public static final String ObjectCount = PREFIX + "ObjectCount";
134     public static final String GCConfiguration = PREFIX + "GCConfiguration";
135     public static final String GCSurvivorConfiguration = PREFIX + "GCSurvivorConfiguration";
136     public static final String GCTLABConfiguration = PREFIX + "GCTLABConfiguration";
137     public static final String GCHeapConfiguration = PREFIX + "GCHeapConfiguration";
138     public static final String YoungGenerationConfiguration = PREFIX + "YoungGenerationConfiguration";
139     public static final String G1AdaptiveIHOP = PREFIX + "G1AdaptiveIHOP";
140     public static final String G1EvacuationYoungStatistics = PREFIX + "G1EvacuationYoungStatistics";
141     public static final String G1EvacuationOldStatistics = PREFIX + "G1EvacuationOldStatistics";
142     public static final String G1BasicIHOP = PREFIX + "G1BasicIHOP";
143     public static final String AllocationRequiringGC = PREFIX + "AllocationRequiringGC";
144     public static final String GCPhaseParallel = PREFIX + "GCPhaseParallel";
145     public static final String GCPhaseConcurrent = PREFIX + "GCPhaseConcurrent";
146     public static final String GCPhaseConcurrentLevel1 = PREFIX + "GCPhaseConcurrentLevel1";
147     public static final String GCPhaseConcurrentLevel2 = PREFIX + "GCPhaseConcurrentLevel2";
148     public static final String ZYoungGarbageCollection = PREFIX + "ZYoungGarbageCollection";
149     public static final String ZOldGarbageCollection = PREFIX + "ZOldGarbageCollection";
150     public static final String ZAllocationStall = PREFIX + "ZAllocationStall";
151     public static final String ZPageAllocation = PREFIX + "ZPageAllocation";
152     public static final String ZRelocationSet = PREFIX + "ZRelocationSet";
153     public static final String ZRelocationSetGroup = PREFIX + "ZRelocationSetGroup";
154     public static final String ZUncommit = PREFIX + "ZUncommit";
155     public static final String ZUnmap = PREFIX + "ZUnmap";
156     public static final String GCLocker = PREFIX + "GCLocker";
157     public static final String SystemGC = PREFIX + "SystemGC";
158     public static final String GCCPUTime = PREFIX + "GCCPUTime";
159 
160     // Compiler
161     public static final String Compilation = PREFIX + "Compilation";
162     public static final String CompilerPhase = PREFIX + "CompilerPhase";
163     public static final String CompilationFailure = PREFIX + "CompilationFailure";
164     public static final String CompilerInlining = PREFIX + "CompilerInlining";
165     public static final String CompilerStatistics = PREFIX + "CompilerStatistics";
166     public static final String CompilerConfiguration = PREFIX + "CompilerConfiguration";
167     public static final String CodeCacheStatistics = PREFIX + "CodeCacheStatistics";
168     public static final String CodeCacheConfiguration = PREFIX + "CodeCacheConfiguration";
169     public static final String CodeCacheFull = PREFIX + "CodeCacheFull";
170     public static final String ObjectAllocationInNewTLAB = PREFIX + "ObjectAllocationInNewTLAB";
171     public static final String ObjectAllocationOutsideTLAB = PREFIX + "ObjectAllocationOutsideTLAB";
172     public static final String ObjectAllocationSample = PREFIX + "ObjectAllocationSample";
173     public static final String Deoptimization = PREFIX + "Deoptimization";
174     public static final String JITRestart = PREFIX + "JITRestart";
175 
176     // OS
177     public static final String OSInformation = PREFIX + "OSInformation";
178     public static final String VirtualizationInformation = PREFIX + "VirtualizationInformation";
179     public static final String CPUInformation = PREFIX + "CPUInformation";
180     public static final String CPULoad = PREFIX + "CPULoad";
181     public static final String ThreadCPULoad = PREFIX + "ThreadCPULoad";
182     public static final String SystemProcess = PREFIX + "SystemProcess";
183     public static final String ThreadContextSwitchRate = PREFIX + "ThreadContextSwitchRate";
184     public static final String InitialEnvironmentVariable = PREFIX + "InitialEnvironmentVariable";
185     public static final String NativeLibrary = PREFIX + "NativeLibrary";
186     public static final String PhysicalMemory = PREFIX + "PhysicalMemory";
187     public static final String NetworkUtilization = PREFIX + "NetworkUtilization";
188     public static final String ProcessStart = PREFIX + "ProcessStart";
189     public static final String ResidentSetSize = PREFIX + "ResidentSetSize";
190 
191     // JDK
192     public static final String FileForce  = PREFIX + "FileForce";
193     public static final String FileRead = PREFIX + "FileRead";
194     public static final String FileWrite = PREFIX + "FileWrite";
195     public static final String SocketRead = PREFIX + "SocketRead";
196     public static final String SocketWrite = PREFIX + "SocketWrite";
197     public static final String ExceptionStatistics = PREFIX + "ExceptionStatistics";
198     public static final String JavaExceptionThrow = PREFIX + "JavaExceptionThrow";
199     public static final String JavaErrorThrow = PREFIX + "JavaErrorThrow";
200     public static final String ModuleRequire = PREFIX + "ModuleRequire";
201     public static final String ModuleExport = PREFIX + "ModuleExport";
202     public static final String TLSHandshake = PREFIX + "TLSHandshake";
203     public static final String X509Certificate = PREFIX + "X509Certificate";
204     public static final String X509Validation = PREFIX + "X509Validation";
205     public static final String InitialSecurityProperty = PREFIX + "InitialSecurityProperty";
206     public static final String SecurityProperty = PREFIX + "SecurityPropertyModification";
207     public static final String SecurityProviderService = PREFIX + "SecurityProviderService";
208     public static final String DirectBufferStatistics = PREFIX + "DirectBufferStatistics";
209     public static final String Deserialization = PREFIX + "Deserialization";
210     public static final String VirtualThreadStart = PREFIX + "VirtualThreadStart";
211     public static final String VirtualThreadEnd = PREFIX + "VirtualThreadEnd";
212     public static final String VirtualThreadPinned = PREFIX + "VirtualThreadPinned";
213     public static final String VirtualThreadSubmitFailed = PREFIX + "VirtualThreadSubmitFailed";
214 
215     // Containers
216     public static final String ContainerConfiguration = PREFIX + "ContainerConfiguration";
217     public static final String ContainerCPUUsage = PREFIX + "ContainerCPUUsage";
218     public static final String ContainerCPUThrottling = PREFIX + "ContainerCPUThrottling";
219     public static final String ContainerMemoryUsage = PREFIX + "ContainerMemoryUsage";
220     public static final String ContainerIOUsage = PREFIX + "ContainerIOUsage";
221 
222     // Flight Recorder
223     public static final String DumpReason = PREFIX + "DumpReason";
224     public static final String DataLoss = PREFIX + "DataLoss";
225     public static final String CPUTimeStampCounter = PREFIX + "CPUTimeStampCounter";
226     public static final String ActiveRecording = PREFIX + "ActiveRecording";
227     public static final String ActiveSetting = PREFIX + "ActiveSetting";
228     public static final String Flush = PREFIX + "Flush";
229 
230     // Diagnostics
231     public static final String HeapDump = PREFIX + "HeapDump";
232 
233     public static boolean isGcEvent(EventType et) {
234         return et.getCategoryNames().contains(GC_CATEGORY);
235     }
236 
237 }