diff --git a/runtime/vm/JFRChunkWriter.cpp b/runtime/vm/JFRChunkWriter.cpp index 153e2cdea99..070b4d109c4 100644 --- a/runtime/vm/JFRChunkWriter.cpp +++ b/runtime/vm/JFRChunkWriter.cpp @@ -19,11 +19,13 @@ * * SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0 OR GPL-2.0-only WITH OpenJDK-assembly-exception-1.0 *******************************************************************************/ +#include "JFRUtils.hpp" #include "vm_internal.h" #if defined(J9VM_OPT_JFR) #include "JFRChunkWriter.hpp" +#include "JFRConstantPoolTypes.hpp" void VM_JFRChunkWriter::writeJFRHeader() @@ -638,7 +640,7 @@ VM_JFRChunkWriter::writeStacktraceCheckpointEvent() U_8 * VM_JFRChunkWriter::writeJVMInformationEvent() { - JVMInformationEntry *jvmInfo= &(((JFRConstantEvents *)(_vm->jfrState.constantEvents))->JVMInfoEntry); + JVMInformationEntry *jvmInfo= &(VM_JFRConstantPoolTypes::getJFRConstantEvents(_vm)->JVMInfoEntry); /* reserve size field */ U_8 *dataStart = _bufferWriter->getAndIncCursor(sizeof(U_32)); @@ -647,7 +649,7 @@ VM_JFRChunkWriter::writeJVMInformationEvent() _bufferWriter->writeLEB128(JVMInformationID); /* write start time */ - _bufferWriter->writeLEB128(jvmInfo->jvmStartTime); + _bufferWriter->writeLEB128(j9time_current_time_millis()); /* write JVM name */ writeStringLiteral(jvmInfo->jvmName); @@ -676,5 +678,112 @@ VM_JFRChunkWriter::writeJVMInformationEvent() return dataStart; } +U_8 * +VM_JFRChunkWriter::writePhysicalMemoryEvent() +{ + /* reserve size field */ + U_8 *dataStart = _bufferWriter->getAndIncCursor(sizeof(U_32)); + + _bufferWriter->writeLEB128(PhysicalMemoryID); + + /* write start time */ + _bufferWriter->writeLEB128(j9time_current_time_millis()); + + J9MemoryInfo memInfo = {0}; + I_32 rc = j9sysinfo_get_memory_info(&memInfo); + if (0 == rc) { + /* write total size */ + _bufferWriter->writeLEB128(memInfo.totalPhysical); + /* write used size */ + _bufferWriter->writeLEB128(memInfo.totalPhysical - memInfo.availPhysical); + } else { + _buildResult = InternalVMError; + } + /* write size */ + _bufferWriter->writeLEB128PaddedU32(dataStart, _bufferWriter->getCursor() - dataStart); + + return dataStart; +} + +U_8 * +VM_JFRChunkWriter::writeCPUInformationEvent() +{ + CPUInformationEntry *cpuInfo= &(VM_JFRConstantPoolTypes::getJFRConstantEvents(_vm)->CPUInfoEntry); + + /* reserve size field */ + U_8 *dataStart = _bufferWriter->getAndIncCursor(sizeof(U_32)); + + /* write event type */ + _bufferWriter->writeLEB128(CPUInformationID); + + /* write start time */ + _bufferWriter->writeLEB128(j9time_current_time_millis()); + + /* write CPU type */ + writeStringLiteral(cpuInfo->cpu); + + /* write CPU description */ + writeStringLiteral(cpuInfo->description); + + /* write CPU sockets */ + _bufferWriter->writeLEB128(cpuInfo->sockets); + + /* write CPU cores */ + _bufferWriter->writeLEB128(cpuInfo->cores); + + /* write CPU hardware threads */ + _bufferWriter->writeLEB128(cpuInfo->hwThreads); + + /* write size */ + _bufferWriter->writeLEB128PaddedU32(dataStart, _bufferWriter->getCursor() - dataStart); + + return dataStart; +} + +U_8 * +VM_JFRChunkWriter::writeVirtualizationInformationEvent() +{ + VirtualizationInformationEntry *virtualizationInfo= &(VM_JFRConstantPoolTypes::getJFRConstantEvents(_vm)->VirtualizationInfoEntry); + + /* reserve size field */ + U_8 *dataStart = _bufferWriter->getAndIncCursor(sizeof(U_32)); + + /* write event type */ + _bufferWriter->writeLEB128(VirtualizationInformationID); + + /* write start time */ + _bufferWriter->writeLEB128(j9time_current_time_millis()); + + /* write virtualization name */ + writeStringLiteral(virtualizationInfo->name); + + /* write size */ + _bufferWriter->writeLEB128PaddedU32(dataStart, _bufferWriter->getCursor() - dataStart); + + return dataStart; +} + +U_8 * +VM_JFRChunkWriter::writeOSInformationEvent() +{ + OSInformationEntry *osInfo = &(VM_JFRConstantPoolTypes::getJFRConstantEvents(_vm)->OSInfoEntry); + + /* reserve size field */ + U_8 *dataStart = _bufferWriter->getAndIncCursor(sizeof(U_32)); + + /* write event type */ + _bufferWriter->writeLEB128(OSInformationID); + + /* write start time */ + _bufferWriter->writeLEB128(j9time_current_time_millis()); + + /* write OS version */ + writeStringLiteral(osInfo->osVersion); + + /* write size */ + _bufferWriter->writeLEB128PaddedU32(dataStart, _bufferWriter->getCursor() - dataStart); + + return dataStart; +} #endif /* defined(J9VM_OPT_JFR) */ diff --git a/runtime/vm/JFRChunkWriter.hpp b/runtime/vm/JFRChunkWriter.hpp index 1a17fc62069..47d240af6d8 100644 --- a/runtime/vm/JFRChunkWriter.hpp +++ b/runtime/vm/JFRChunkWriter.hpp @@ -66,6 +66,10 @@ enum MetadataTypeID { ThreadEndID = 3, ThreadSleepID = 4, JVMInformationID = 86, + OSInformationID = 87, + VirtualizationInformationID = 88, + CPUInformationID = 92, + PhysicalMemoryID = 107, ExecutionSampleID = 108, ThreadID = 163, ThreadGroupID = 164, @@ -145,6 +149,10 @@ class VM_JFRChunkWriter { static constexpr int THREAD_END_EVENT_SIZE = (4 * sizeof(U_64)) + sizeof(U_32); static constexpr int THREAD_SLEEP_EVENT_SIZE = (7 * sizeof(U_64)) + sizeof(U_32); static constexpr int JVM_INFORMATION_EVENT_SIZE = 3000; + static constexpr int PHYSICAL_MEMORY_EVENT_SIZE = (4 * sizeof(U_64)) + sizeof(U_32); + static constexpr int VIRTUALIZATION_INFORMATION_EVENT_SIZE = 50; + static constexpr int CPU_INFORMATION_EVENT_SIZE = 600; + static constexpr int OS_INFORMATION_EVENT_SIZE = 30; static constexpr int METADATA_ID = 1; @@ -249,6 +257,21 @@ class VM_JFRChunkWriter { _constantPoolTypes.printTables(); } + if (FALSE == _vm->jfrState.isConstantEventsInitialized) { + omrthread_monitor_enter(_vm->jfrState.isConstantEventsInitializedMutex); + if (FALSE == _vm->jfrState.isConstantEventsInitialized) { + VM_JFRConstantPoolTypes::initializeJFRConstantEvents(_vm, _currentThread, &_buildResult); + if (isResultNotOKay()) { + VM_JFRConstantPoolTypes::freeJFRConstantEvents(_vm); + goto done; + } + /* Ensure that initialization is complete when the initialized variable is set to true */ + VM_AtomicSupport::writeBarrier(); + _vm->jfrState.isConstantEventsInitialized = TRUE; + } + omrthread_monitor_exit(_vm->jfrState.isConstantEventsInitializedMutex); + } + requiredBufferSize = calculateRequiredBufferSize(); if (isResultNotOKay()) { goto done; @@ -300,14 +323,29 @@ class VM_JFRChunkWriter { writeJVMInformationEvent(); + writePhysicalMemoryEvent(); + + writeCPUInformationEvent(); + + writeVirtualizationInformationEvent(); + + writeOSInformationEvent(); + writeJFRHeader(); + if (isResultNotOKay()) { + Trc_VM_jfr_ErrorWritingChunk(_currentThread, _buildResult); + goto freeBuffer; + } + writeJFRChunkToFile(); + _vm->jfrState.jfrChunkCount += 1; + +freeBuffer: _bufferWriter = NULL; j9mem_free_memory(buffer); - _vm->jfrState.jfrChunkCount += 1; } done: return; @@ -482,6 +520,14 @@ class VM_JFRChunkWriter { U_8 *writeJVMInformationEvent(); + U_8 *writePhysicalMemoryEvent(); + + U_8 *writeCPUInformationEvent(); + + U_8 *writeVirtualizationInformationEvent(); + + U_8 *writeOSInformationEvent(); + UDATA calculateRequiredBufferSize() { @@ -522,6 +568,14 @@ class VM_JFRChunkWriter { requireBufferSize += JVM_INFORMATION_EVENT_SIZE; + requireBufferSize += OS_INFORMATION_EVENT_SIZE; + + requireBufferSize += PHYSICAL_MEMORY_EVENT_SIZE; + + requireBufferSize += VIRTUALIZATION_INFORMATION_EVENT_SIZE; + + requireBufferSize += CPU_INFORMATION_EVENT_SIZE; + return requireBufferSize; } diff --git a/runtime/vm/JFRConstantPoolTypes.hpp b/runtime/vm/JFRConstantPoolTypes.hpp index 4815a7ac3f9..c4a98455d38 100644 --- a/runtime/vm/JFRConstantPoolTypes.hpp +++ b/runtime/vm/JFRConstantPoolTypes.hpp @@ -19,11 +19,14 @@ * * SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0 OR GPL-2.0-only WITH OpenJDK-assembly-exception-1.0 *******************************************************************************/ +#include #if !defined(JFRCONSTANTPOOLTYPES_HPP_) #define JFRCONSTANTPOOLTYPES_HPP_ #include "j9cfg.h" +#include "j9hypervisor.h" #include "j9.h" +#include "omr.h" #include "omrlinkedlist.h" #include "vm_api.h" #include "vm_internal.h" @@ -206,8 +209,27 @@ struct JVMInformationEntry { I_64 pid; }; +struct CPUInformationEntry { + const char *cpu; + char *description; + U_32 sockets; + U_32 cores; + U_32 hwThreads; +}; + +struct VirtualizationInformationEntry { + const char *name; +}; + +struct OSInformationEntry { + char *osVersion; +}; + struct JFRConstantEvents { JVMInformationEntry JVMInfoEntry; + CPUInformationEntry CPUInfoEntry; + VirtualizationInformationEntry VirtualizationInfoEntry; + OSInformationEntry OSInfoEntry; }; class VM_JFRConstantPoolTypes { @@ -470,7 +492,8 @@ class VM_JFRConstantPoolTypes { * @param vm[in] the J9JavaVM * @param propName[in] the system property name */ - static const char *getSystemProp(J9JavaVM *vm, const char *propName) { + static const char *getSystemProp(J9JavaVM *vm, const char *propName) + { J9VMSystemProperty *jvmInfoProperty = NULL; const char *value = ""; UDATA getPropertyResult = vm->internalVMFunctions->getSystemProperty(vm, propName, &jvmInfoProperty); @@ -637,6 +660,17 @@ class VM_JFRConstantPoolTypes { return _stackFrameCount; } + /** + * Helper to get JFR constantEvents field. + * + * @param vm[in] the J9JavaVM + */ + static JFRConstantEvents *getJFRConstantEvents(J9JavaVM *vm) + { + return (JFRConstantEvents *)vm->jfrState.constantEvents; + } + + void printTables(); BuildResult getBuildResult() { return _buildResult; }; @@ -701,14 +735,44 @@ class VM_JFRConstantPoolTypes { } /** - * Initialize JVMInformationEntry. - * - * @param vm[in] the J9JavaVM - */ - static void initializeJVMInformationEvent(J9JavaVM *vm) { + * Initialize constantEvents. + * + * @param vm[in] the J9JavaVM + */ + static void initializeJFRConstantEvents(J9JavaVM *vm, J9VMThread *currentThread, BuildResult *result) + { + initializeJVMInformationEvent(vm, currentThread, result); + initializeCPUInformationEvent(vm, currentThread, result); + initializeVirtualizationInformation(vm); + initializeOSInformation(vm, result); + } + + /** + * Free constantEvents. + * + * @param vm[in] the J9JavaVM + */ + static void freeJFRConstantEvents(J9JavaVM *vm) + { + PORT_ACCESS_FROM_JAVAVM(vm); + + freeJVMInformationEvent(vm); + freeCPUInformationEvent(vm); + freeOSInformation(vm); + + j9mem_free_memory(vm->jfrState.constantEvents); + } + + /** + * Initialize JVMInformationEntry. + * + * @param vm[in] the J9JavaVM + */ + static void initializeJVMInformationEvent(J9JavaVM *vm, J9VMThread *currentThread, BuildResult *result) + { PORT_ACCESS_FROM_JAVAVM(vm); /* Initialize JVM Information */ - JVMInformationEntry *jvmInformation = &(((JFRConstantEvents *)(vm->jfrState.constantEvents))->JVMInfoEntry); + JVMInformationEntry *jvmInformation = &(getJFRConstantEvents(vm)->JVMInfoEntry); /* Set JVM name */ jvmInformation->jvmName = getSystemProp(vm, "java.vm.name"); @@ -729,19 +793,22 @@ class VM_JFRConstantPoolTypes { jvmInformation->jvmArguments = (char *)j9mem_allocate_memory(sizeof(char) * vmArgsLen, OMRMEM_CATEGORY_VM); char *cursor = jvmInformation->jvmArguments; - for (IDATA i = 0; i < vmArgs->nOptions; i++) { - UDATA len = strlen(vmArgs->options[i].optionString); - memcpy(cursor, vmArgs->options[i].optionString, len); - cursor += len; - - if (i == vmArgs->nOptions - 1) { - *cursor = '\0'; - } else { - *cursor = ' '; + if (NULL != cursor) { + for (IDATA i = 0; i < vmArgs->nOptions; i++) { + UDATA len = strlen(vmArgs->options[i].optionString); + memcpy(cursor, vmArgs->options[i].optionString, len); + cursor += len; + + if (i == vmArgs->nOptions - 1) { + *cursor = '\0'; + } else { + *cursor = ' '; + } + cursor += 1; } - cursor += 1; + } else { + *result = OutOfMemory; } - /* Ignoring jvmFlags for now */ jvmInformation->jvmFlags = NULL; jvmInformation->jvmStartTime = vm->j9ras->startTimeMillis; @@ -749,14 +816,141 @@ class VM_JFRConstantPoolTypes { } /** - * Free JVMInfoEntry. - * - * @param vm[in] the J9JavaVM - */ + * Free JVMInfoEntry. + * + * @param vm[in] the J9JavaVM + */ static void freeJVMInformationEvent(J9JavaVM *vm) { PORT_ACCESS_FROM_JAVAVM(vm); - j9mem_free_memory(((JFRConstantEvents *)(vm->jfrState.constantEvents))->JVMInfoEntry.jvmArguments); + j9mem_free_memory(getJFRConstantEvents(vm)->JVMInfoEntry.jvmArguments); + } + + /** + * Initialize CPUInformationEntry. + * + * @param vm[in] the J9JavaVM + */ + static void initializeCPUInformationEvent(J9JavaVM *vm, J9VMThread *currentThread, BuildResult *result) + { + PORT_ACCESS_FROM_JAVAVM(vm); + OMRPORT_ACCESS_FROM_J9PORT(privatePortLibrary); + + CPUInformationEntry *cpuInformation = &(getJFRConstantEvents(vm)->CPUInfoEntry); + + /* Set CPU type */ + cpuInformation->cpu = j9sysinfo_get_CPU_architecture(); + + /* Set CPU description */ + OMRProcessorDesc desc = {}; + omrsysinfo_get_processor_description(&desc); + char buffer[512]; + omrsysinfo_get_processor_feature_string(&desc, buffer, sizeof(buffer)); + UDATA len = strlen(buffer) + 1; + cpuInformation->description = (char *)j9mem_allocate_memory(sizeof(char) * len, OMRMEM_CATEGORY_VM); + if (NULL != cpuInformation->description) { + memcpy(cpuInformation->description, buffer, len); + } else { + *result = OutOfMemory; + } + + cpuInformation->cores = j9sysinfo_get_number_CPUs_by_type(J9PORT_CPU_PHYSICAL); + /* Setting number of sockets to number of cores for now as there's no easy way to get this info. + * TODO: fix this when we can query number of sockets from OMR + */ + cpuInformation->sockets = cpuInformation->cores; + cpuInformation->hwThreads = j9sysinfo_get_number_CPUs_by_type(J9PORT_CPU_TARGET); + } + + /** + * Free CPUInfoEntry. + * + * @param vm[in] the J9JavaVM + */ + static void freeCPUInformationEvent(J9JavaVM *vm) + { + PORT_ACCESS_FROM_JAVAVM(vm); + j9mem_free_memory(getJFRConstantEvents(vm)->CPUInfoEntry.description); + } + + /** + * Initialize VirtualizationInformationEntry. + * + * @param vm[in] the J9JavaVM + */ + static void initializeVirtualizationInformation(J9JavaVM *vm) + { + PORT_ACCESS_FROM_JAVAVM(vm); + + VirtualizationInformationEntry *virtualizationInfo = &(getJFRConstantEvents(vm)->VirtualizationInfoEntry); + + intptr_t rc = j9hypervisor_hypervisor_present(); + J9HypervisorVendorDetails vendorDetails = {0}; + + switch(rc) { + case J9HYPERVISOR_NOT_PRESENT: + virtualizationInfo->name = "No virtualization detected"; + break; + case J9PORT_ERROR_HYPERVISOR_UNSUPPORTED: + virtualizationInfo->name = "Virtualization detection not supported"; + break; + case J9HYPERVISOR_PRESENT: + j9hypervisor_get_hypervisor_info(&vendorDetails); + virtualizationInfo->name = vendorDetails.hypervisorName; + break; + default: + virtualizationInfo->name = "Error getting virtualization information"; + break; + }; + } + + /** + * Initialize OSInformationEntry. + * + * @param vm[in] the J9JavaVM + */ + static void initializeOSInformation(J9JavaVM *vm, BuildResult *result) + { + PORT_ACCESS_FROM_JAVAVM(vm); + + /* Build OS Version string from os.name, os.version and os.arch properties */ + const char *osName = getSystemProp(vm, "os.name"); + const char *osVersion = j9sysinfo_get_OS_version(); + const char *osArch = getSystemProp(vm, "os.arch"); + + UDATA len = 3 + strlen(osName) + strlen(osVersion) + strlen(osArch); + + getJFRConstantEvents(vm)->OSInfoEntry.osVersion = (char *)j9mem_allocate_memory(sizeof(char) * len, OMRMEM_CATEGORY_VM); + char *buffer = getJFRConstantEvents(vm)->OSInfoEntry.osVersion; + if (NULL == buffer) { + *result = OutOfMemory; + return; + } + + memcpy(buffer, osName, strlen(osName)); + buffer += strlen(osName); + *buffer = ' '; + buffer++; + + memcpy(buffer, osVersion, strlen(osVersion)); + buffer += strlen(osVersion); + *buffer = ' '; + buffer++; + + memcpy(buffer, osArch, strlen(osArch)); + buffer += strlen(osArch); + *buffer = '\0'; + } + + /** + * Free OSInformationEntry. + * + * @param vm[in] the J9JavaVM + */ + static void freeOSInformation(J9JavaVM *vm) + { + PORT_ACCESS_FROM_JAVAVM(vm); + j9mem_free_memory(getJFRConstantEvents(vm)->OSInfoEntry.osVersion); } VM_JFRConstantPoolTypes(J9VMThread *currentThread) diff --git a/runtime/vm/j9vm.tdf b/runtime/vm/j9vm.tdf index c2a45f25d8d..6b6965ff67b 100644 --- a/runtime/vm/j9vm.tdf +++ b/runtime/vm/j9vm.tdf @@ -980,3 +980,5 @@ TraceEvent=Trc_VM_criu_allocateVMThread_set_haltflag noEnv Overhead=1 Level=5 Te TraceEvent=Trc_VM_criu_toggleSuspendOnJavaThreads_start Test Overhead=1 Level=5 Template="toggleSuspendOnJavaThreads with currentThreadName(%s) suspendResumeFlag(%u)" TraceEvent=Trc_VM_criu_toggleSuspendOnJavaThreads_walkStatus Overhead=1 Level=5 Template="toggleSuspendOnJavaThreads (%s) walkThread(%p)" TraceEvent=Trc_VM_criu_toggleSuspendOnJavaThreads_walkThread Test Overhead=1 Level=5 Template="toggleSuspendOnJavaThreads with walkThreadName(%s) suspendResumeFlag(%u) walkThread(%p) currentThread(%p)" + +TraceException=Trc_VM_jfr_ErrorWritingChunk Overhead=1 Level=1 Template="Error writing JFR chunk; error=%d" diff --git a/runtime/vm/jfr.cpp b/runtime/vm/jfr.cpp index 0ec4952a089..bf6bae53a02 100644 --- a/runtime/vm/jfr.cpp +++ b/runtime/vm/jfr.cpp @@ -19,6 +19,7 @@ * * SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0 OR GPL-2.0-only WITH OpenJDK-assembly-exception-1.0 *******************************************************************************/ +#include "JFRConstantPoolTypes.hpp" #include "j9protos.h" #include "omrlinkedlist.h" #include "ut_j9vm.h" @@ -54,8 +55,6 @@ static void jfrVMInitialized(J9HookInterface **hook, UDATA eventNum, void *event static void initializeEventFields(J9VMThread *currentThread, J9JFREvent *jfrEvent, UDATA eventType); static int J9THREAD_PROC jfrSamplingThreadProc(void *entryArg); static void jfrExecutionSampleCallback(J9VMThread *currentThread, IDATA handlerKey, void *userData); -static void initializeJFRConstantEvents(J9JavaVM *vm); -static void freeJFRConstantEvents(J9JavaVM *vm); /** * Calculate the size in bytes of a JFR event. @@ -130,16 +129,6 @@ writeOutGlobalBuffer(J9VMThread *currentThread, bool finalWrite) { J9JavaVM *vm = currentThread->javaVM; - if (FALSE == vm->jfrState.isConstantEventsInitialized) { - omrthread_monitor_enter(vm->jfrState.isConstantEventsInitializedMutex); - if (FALSE == vm->jfrState.isConstantEventsInitialized) { - initializeJFRConstantEvents(vm); - /* Ensure that initialization is complete when the initialized variable is set to true */ - VM_AtomicSupport::writeBarrier(); - vm->jfrState.isConstantEventsInitialized = TRUE; - } - omrthread_monitor_exit(vm->jfrState.isConstantEventsInitializedMutex); - } #if defined(DEBUG) PORT_ACCESS_FROM_VMC(currentThread); j9tty_printf(PORTLIB, "\n!!! writing global buffer %p of size %p\n", currentThread, vm->jfrBuffer.bufferSize - vm->jfrBuffer.bufferRemaining); @@ -594,6 +583,12 @@ initializeJFR(J9JavaVM *vm) goto fail; } + /* Allocate constantEvents */ + vm->jfrState.constantEvents = j9mem_allocate_memory(sizeof(JFRConstantEvents), J9MEM_CATEGORY_VM); + if (NULL == vm->jfrState.constantEvents) { + goto fail; + } + /* Allocate global data */ buffer = (U_8*)j9mem_allocate_memory(J9JFR_GLOBAL_BUFFER_SIZE, OMRMEM_CATEGORY_VM); if (NULL == buffer) { @@ -666,7 +661,7 @@ tearDownJFR(J9JavaVM *vm) (*vmHooks)->J9HookUnregister(vmHooks, J9HOOK_VM_INITIALIZED, jfrVMInitialized, NULL); /* Free global data */ - freeJFRConstantEvents(vm); + VM_JFRConstantPoolTypes::freeJFRConstantEvents(vm); j9mem_free_memory((void*)vm->jfrBuffer.bufferStart); memset(&vm->jfrBuffer, 0, sizeof(vm->jfrBuffer)); @@ -688,37 +683,6 @@ tearDownJFR(J9JavaVM *vm) } -/** - * Initialize constantEvents. - * - * @param vm[in] the J9JavaVM - */ -static void -initializeJFRConstantEvents(J9JavaVM *vm) -{ - - PORT_ACCESS_FROM_JAVAVM(vm); - /* Allocate constantEvents */ - vm->jfrState.constantEvents = j9mem_allocate_memory(sizeof(JFRConstantEvents), J9MEM_CATEGORY_VM); - - VM_JFRConstantPoolTypes::initializeJVMInformationEvent(vm); -} - -/** - * Free constantEvents. - * - * @param vm[in] the J9JavaVM - */ -static void -freeJFRConstantEvents(J9JavaVM *vm) -{ - PORT_ACCESS_FROM_JAVAVM(vm); - - VM_JFRConstantPoolTypes::freeJVMInformationEvent(vm); - - j9mem_free_memory(vm->jfrState.constantEvents); -} - /** * Fill in the common fields of a JFR event *