1 /*
  2  * Copyright (c) 2015, 2021, 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 final static String PREFIX = "jdk.";
 36     private static final String GC_CATEGORY = "GC";
 37 
 38     // JVM Configuration
 39     public final static String JVMInformation = PREFIX + "JVMInformation";
 40     public final static String InitialSystemProperty = PREFIX + "InitialSystemProperty";
 41     public final static String IntFlag = PREFIX + "IntFlag";
 42     public final static String UnsignedIntFlag = PREFIX + "UnsignedIntFlag";
 43     public final static String LongFlag = PREFIX + "LongFlag";
 44     public final static String UnsignedLongFlag = PREFIX + "UnsignedLongFlag";
 45     public final static String DoubleFlag = PREFIX + "DoubleFlag";
 46     public final static String BooleanFlag = PREFIX + "BooleanFlag";
 47     public final static String StringFlag = PREFIX + "StringFlag";
 48     public final static String IntFlagChanged = PREFIX + "IntFlagChanged";
 49     public final static String UnsignedIntFlagChanged = PREFIX + "UnsignedIntFlagChanged";
 50     public final static String LongFlagChanged = PREFIX + "LongFlagChanged";
 51     public final static String UnsignedLongFlagChanged = PREFIX + "UnsignedLongFlagChanged";
 52     public final static String DoubleFlagChanged = PREFIX + "DoubleFlagChanged";
 53     public final static String BooleanFlagChanged = PREFIX + "BooleanFlagChanged";
 54     public final static String StringFlagChanged = PREFIX + "StringFlagChanged";
 55 
 56     // Runtime
 57     public final static String ThreadStart = PREFIX + "ThreadStart";
 58     public final static String ThreadEnd = PREFIX + "ThreadEnd";
 59     public final static String ThreadSleep = PREFIX + "ThreadSleep";
 60     public final static String ThreadPark = PREFIX + "ThreadPark";
 61     public final static String JavaMonitorEnter = PREFIX + "JavaMonitorEnter";
 62     public final static String JavaMonitorWait = PREFIX + "JavaMonitorWait";
 63     public final static String JavaMonitorInflate = PREFIX + "JavaMonitorInflate";
 64     public final static String SyncOnValueBasedClass = PREFIX + "SyncOnValueBasedClass";
 65     public final static String ClassLoad = PREFIX + "ClassLoad";
 66     public final static String ClassDefine = PREFIX + "ClassDefine";
 67     public final static String ClassUnload = PREFIX + "ClassUnload";
 68     public final static String SafepointBegin = PREFIX + "SafepointBegin";
 69     public final static String SafepointStateSynchronization = PREFIX + "SafepointStateSynchronization";
 70     public final static String SafepointCleanup = PREFIX + "SafepointCleanup";
 71     public final static String SafepointCleanupTask = PREFIX + "SafepointCleanupTask";
 72     public final static String SafepointEnd = PREFIX + "SafepointEnd";
 73     public final static String ExecuteVMOperation = PREFIX + "ExecuteVMOperation";
 74     public final static String Shutdown = PREFIX + "Shutdown";
 75     public final static String JavaThreadStatistics = PREFIX + "JavaThreadStatistics";
 76     public final static String ClassLoadingStatistics = PREFIX + "ClassLoadingStatistics";
 77     public final static String ClassLoaderStatistics = PREFIX + "ClassLoaderStatistics";
 78     public final static String ThreadAllocationStatistics = PREFIX + "ThreadAllocationStatistics";
 79     public final static String ExecutionSample = PREFIX + "ExecutionSample";
 80     public final static String NativeMethodSample = PREFIX + "NativeMethodSample";
 81     public final static String ThreadDump = PREFIX + "ThreadDump";
 82     public final static String OldObjectSample = PREFIX + "OldObjectSample";
 83     public final static String SymbolTableStatistics = PREFIX + "SymbolTableStatistics";
 84     public final static String StringTableStatistics = PREFIX + "StringTableStatistics";
 85     public final static String PlaceholderTableStatistics = PREFIX + "PlaceholderTableStatistics";
 86     public final static String LoaderConstraintsTableStatistics = PREFIX + "LoaderConstraintsTableStatistics";
 87     public final static String ProtectionDomainCacheTableStatistics = PREFIX + "ProtectionDomainCacheTableStatistics";
 88     public static final String RedefineClasses = PREFIX + "RedefineClasses";
 89     public static final String RetransformClasses = PREFIX + "RetransformClasses";
 90     public static final String ClassRedefinition = PREFIX + "ClassRedefinition";
 91     public static final String FinalizerStatistics = PREFIX + "FinalizerStatistics";
 92 
 93     // This event is hard to test
 94     public final static String ReservedStackActivation = PREFIX + "ReservedStackActivation";
 95 
 96     // GC
 97     public final static String GCHeapSummary = PREFIX + "GCHeapSummary";
 98     public final static String MetaspaceSummary = PREFIX + "MetaspaceSummary";
 99     public final static String MetaspaceGCThreshold = PREFIX + "MetaspaceGCThreshold";
100     public final static String MetaspaceAllocationFailure = PREFIX + "MetaspaceAllocationFailure";
101     public final static String MetaspaceOOM = PREFIX + "MetaspaceOOM";
102     public final static String MetaspaceChunkFreeListSummary = PREFIX + "MetaspaceChunkFreeListSummary";
103     public final static String PSHeapSummary = PREFIX + "PSHeapSummary";
104     public final static String G1HeapSummary = PREFIX + "G1HeapSummary";
105     public final static String G1HeapRegionInformation = PREFIX + "G1HeapRegionInformation";
106     public final static String G1HeapRegionTypeChange = PREFIX + "G1HeapRegionTypeChange";
107     public final static String ShenandoahHeapRegionInformation = PREFIX + "ShenandoahHeapRegionInformation";
108     public final static String ShenandoahHeapRegionStateChange = PREFIX + "ShenandoahHeapRegionStateChange";
109     public final static String TenuringDistribution = PREFIX + "TenuringDistribution";
110     public final static String GarbageCollection = PREFIX + "GarbageCollection";
111     public final static String ParallelOldGarbageCollection = PREFIX + "ParallelOldGarbageCollection";
112     public final static String ParallelOldCollection = ParallelOldGarbageCollection;
113     public final static String YoungGarbageCollection = PREFIX + "YoungGarbageCollection";
114     public final static String OldGarbageCollection = PREFIX + "OldGarbageCollection";
115     public final static String G1GarbageCollection = PREFIX + "G1GarbageCollection";
116     public final static String G1MMU = PREFIX + "G1MMU";
117     public final static String EvacuationInformation = PREFIX + "EvacuationInformation";
118     public final static String GCReferenceStatistics = PREFIX + "GCReferenceStatistics";
119     public final static String ObjectCountAfterGC = PREFIX + "ObjectCountAfterGC";
120     public final static String PromoteObjectInNewPLAB = PREFIX + "PromoteObjectInNewPLAB";
121     public final static String PromoteObjectOutsidePLAB = PREFIX + "PromoteObjectOutsidePLAB";
122     public final static String PromotionFailed = PREFIX + "PromotionFailed";
123     public final static String EvacuationFailed = PREFIX + "EvacuationFailed";
124     public final static String ConcurrentModeFailure = PREFIX + "ConcurrentModeFailure";
125     public final static String GCPhasePause = PREFIX + "GCPhasePause";
126     public final static String GCPhasePauseLevel1 = PREFIX + "GCPhasePauseLevel1";
127     public final static String GCPhasePauseLevel2 = PREFIX + "GCPhasePauseLevel2";
128     public final static String GCPhasePauseLevel3 = PREFIX + "GCPhasePauseLevel3";
129     public final static String GCPhasePauseLevel4 = PREFIX + "GCPhasePauseLevel4";
130     public final static String ObjectCount = PREFIX + "ObjectCount";
131     public final static String GCConfiguration = PREFIX + "GCConfiguration";
132     public final static String GCSurvivorConfiguration = PREFIX + "GCSurvivorConfiguration";
133     public final static String GCTLABConfiguration = PREFIX + "GCTLABConfiguration";
134     public final static String GCHeapConfiguration = PREFIX + "GCHeapConfiguration";
135     public final static String YoungGenerationConfiguration = PREFIX + "YoungGenerationConfiguration";
136     public final static String G1AdaptiveIHOP = PREFIX + "G1AdaptiveIHOP";
137     public final static String G1EvacuationYoungStatistics = PREFIX + "G1EvacuationYoungStatistics";
138     public final static String G1EvacuationOldStatistics = PREFIX + "G1EvacuationOldStatistics";
139     public final static String G1BasicIHOP = PREFIX + "G1BasicIHOP";
140     public final static String AllocationRequiringGC = PREFIX + "AllocationRequiringGC";
141     public final static String GCPhaseParallel = PREFIX + "GCPhaseParallel";
142     public final static String GCPhaseConcurrent = PREFIX + "GCPhaseConcurrent";
143     public final static String GCPhaseConcurrentLevel1 = PREFIX + "GCPhaseConcurrentLevel1";
144     public final static String ZAllocationStall = PREFIX + "ZAllocationStall";
145     public final static String ZPageAllocation = PREFIX + "ZPageAllocation";
146     public final static String ZRelocationSet = PREFIX + "ZRelocationSet";
147     public final static String ZRelocationSetGroup = PREFIX + "ZRelocationSetGroup";
148     public final static String ZUncommit = PREFIX + "ZUncommit";
149     public final static String ZUnmap = PREFIX + "ZUnmap";
150     public final static String GCLocker = PREFIX + "GCLocker";
151     public static final String SystemGC = PREFIX + "SystemGC";
152 
153     // Compiler
154     public final static String Compilation = PREFIX + "Compilation";
155     public final static String CompilerPhase = PREFIX + "CompilerPhase";
156     public final static String CompilationFailure = PREFIX + "CompilationFailure";
157     public final static String CompilerInlining = PREFIX + "CompilerInlining";
158     public final static String CompilerStatistics = PREFIX + "CompilerStatistics";
159     public final static String CompilerConfiguration = PREFIX + "CompilerConfiguration";
160     public final static String CodeCacheStatistics = PREFIX + "CodeCacheStatistics";
161     public final static String CodeCacheConfiguration = PREFIX + "CodeCacheConfiguration";
162     public final static String CodeSweeperStatistics = PREFIX + "CodeSweeperStatistics";
163     public final static String CodeSweeperConfiguration = PREFIX + "CodeSweeperConfiguration";
164     public final static String SweepCodeCache = PREFIX + "SweepCodeCache";
165     public final static String CodeCacheFull = PREFIX + "CodeCacheFull";
166     public final static String ObjectAllocationInNewTLAB = PREFIX + "ObjectAllocationInNewTLAB";
167     public final static String ObjectAllocationOutsideTLAB = PREFIX + "ObjectAllocationOutsideTLAB";
168     public final static String ObjectAllocationSample = PREFIX + "ObjectAllocationSample";
169     public final static String Deoptimization = PREFIX + "Deoptimization";
170 
171     // OS
172     public final static String OSInformation = PREFIX + "OSInformation";
173     public final static String VirtualizationInformation = PREFIX + "VirtualizationInformation";
174     public final static String CPUInformation = PREFIX + "CPUInformation";
175     public final static String CPULoad = PREFIX + "CPULoad";
176     public final static String ThreadCPULoad = PREFIX + "ThreadCPULoad";
177     public final static String SystemProcess = PREFIX + "SystemProcess";
178     public final static String ThreadContextSwitchRate = PREFIX + "ThreadContextSwitchRate";
179     public final static String InitialEnvironmentVariable = PREFIX + "InitialEnvironmentVariable";
180     public final static String NativeLibrary = PREFIX + "NativeLibrary";
181     public final static String PhysicalMemory = PREFIX + "PhysicalMemory";
182     public final static String NetworkUtilization = PREFIX + "NetworkUtilization";
183     public static final String ProcessStart = PREFIX + "ProcessStart";
184 
185     // JDK
186     public static final String FileForce  = PREFIX + "FileForce";
187     public static final String FileRead = PREFIX + "FileRead";
188     public static final String FileWrite = PREFIX + "FileWrite";
189     public static final String SocketRead = PREFIX + "SocketRead";
190     public static final String SocketWrite = PREFIX + "SocketWrite";
191     public final static String ExceptionStatistics = PREFIX + "ExceptionStatistics";
192     public final static String JavaExceptionThrow = PREFIX + "JavaExceptionThrow";
193     public final static String JavaErrorThrow = PREFIX + "JavaErrorThrow";
194     public final static String ModuleRequire = PREFIX + "ModuleRequire";
195     public final static String ModuleExport = PREFIX + "ModuleExport";
196     public final static String TLSHandshake = PREFIX + "TLSHandshake";
197     public final static String X509Certificate = PREFIX + "X509Certificate";
198     public final static String X509Validation = PREFIX + "X509Validation";
199     public final static String SecurityProperty = PREFIX + "SecurityPropertyModification";
200     public final static String DirectBufferStatistics = PREFIX + "DirectBufferStatistics";
201     public final static String Deserialization = PREFIX + "Deserialization";
202     public static final String VirtualThreadStart = PREFIX + "VirtualThreadStart";
203     public static final String VirtualThreadEnd = PREFIX + "VirtualThreadEnd";
204     public static final String VirtualThreadPinned = PREFIX + "VirtualThreadPinned";
205     public static final String VirtualThreadSubmitFailed = PREFIX + "VirtualThreadSubmitFailed";
206     
207     // Containers
208     public static final String ContainerConfiguration = PREFIX + "ContainerConfiguration";
209     public static final String ContainerCPUUsage = PREFIX + "ContainerCPUUsage";
210     public static final String ContainerCPUThrottling = PREFIX + "ContainerCPUThrottling";
211     public static final String ContainerMemoryUsage = PREFIX + "ContainerMemoryUsage";
212     public static final String ContainerIOUsage = PREFIX + "ContainerIOUsage";
213 
214     // Flight Recorder
215     public final static String DumpReason = PREFIX + "DumpReason";
216     public final static String DataLoss = PREFIX + "DataLoss";
217     public final static String CPUTimeStampCounter = PREFIX + "CPUTimeStampCounter";
218     public final static String ActiveRecording = PREFIX + "ActiveRecording";
219     public final static String ActiveSetting = PREFIX + "ActiveSetting";
220     public static final String Flush = PREFIX + "Flush";
221 
222     // Diagnostics
223     public static final String HeapDump = PREFIX + "HeapDump";
224 
225     public static boolean isGcEvent(EventType et) {
226         return et.getCategoryNames().contains(GC_CATEGORY);
227     }
228 
229 }