1 /*
   2  * Copyright (c) 2015, 2019, 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.testlibrary.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 = "com.oracle.jdk.";
  36     private static final String GC_CATEGORY = "GC";
  37 
  38     // JVM Configuration
  39     public final static String JVMInformation = PREFIX + "JVMInformation"; // "vm.info";
  40     public final static String InitialSystemProperty = PREFIX + "InitialSystemProperty";// "vm.initial_system_property";
  41     public final static String IntFlag = PREFIX + "IntFlag"; // "vm.flag.int";
  42     public final static String UnsignedIntFlag = PREFIX + "UnsignedIntFlag"; // "vm.flag.uint";
  43     public final static String LongFlag = PREFIX + "LongFlag"; // "vm.flag.long";
  44     public final static String UnsignedLongFlag = PREFIX + "UnsignedLongFlag"; // "vm.flag.ulong";
  45     public final static String DoubleFlag = PREFIX + "DoubleFlag"; // "vm.flag.double";
  46     public final static String BooleanFlag = PREFIX + "BooleanFlag"; // vm.flag.boolean";
  47     public final static String StringFlag = PREFIX + "StringFlag"; // vm.flag.string";
  48     public final static String IntFlagChanged = PREFIX + "IntFlagChanged"; // vm.flag.int_changed";
  49     public final static String UnsignedIntFlagChanged = PREFIX + "UnsignedIntFlagChanged"; // "vm.flag.uint_changed";
  50     public final static String LongFlagChanged = PREFIX + "LongFlagChanged"; // "vm.flag.long_changed";
  51     public final static String UnsignedLongFlagChanged = PREFIX + "UnsignedLongFlagChanged"; // "vm.flag.ulong_changed";
  52     public final static String DoubleFlagChanged = PREFIX + "DoubleFlagChanged"; // vm.flag.double_changed";
  53     public final static String BooleanFlagChanged = PREFIX + "BooleanFlagChanged"; // "vm.flag.boolean_changed";
  54     public final static String StringFlagChanged = PREFIX + "StringFlagChanged"; // "vm.flag.string_changed";
  55 
  56     // Runtime
  57     public final static String VMException = PREFIX + "JavaErrorThrow"; // java.vm.exception_throw";
  58     public final static String ThreadStart = PREFIX + "ThreadStart";// "java.thread_start";
  59     public final static String ThreadEnd = PREFIX + "ThreadEnd";// "java.thread_end";
  60     public final static String ThreadSleep = PREFIX + "ThreadSleep"; // "java.thread_sleep";
  61     public final static String ThreadPark = PREFIX + "ThreadPark"; // "java.thread_park";
  62     public final static String JavaMonitorEnter = PREFIX + "JavaMonitorEnter"; // "java.monitor_enter";
  63     public final static String JavaMonitorWait = PREFIX + "JavaMonitorWait"; // "java.monitor_wait";
  64     public final static String JavaMonitorInflate = PREFIX + "JavaMonitorInflate"; // "java.monitor_inflate";
  65     public final static String ClassLoad = PREFIX + "ClassLoad"; // "vm.class.load";
  66     public final static String ClassDefine = PREFIX + "ClassDefine";// "vm.class.define";
  67     public final static String ClassUnload = PREFIX + "ClassUnload";// "vm.class.unload";
  68     public final static String SafepointBegin = PREFIX + "SafepointBegin";// "vm.runtime.safepoint.begin";
  69     public final static String SafepointStateSyncronization = PREFIX + "SafepointStateSynchronization";// "vm.runtime.safepoint.statesync";
  70     public final static String SafepointWaitBlocked = PREFIX + "SafepointWaitBlocked";// "vm.runtime.safepoint.waitblocked";
  71     public final static String SafepointCleanup = PREFIX + "SafepointCleanup";// "vm.runtime.safepoint.cleanup";
  72     public final static String SafepointCleanupTask = PREFIX + "SafepointCleanupTask";// "vm.runtime.safepoint.cleanuptask";
  73     public final static String SafepointEnd = PREFIX + "SafepointEnd";// "vm.runtime.safepoint.end";
  74     public final static String ExecuteVMOperation = PREFIX + "ExecuteVMOperation"; // "vm.runtime.execute_vm_operation";
  75     public final static String Shutdown = PREFIX + "Shutdown"; // "vm.runtime.shutdown";
  76     public final static String VMError = PREFIX + "VMError"; // "vm.runtime.vm_error";
  77     public final static String JavaThreadStatistics = PREFIX + "JavaThreadStatistics"; // "java.statistics.threads";
  78     public final static String ClassLoadingStatistics = PREFIX + "ClassLoadingStatistics"; // "java.statistics.class_loading";
  79     public final static String ClassLoaderStatistics = PREFIX + "ClassLoaderStatistics"; // "java.statistics.class_loaders";
  80     public final static String ThreadAllocationStatistics = PREFIX + "ThreadAllocationStatistics"; // "java.statistics.thread_allocation";
  81     public final static String ExecutionSample = PREFIX + "ExecutionSample"; // "vm.prof.execution_sample";
  82     public final static String ExecutionSampling = PREFIX + "ExecutionSampling"; // "vm.prof.execution_sampling_info";
  83     public final static String ThreadDump = PREFIX + "ThreadDump"; // "vm.runtime.thread_dump";
  84     public final static String OldObjectSample = PREFIX + "OldObjectSample";
  85     public final static String BiasedLockRevocation = PREFIX + "BiasedLockRevocation"; // "java.biased_lock_revocation";
  86     public final static String BiasedLockSelfRevocation = PREFIX + "BiasedLockSelfRevocation"; // "java.biased_lock_self_revocation";
  87     public final static String BiasedLockClassRevocation = PREFIX + "BiasedLockClassRevocation"; // "java.biased_lock_class_revocation";
  88 
  89     // GC
  90     public final static String GCHeapSummary = PREFIX + "GCHeapSummary"; // "vm.gc.heap.summary";
  91     public final static String MetaspaceSummary = PREFIX + "MetaspaceSummary"; // "vm.gc.heap.metaspace_summary";
  92     public final static String MetaspaceGCThreshold = PREFIX + "MetaspaceGCThreshold"; // "vm.gc.metaspace.gc_threshold";
  93     public final static String MetaspaceAllocationFailure = PREFIX + "MetaspaceAllocationFailure"; // "vm.gc.metaspace.allocation_failure";
  94     public final static String MetaspaceOOM = PREFIX + "MetaspaceOOM"; // "vm.gc.metaspace.out_of_memory";
  95     public final static String MetaspaceChunkFreeListSummary = PREFIX + "MetaspaceChunkFreeListSummary"; // "vm.gc.metaspace.chunk_free_list_summary";
  96     public final static String PSHeapSummary = PREFIX + "PSHeapSummary"; // "vm.gc.heap.ps_summary";
  97     public final static String G1HeapSummary = PREFIX + "G1HeapSummary"; // "vm.gc.heap.g1_summary";
  98     public final static String G1HeapRegionInformation = PREFIX + "G1HeapRegionInformation"; // "vm.gc.detailed.g1_heap_region_information";
  99     public final static String G1HeapRegionTypeChange = PREFIX + "G1HeapRegionTypeChange"; // "vm.gc.detailed.g1_heap_region_type_change";
 100     public final static String TenuringDistribution = PREFIX + "TenuringDistribution"; // "vm.gc.detailed.tenuring_distribution";
 101     public final static String GarbageCollection = PREFIX + "GarbageCollection"; // "vm.gc.collector.garbage_collection";
 102     public final static String ParallelOldCollection = PREFIX + "ParallelOldGarbageCollection"; // "vm.gc.collector.parold_garbage_collection";
 103     public final static String YoungGarbageCollection = PREFIX + "YoungGarbageCollection";// "vm.gc.collector.young_garbage_collection";
 104     public final static String OldGarbageCollection = PREFIX + "OldGarbageCollection"; // "vm.gc.collector.old_garbage_collection";
 105     public final static String G1GarbageCollection = PREFIX + "G1GarbageCollection"; // "vm.gc.collector.g1_garbage_collection";
 106     public final static String G1MMU = PREFIX + "G1MMU"; // "vm.gc.detailed.g1_mmu_info";
 107     public final static String EvacuationInfo = PREFIX + "EvacuationInfo";// "vm.gc.detailed.evacuation_info";
 108     public final static String GCReferenceStatistics = PREFIX + "GCReferenceStatistics";// "vm.gc.reference.statistics";
 109     public final static String ObjectCountAfterGC = PREFIX + "ObjectCountAfterGC"; // "vm.gc.detailed.object_count_after_gc";
 110     public final static String PromoteObjectInNewPLAB = PREFIX + "PromoteObjectInNewPLAB";// "vm.gc.detailed.object_promotion_in_new_PLAB";
 111     public final static String PromoteObjectOutsidePLAB = PREFIX + "PromoteObjectOutsidePLAB"; // "vm.gc.detailed.object_promotion_outside_PLAB";
 112     public final static String PromotionFailed = PREFIX + "PromotionFailed"; // "vm.gc.detailed.promotion_failed";
 113     public final static String EvacuationFailed = PREFIX + "EvacuationFailed"; // "vm.gc.detailed.evacuation_failed";
 114     public final static String ConcurrentModeFailure = PREFIX + "ConcurrentModeFailure"; // "vm.gc.detailed.concurrent_mode_failure";
 115     public final static String GCPhasePause = PREFIX + "GCPhasePause"; // "vm.gc.phases.pause";
 116     public final static String GCPhasePauseLevel1 = PREFIX + "GCPhasePauseLevel1"; // "vm.gc.phases.pause_level_1";
 117     public final static String GCPhasePauseLevel2 = PREFIX + "GCPhasePauseLevel2"; // vm.gc.phases.pause_level_2";
 118     public final static String GCPhasePauseLevel3 = PREFIX + "GCPhasePauseLevel3"; // "vm.gc.phases.pause_level_3";
 119     public final static String ObjectCount = PREFIX + "ObjectCount"; // "vm.gc.detailed.object_count";
 120     public final static String GCConfiguration = PREFIX + "GCConfiguration"; // vm.gc.configuration.gc";
 121     public final static String GCSurvivorConfiguration = PREFIX + "GCSurvivorConfiguration"; // "vm.gc.configuration.survivor";
 122     public final static String GCTLABConfiguration = PREFIX + "GCTLABConfiguration";// "vm.gc.configuration.tlab";
 123     public final static String GCHeapConfiguration = PREFIX + "GCHeapConfiguration";// "vm.gc.configuration.heap";
 124     public final static String YoungGenerationConfiguration = PREFIX + "YoungGenerationConfiguration"; // "vm.gc.configuration.young_generation";
 125     public final static String G1AdaptiveIHOP = PREFIX + "G1AdaptiveIHOP"; // "vm/gc/detailed/g1_adaptive_ihop_status"
 126     public final static String G1EvacuationYoungStatistics = PREFIX + "G1EvacuationYoungStatistics"; // "vm/gc/detailed/g1_evac_young_stats"
 127     public final static String G1EvacuationOldStatistics = PREFIX + "G1EvacuationOldStatistics"; // "vm/gc/detailed/g1_evac_old_stats"
 128     public final static String G1BasicIHOP = PREFIX + "G1BasicIHOP"; // "vm/gc/detailed/g1_basic_ihop_status"
 129     public final static String AllocationRequiringGC = PREFIX + "AllocationRequiringGC"; // "vm/gc/detailed/allocation_requiring_gc"
 130 
 131     // Compiler
 132     public final static String Compilation = PREFIX + "Compilation";// "vm.compiler.compilation";
 133     public final static String CompilerPhase = PREFIX + "CompilerPhase";// "vm.compiler.phase";
 134     public final static String CompilationFailure = PREFIX + "CompilationFailure";// "vm.compiler.failure";
 135     public final static String CompilerInlining = PREFIX + "CompilerInlining";// "vm.compiler.optimization.inlining";
 136     public final static String CompilerStatistics = PREFIX + "CompilerStatistics";// "vm.compiler.stats";
 137     public final static String CompilerConfig = PREFIX + "CompilerConfiguration";// "vm.compiler.config";
 138     public final static String CodeCacheStatistics = PREFIX + "CodeCacheStatistics";// "vm.code_cache.stats";
 139     public final static String CodeCacheConfiguration = PREFIX + "CodeCacheConfiguration";// "vm.code_cache.config";
 140     public final static String CodeSweeperStatistics = PREFIX + "CodeSweeperStatistics";// "vm.code_sweeper.stats";
 141     public final static String CodeSweeperConfiguration = PREFIX + "CodeSweeperConfiguration";// "vm.code_sweeper.config";
 142     public final static String SweepCodeCache = PREFIX + "SweepCodeCache";// "vm.code_sweeper.sweep";
 143     public final static String CodeCacheFull = PREFIX + "CodeCacheFull";// "vm.code_cache.full";
 144     public final static String ObjectAllocationInNewTLAB = PREFIX + "ObjectAllocationInNewTLAB";// "java.object_alloc_in_new_TLAB";
 145     public final static String ObjectAllocationOutsideTLAB = PREFIX + "ObjectAllocationOutsideTLAB";// "java.object_alloc_outside_TLAB";
 146 
 147     // OS
 148     public final static String OSInformation = PREFIX + "OSInformation";// "os.information";
 149     public final static String CPUInformation = PREFIX + "CPUInformation";// "os.processor.cpu_information";
 150     public final static String CPULoad = PREFIX + "CPULoad";// "os.processor.cpu_load";
 151     public final static String ThreadCPULoad = PREFIX + "ThreadCPULoad"; // "os.processor.thread_cpu_load";
 152     public final static String SystemProcess = PREFIX + "SystemProcess";// "os.system_process";
 153     public final static String ThreadContextSwitchRate = PREFIX + "ThreadContextSwitchRate";// "os.processor.context_switch_rate";
 154     public final static String InitialEnvironmentVariable = PREFIX + "InitialEnvironmentVariable";// "os.initial_environment_variable";
 155     public final static String NativeLibrary = PREFIX + "NativeLibrary";// "vm.runtime.native_libraries";
 156     public final static String PhysicalMemory = PREFIX + "PhysicalMemory";// "os.memory.physical_memory";
 157 
 158     // JDK
 159     public static final String FileForce  = PREFIX + "FileForce";// "java.file_force";
 160     public static final String FileRead = PREFIX + "FileRead";// "java.file_read";
 161     public static final String FileWrite = PREFIX + "FileWrite"; // "java.file_write";
 162     public static final String SocketRead = PREFIX + "SocketRead";// "java.socket_read";
 163     public static final String SocketWrite = PREFIX + "SocketWrite";// "java.socket_write";
 164     public final static String ExceptionStatistics = PREFIX + "ExceptionStatistics"; // "java.statistics.throwables";
 165     public final static String JavaExceptionThrow = PREFIX + "JavaExceptionThrow"; // java.exception_throw";
 166     public final static String JavaErrorThrow = PREFIX + "JavaErrorThrow"; // "java.error_throw";;
 167     public final static String ModuleRequire = PREFIX + "ModuleRequire"; // "com.oracle.jdk.ModuleRequire"
 168     public final static String ModuleExport = PREFIX + "ModuleExport"; // "com.oracle.jdk.ModuleExport"
 169 
 170     // Flight Recorder
 171     public final static String DumpReason = PREFIX + "DumpReason";// "flight_recorder.dump_reason";
 172     public final static String DataLoss = PREFIX + "DataLoss"; // "flight_recorder.data_loss";
 173     public final static String CPUTimeStampCounter = PREFIX + "CPUTimeStampCounter";// "os.processor.cpu_tsc";
 174     public final static String ActiveRecording = PREFIX + "ActiveRecording";//"com.oracle.jdk.ActiveRecording"
 175     public final static String ActiveSetting = PREFIX + "ActiveSetting";//"com.oracle.jdk.ActiveSetting"
 176 
 177     public static boolean isGcEvent(EventType et) {
 178         return et.getCategoryNames().contains(GC_CATEGORY);
 179     }
 180 
 181 }