1 /*
   2  * Copyright (c) 2015, 2018, 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 VMException = PREFIX + "JavaErrorThrow";
  58     public final static String ThreadStart = PREFIX + "ThreadStart";
  59     public final static String ThreadEnd = PREFIX + "ThreadEnd";
  60     public final static String ThreadSleep = PREFIX + "ThreadSleep";
  61     public final static String ThreadPark = PREFIX + "ThreadPark";
  62     public final static String JavaMonitorEnter = PREFIX + "JavaMonitorEnter";
  63     public final static String JavaMonitorWait = PREFIX + "JavaMonitorWait";
  64     public final static String JavaMonitorInflate = PREFIX + "JavaMonitorInflate";
  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 SafepointStateSyncronization = PREFIX + "SafepointStateSynchronization";
  70     public final static String SafepointWaitBlocked = PREFIX + "SafepointWaitBlocked";
  71     public final static String SafepointCleanup = PREFIX + "SafepointCleanup";
  72     public final static String SafepointCleanupTask = PREFIX + "SafepointCleanupTask";
  73     public final static String SafepointEnd = PREFIX + "SafepointEnd";
  74     public final static String ExecuteVMOperation = PREFIX + "ExecuteVMOperation";
  75     public final static String Shutdown = PREFIX + "Shutdown";
  76     public final static String VMError = PREFIX + "VMError";
  77     public final static String JavaThreadStatistics = PREFIX + "JavaThreadStatistics";
  78     public final static String ClassLoadingStatistics = PREFIX + "ClassLoadingStatistics";
  79     public final static String ClassLoaderStatistics = PREFIX + "ClassLoaderStatistics";
  80     public final static String ThreadAllocationStatistics = PREFIX + "ThreadAllocationStatistics";
  81     public final static String ExecutionSample = PREFIX + "ExecutionSample";
  82     public final static String NativeMethodSample = PREFIX + "NativeMethodSample";
  83     public final static String ExecutionSampling = PREFIX + "ExecutionSampling";
  84     public final static String ThreadDump = PREFIX + "ThreadDump";
  85     public final static String OldObjectSample = PREFIX + "OldObjectSample";
  86     public final static String BiasedLockRevocation = PREFIX + "BiasedLockRevocation";
  87     public final static String BiasedLockSelfRevocation = PREFIX + "BiasedLockSelfRevocation";
  88     public final static String BiasedLockClassRevocation = PREFIX + "BiasedLockClassRevocation";
  89 
  90     // GC
  91     public final static String GCHeapSummary = PREFIX + "GCHeapSummary";
  92     public final static String MetaspaceSummary = PREFIX + "MetaspaceSummary";
  93     public final static String MetaspaceGCThreshold = PREFIX + "MetaspaceGCThreshold";
  94     public final static String MetaspaceAllocationFailure = PREFIX + "MetaspaceAllocationFailure";
  95     public final static String MetaspaceOOM = PREFIX + "MetaspaceOOM";
  96     public final static String MetaspaceChunkFreeListSummary = PREFIX + "MetaspaceChunkFreeListSummary";
  97     public final static String PSHeapSummary = PREFIX + "PSHeapSummary";
  98     public final static String G1HeapSummary = PREFIX + "G1HeapSummary";
  99     public final static String G1HeapRegionInformation = PREFIX + "G1HeapRegionInformation";
 100     public final static String G1HeapRegionTypeChange = PREFIX + "G1HeapRegionTypeChange";
 101     public final static String TenuringDistribution = PREFIX + "TenuringDistribution";
 102     public final static String GarbageCollection = PREFIX + "GarbageCollection";
 103     public final static String ParallelOldCollection = PREFIX + "ParallelOldGarbageCollection";
 104     public final static String YoungGarbageCollection = PREFIX + "YoungGarbageCollection";
 105     public final static String OldGarbageCollection = PREFIX + "OldGarbageCollection";
 106     public final static String G1GarbageCollection = PREFIX + "G1GarbageCollection";
 107     public final static String G1MMU = PREFIX + "G1MMU";
 108     public final static String EvacuationInfo = PREFIX + "EvacuationInfo";
 109     public final static String GCReferenceStatistics = PREFIX + "GCReferenceStatistics";
 110     public final static String ObjectCountAfterGC = PREFIX + "ObjectCountAfterGC";
 111     public final static String PromoteObjectInNewPLAB = PREFIX + "PromoteObjectInNewPLAB";
 112     public final static String PromoteObjectOutsidePLAB = PREFIX + "PromoteObjectOutsidePLAB";
 113     public final static String PromotionFailed = PREFIX + "PromotionFailed";
 114     public final static String EvacuationFailed = PREFIX + "EvacuationFailed";
 115     public final static String ConcurrentModeFailure = PREFIX + "ConcurrentModeFailure";
 116     public final static String GCPhasePause = PREFIX + "GCPhasePause";
 117     public final static String GCPhasePauseLevel1 = PREFIX + "GCPhasePauseLevel1";
 118     public final static String GCPhasePauseLevel2 = PREFIX + "GCPhasePauseLevel2";
 119     public final static String GCPhasePauseLevel3 = PREFIX + "GCPhasePauseLevel3";
 120     public final static String ObjectCount = PREFIX + "ObjectCount";
 121     public final static String GCConfiguration = PREFIX + "GCConfiguration";
 122     public final static String GCSurvivorConfiguration = PREFIX + "GCSurvivorConfiguration";
 123     public final static String GCTLABConfiguration = PREFIX + "GCTLABConfiguration";
 124     public final static String GCHeapConfiguration = PREFIX + "GCHeapConfiguration";
 125     public final static String YoungGenerationConfiguration = PREFIX + "YoungGenerationConfiguration";
 126     public final static String G1AdaptiveIHOP = PREFIX + "G1AdaptiveIHOP";
 127     public final static String G1EvacuationYoungStatistics = PREFIX + "G1EvacuationYoungStatistics";
 128     public final static String G1EvacuationOldStatistics = PREFIX + "G1EvacuationOldStatistics";
 129     public final static String G1BasicIHOP = PREFIX + "G1BasicIHOP";
 130     public final static String AllocationRequiringGC = PREFIX + "AllocationRequiringGC";
 131 
 132     // Compiler
 133     public final static String Compilation = PREFIX + "Compilation";
 134     public final static String CompilerPhase = PREFIX + "CompilerPhase";
 135     public final static String CompilationFailure = PREFIX + "CompilationFailure";
 136     public final static String CompilerInlining = PREFIX + "CompilerInlining";
 137     public final static String CompilerStatistics = PREFIX + "CompilerStatistics";
 138     public final static String CompilerConfig = PREFIX + "CompilerConfiguration";
 139     public final static String CodeCacheStatistics = PREFIX + "CodeCacheStatistics";
 140     public final static String CodeCacheConfiguration = PREFIX + "CodeCacheConfiguration";
 141     public final static String CodeSweeperStatistics = PREFIX + "CodeSweeperStatistics";
 142     public final static String CodeSweeperConfiguration = PREFIX + "CodeSweeperConfiguration";
 143     public final static String SweepCodeCache = PREFIX + "SweepCodeCache";
 144     public final static String CodeCacheFull = PREFIX + "CodeCacheFull";
 145     public final static String ObjectAllocationInNewTLAB = PREFIX + "ObjectAllocationInNewTLAB";
 146     public final static String ObjectAllocationOutsideTLAB = PREFIX + "ObjectAllocationOutsideTLAB";
 147 
 148     // OS
 149     public final static String OSInformation = PREFIX + "OSInformation";
 150     public final static String CPUInformation = PREFIX + "CPUInformation";
 151     public final static String CPULoad = PREFIX + "CPULoad";
 152     public final static String ThreadCPULoad = PREFIX + "ThreadCPULoad";
 153     public final static String SystemProcess = PREFIX + "SystemProcess";
 154     public final static String ThreadContextSwitchRate = PREFIX + "ThreadContextSwitchRate";
 155     public final static String InitialEnvironmentVariable = PREFIX + "InitialEnvironmentVariable";
 156     public final static String NativeLibrary = PREFIX + "NativeLibrary";
 157     public final static String PhysicalMemory = PREFIX + "PhysicalMemory";
 158     public final static String NetworkUtilization = PREFIX + "NetworkUtilization";
 159 
 160     // JDK
 161     public static final String FileForce  = PREFIX + "FileForce";
 162     public static final String FileRead = PREFIX + "FileRead";
 163     public static final String FileWrite = PREFIX + "FileWrite";
 164     public static final String SocketRead = PREFIX + "SocketRead";
 165     public static final String SocketWrite = PREFIX + "SocketWrite";
 166     public final static String ExceptionStatistics = PREFIX + "ExceptionStatistics";
 167     public final static String JavaExceptionThrow = PREFIX + "JavaExceptionThrow";
 168     public final static String JavaErrorThrow = PREFIX + "JavaErrorThrow";
 169     public final static String ModuleRequire = PREFIX + "ModuleRequire";
 170     public final static String ModuleExport = PREFIX + "ModuleExport";
 171     public final static String TLSHandshake = PREFIX + "TLSHandshake";
 172     public final static String X509Certificate = PREFIX + "X509Certificate";
 173     public final static String X509Validation = PREFIX + "X509Validation";
 174     public final static String SecurityProperty = PREFIX + "SecurityPropertyModification";
 175 
 176     // Flight Recorder
 177     public final static String DumpReason = PREFIX + "DumpReason";
 178     public final static String DataLoss = PREFIX + "DataLoss";
 179     public final static String CPUTimeStampCounter = PREFIX + "CPUTimeStampCounter";
 180     public final static String ActiveRecording = PREFIX + "ActiveRecording";
 181     public final static String ActiveSetting = PREFIX + "ActiveSetting";
 182 
 183     public static boolean isGcEvent(EventType et) {
 184         return et.getCategoryNames().contains(GC_CATEGORY);
 185     }
 186 
 187 }