changeset 50113:caf115bb98ad

8199712: Flight Recorder Reviewed-by: coleenp, ihse, erikj, dsamersoff, mseledtsov, egahlin, mgronlun Contributed-by: erik.gahlin@oracle.com, markus.gronlund@oracle.com
author egahlin
date Tue, 15 May 2018 20:24:34 +0200
parents 7a2a740815b7
children d2cfda6a00de
files make/CompileJavaModules.gmk make/autoconf/hotspot.m4 make/autoconf/libraries.m4 make/common/Modules.gmk make/copy/Copy-jdk.jfr.gmk make/hotspot/gensrc/GenerateSources.gmk make/hotspot/gensrc/GensrcJfr.gmk make/hotspot/gensrc/GensrcJvmti.gmk make/hotspot/lib/JvmFeatures.gmk make/hotspot/src/classes/build/tools/projectcreator/BuildConfig.java make/jprt.properties make/nashorn/project.properties make/nb_native/nbproject/configurations.xml src/hotspot/cpu/aarch64/vm_version_ext_aarch64.cpp src/hotspot/cpu/aarch64/vm_version_ext_aarch64.hpp src/hotspot/cpu/arm/vm_version_ext_arm.cpp src/hotspot/cpu/arm/vm_version_ext_arm.hpp src/hotspot/cpu/sparc/vm_version_ext_sparc.cpp src/hotspot/cpu/sparc/vm_version_ext_sparc.hpp src/hotspot/cpu/x86/rdtsc_x86.cpp src/hotspot/cpu/x86/rdtsc_x86.hpp src/hotspot/cpu/x86/vm_version_ext_x86.cpp src/hotspot/cpu/x86/vm_version_ext_x86.hpp src/hotspot/os/bsd/os_perf_bsd.cpp src/hotspot/os/linux/os_perf_linux.cpp src/hotspot/os/solaris/os_perf_solaris.cpp src/hotspot/os/windows/os_perf_windows.cpp src/hotspot/os/windows/pdh_interface.cpp src/hotspot/os/windows/pdh_interface.hpp src/hotspot/os_cpu/solaris_x86/os_solaris_x86.inline.hpp src/hotspot/share/c1/c1_Compiler.cpp src/hotspot/share/c1/c1_GraphBuilder.cpp src/hotspot/share/c1/c1_LIRGenerator.cpp src/hotspot/share/c1/c1_LIRGenerator.hpp src/hotspot/share/c1/c1_Runtime1.cpp src/hotspot/share/ci/ciEnv.cpp src/hotspot/share/ci/ciMethod.cpp src/hotspot/share/ci/ciMethod.hpp src/hotspot/share/classfile/classFileParser.cpp src/hotspot/share/classfile/classLoaderData.cpp src/hotspot/share/classfile/classLoaderData.hpp src/hotspot/share/classfile/klassFactory.cpp src/hotspot/share/classfile/moduleEntry.cpp src/hotspot/share/classfile/moduleEntry.hpp src/hotspot/share/classfile/packageEntry.cpp src/hotspot/share/classfile/packageEntry.hpp src/hotspot/share/classfile/systemDictionary.cpp src/hotspot/share/classfile/vmSymbols.cpp src/hotspot/share/classfile/vmSymbols.hpp src/hotspot/share/code/codeCache.cpp src/hotspot/share/compiler/compileBroker.cpp src/hotspot/share/compiler/compileBroker.hpp src/hotspot/share/gc/g1/g1CollectedHeap.hpp src/hotspot/share/gc/g1/g1EvacStats.cpp src/hotspot/share/gc/g1/g1FullGCAdjustTask.cpp src/hotspot/share/gc/g1/g1FullGCCompactTask.cpp src/hotspot/share/gc/g1/g1FullGCCompactTask.hpp src/hotspot/share/gc/g1/g1FullGCPrepareTask.cpp src/hotspot/share/gc/g1/g1FullGCPrepareTask.hpp src/hotspot/share/gc/g1/g1FullGCTask.cpp src/hotspot/share/gc/g1/g1GCPhaseTimes.cpp src/hotspot/share/gc/g1/g1HeapRegionEventSender.cpp src/hotspot/share/gc/g1/g1HeapRegionEventSender.hpp src/hotspot/share/gc/g1/g1ParScanThreadState.inline.hpp src/hotspot/share/gc/g1/g1RemSet.cpp src/hotspot/share/gc/g1/heapRegionTracer.cpp src/hotspot/share/gc/shared/ageTableTracer.cpp src/hotspot/share/gc/shared/allocTracer.cpp src/hotspot/share/gc/shared/copyFailedInfo.hpp src/hotspot/share/gc/shared/gcConfiguration.cpp src/hotspot/share/gc/shared/gcConfiguration.hpp src/hotspot/share/gc/shared/gcTimer.cpp src/hotspot/share/gc/shared/gcTrace.cpp src/hotspot/share/gc/shared/gcTraceSend.cpp src/hotspot/share/gc/shared/objectCountEventSender.cpp src/hotspot/share/gc/shared/objectCountEventSender.hpp src/hotspot/share/gc/shared/weakProcessor.cpp src/hotspot/share/jfr/dcmd/jfrDcmds.cpp src/hotspot/share/jfr/dcmd/jfrDcmds.hpp src/hotspot/share/jfr/instrumentation/jfrEventClassTransformer.cpp src/hotspot/share/jfr/instrumentation/jfrEventClassTransformer.hpp src/hotspot/share/jfr/instrumentation/jfrJvmtiAgent.cpp src/hotspot/share/jfr/instrumentation/jfrJvmtiAgent.hpp src/hotspot/share/jfr/jfr.cpp src/hotspot/share/jfr/jfr.hpp src/hotspot/share/jfr/jfrEvents.hpp src/hotspot/share/jfr/jni/jfrGetAllEventClasses.cpp src/hotspot/share/jfr/jni/jfrGetAllEventClasses.hpp src/hotspot/share/jfr/jni/jfrJavaCall.cpp src/hotspot/share/jfr/jni/jfrJavaCall.hpp src/hotspot/share/jfr/jni/jfrJavaSupport.cpp src/hotspot/share/jfr/jni/jfrJavaSupport.hpp src/hotspot/share/jfr/jni/jfrJniMethod.cpp src/hotspot/share/jfr/jni/jfrJniMethod.hpp src/hotspot/share/jfr/jni/jfrJniMethodRegistration.cpp src/hotspot/share/jfr/jni/jfrJniMethodRegistration.hpp src/hotspot/share/jfr/jni/jfrUpcalls.cpp src/hotspot/share/jfr/jni/jfrUpcalls.hpp src/hotspot/share/jfr/leakprofiler/chains/bfsClosure.cpp src/hotspot/share/jfr/leakprofiler/chains/bfsClosure.hpp src/hotspot/share/jfr/leakprofiler/chains/bitset.cpp src/hotspot/share/jfr/leakprofiler/chains/bitset.hpp src/hotspot/share/jfr/leakprofiler/chains/dfsClosure.cpp src/hotspot/share/jfr/leakprofiler/chains/dfsClosure.hpp src/hotspot/share/jfr/leakprofiler/chains/edge.cpp src/hotspot/share/jfr/leakprofiler/chains/edge.hpp src/hotspot/share/jfr/leakprofiler/chains/edgeQueue.cpp src/hotspot/share/jfr/leakprofiler/chains/edgeQueue.hpp src/hotspot/share/jfr/leakprofiler/chains/edgeStore.cpp src/hotspot/share/jfr/leakprofiler/chains/edgeStore.hpp src/hotspot/share/jfr/leakprofiler/chains/edgeUtils.cpp src/hotspot/share/jfr/leakprofiler/chains/edgeUtils.hpp src/hotspot/share/jfr/leakprofiler/chains/objectSampleMarker.hpp src/hotspot/share/jfr/leakprofiler/chains/rootSetClosure.cpp src/hotspot/share/jfr/leakprofiler/chains/rootSetClosure.hpp src/hotspot/share/jfr/leakprofiler/checkpoint/objectSampleCheckpoint.cpp src/hotspot/share/jfr/leakprofiler/checkpoint/objectSampleCheckpoint.hpp src/hotspot/share/jfr/leakprofiler/checkpoint/objectSampleDescription.cpp src/hotspot/share/jfr/leakprofiler/checkpoint/objectSampleDescription.hpp src/hotspot/share/jfr/leakprofiler/checkpoint/objectSampleWriter.cpp src/hotspot/share/jfr/leakprofiler/checkpoint/objectSampleWriter.hpp src/hotspot/share/jfr/leakprofiler/checkpoint/rootResolver.cpp src/hotspot/share/jfr/leakprofiler/checkpoint/rootResolver.hpp src/hotspot/share/jfr/leakprofiler/emitEventOperation.cpp src/hotspot/share/jfr/leakprofiler/emitEventOperation.hpp src/hotspot/share/jfr/leakprofiler/leakProfiler.cpp src/hotspot/share/jfr/leakprofiler/leakProfiler.hpp src/hotspot/share/jfr/leakprofiler/sampling/objectSample.hpp src/hotspot/share/jfr/leakprofiler/sampling/objectSampler.cpp src/hotspot/share/jfr/leakprofiler/sampling/objectSampler.hpp src/hotspot/share/jfr/leakprofiler/sampling/sampleList.cpp src/hotspot/share/jfr/leakprofiler/sampling/sampleList.hpp src/hotspot/share/jfr/leakprofiler/sampling/samplePriorityQueue.cpp src/hotspot/share/jfr/leakprofiler/sampling/samplePriorityQueue.hpp src/hotspot/share/jfr/leakprofiler/startOperation.hpp src/hotspot/share/jfr/leakprofiler/stopOperation.hpp src/hotspot/share/jfr/leakprofiler/utilities/granularTimer.cpp src/hotspot/share/jfr/leakprofiler/utilities/granularTimer.hpp src/hotspot/share/jfr/leakprofiler/utilities/rootType.hpp src/hotspot/share/jfr/leakprofiler/utilities/saveRestore.cpp src/hotspot/share/jfr/leakprofiler/utilities/saveRestore.hpp src/hotspot/share/jfr/leakprofiler/utilities/unifiedOop.hpp src/hotspot/share/jfr/metadata/GenerateJfrFiles.java src/hotspot/share/jfr/metadata/jfrSerializer.hpp src/hotspot/share/jfr/metadata/metadata.xml src/hotspot/share/jfr/metadata/metadata.xsd src/hotspot/share/jfr/periodic/jfrModuleEvent.cpp src/hotspot/share/jfr/periodic/jfrModuleEvent.hpp src/hotspot/share/jfr/periodic/jfrOSInterface.cpp src/hotspot/share/jfr/periodic/jfrOSInterface.hpp src/hotspot/share/jfr/periodic/jfrPeriodic.cpp src/hotspot/share/jfr/periodic/jfrThreadCPULoadEvent.cpp src/hotspot/share/jfr/periodic/jfrThreadCPULoadEvent.hpp src/hotspot/share/jfr/periodic/jfrThreadDumpEvent.cpp src/hotspot/share/jfr/periodic/jfrThreadDumpEvent.hpp src/hotspot/share/jfr/periodic/sampling/jfrCallTrace.cpp src/hotspot/share/jfr/periodic/sampling/jfrCallTrace.hpp src/hotspot/share/jfr/periodic/sampling/jfrThreadSampler.cpp src/hotspot/share/jfr/periodic/sampling/jfrThreadSampler.hpp src/hotspot/share/jfr/recorder/checkpoint/jfrCheckpointBlob.cpp src/hotspot/share/jfr/recorder/checkpoint/jfrCheckpointBlob.hpp src/hotspot/share/jfr/recorder/checkpoint/jfrCheckpointManager.cpp src/hotspot/share/jfr/recorder/checkpoint/jfrCheckpointManager.hpp src/hotspot/share/jfr/recorder/checkpoint/jfrCheckpointWriter.cpp src/hotspot/share/jfr/recorder/checkpoint/jfrCheckpointWriter.hpp src/hotspot/share/jfr/recorder/checkpoint/jfrMetadataEvent.cpp src/hotspot/share/jfr/recorder/checkpoint/jfrMetadataEvent.hpp src/hotspot/share/jfr/recorder/checkpoint/types/jfrThreadGroup.cpp src/hotspot/share/jfr/recorder/checkpoint/types/jfrThreadGroup.hpp src/hotspot/share/jfr/recorder/checkpoint/types/jfrThreadState.cpp src/hotspot/share/jfr/recorder/checkpoint/types/jfrThreadState.hpp src/hotspot/share/jfr/recorder/checkpoint/types/jfrType.cpp src/hotspot/share/jfr/recorder/checkpoint/types/jfrType.hpp src/hotspot/share/jfr/recorder/checkpoint/types/jfrTypeManager.cpp src/hotspot/share/jfr/recorder/checkpoint/types/jfrTypeManager.hpp src/hotspot/share/jfr/recorder/checkpoint/types/jfrTypeSet.cpp src/hotspot/share/jfr/recorder/checkpoint/types/jfrTypeSet.hpp src/hotspot/share/jfr/recorder/checkpoint/types/jfrTypeSetUtils.cpp src/hotspot/share/jfr/recorder/checkpoint/types/jfrTypeSetUtils.hpp src/hotspot/share/jfr/recorder/checkpoint/types/jfrTypeSetWriter.hpp src/hotspot/share/jfr/recorder/checkpoint/types/traceid/jfrTraceId.cpp src/hotspot/share/jfr/recorder/checkpoint/types/traceid/jfrTraceId.hpp src/hotspot/share/jfr/recorder/checkpoint/types/traceid/jfrTraceId.inline.hpp src/hotspot/share/jfr/recorder/checkpoint/types/traceid/jfrTraceIdBits.inline.hpp src/hotspot/share/jfr/recorder/checkpoint/types/traceid/jfrTraceIdEpoch.cpp src/hotspot/share/jfr/recorder/checkpoint/types/traceid/jfrTraceIdEpoch.hpp src/hotspot/share/jfr/recorder/checkpoint/types/traceid/jfrTraceIdMacros.hpp src/hotspot/share/jfr/recorder/jfrEventSetting.cpp src/hotspot/share/jfr/recorder/jfrEventSetting.hpp src/hotspot/share/jfr/recorder/jfrEventSetting.inline.hpp src/hotspot/share/jfr/recorder/jfrRecorder.cpp src/hotspot/share/jfr/recorder/jfrRecorder.hpp src/hotspot/share/jfr/recorder/repository/jfrChunkSizeNotifier.cpp src/hotspot/share/jfr/recorder/repository/jfrChunkSizeNotifier.hpp src/hotspot/share/jfr/recorder/repository/jfrChunkState.cpp src/hotspot/share/jfr/recorder/repository/jfrChunkState.hpp src/hotspot/share/jfr/recorder/repository/jfrChunkWriter.cpp src/hotspot/share/jfr/recorder/repository/jfrChunkWriter.hpp src/hotspot/share/jfr/recorder/repository/jfrEmergencyDump.cpp src/hotspot/share/jfr/recorder/repository/jfrEmergencyDump.hpp src/hotspot/share/jfr/recorder/repository/jfrRepository.cpp src/hotspot/share/jfr/recorder/repository/jfrRepository.hpp src/hotspot/share/jfr/recorder/service/jfrEvent.cpp src/hotspot/share/jfr/recorder/service/jfrEvent.hpp src/hotspot/share/jfr/recorder/service/jfrMemorySizer.cpp src/hotspot/share/jfr/recorder/service/jfrMemorySizer.hpp src/hotspot/share/jfr/recorder/service/jfrOptionSet.cpp src/hotspot/share/jfr/recorder/service/jfrOptionSet.hpp src/hotspot/share/jfr/recorder/service/jfrPostBox.cpp src/hotspot/share/jfr/recorder/service/jfrPostBox.hpp src/hotspot/share/jfr/recorder/service/jfrRecorderService.cpp src/hotspot/share/jfr/recorder/service/jfrRecorderService.hpp src/hotspot/share/jfr/recorder/service/jfrRecorderThread.cpp src/hotspot/share/jfr/recorder/service/jfrRecorderThread.hpp src/hotspot/share/jfr/recorder/service/jfrRecorderThreadLoop.cpp src/hotspot/share/jfr/recorder/stacktrace/jfrStackTraceRepository.cpp src/hotspot/share/jfr/recorder/stacktrace/jfrStackTraceRepository.hpp src/hotspot/share/jfr/recorder/storage/jfrBuffer.cpp src/hotspot/share/jfr/recorder/storage/jfrBuffer.hpp src/hotspot/share/jfr/recorder/storage/jfrMemorySpace.hpp src/hotspot/share/jfr/recorder/storage/jfrMemorySpace.inline.hpp src/hotspot/share/jfr/recorder/storage/jfrMemorySpaceRetrieval.hpp src/hotspot/share/jfr/recorder/storage/jfrStorage.cpp src/hotspot/share/jfr/recorder/storage/jfrStorage.hpp src/hotspot/share/jfr/recorder/storage/jfrStorageControl.cpp src/hotspot/share/jfr/recorder/storage/jfrStorageControl.hpp src/hotspot/share/jfr/recorder/storage/jfrStorageUtils.hpp src/hotspot/share/jfr/recorder/storage/jfrStorageUtils.inline.hpp src/hotspot/share/jfr/recorder/storage/jfrVirtualMemory.cpp src/hotspot/share/jfr/recorder/storage/jfrVirtualMemory.hpp src/hotspot/share/jfr/recorder/stringpool/jfrStringPool.cpp src/hotspot/share/jfr/recorder/stringpool/jfrStringPool.hpp src/hotspot/share/jfr/recorder/stringpool/jfrStringPoolBuffer.cpp src/hotspot/share/jfr/recorder/stringpool/jfrStringPoolBuffer.hpp src/hotspot/share/jfr/recorder/stringpool/jfrStringPoolWriter.cpp src/hotspot/share/jfr/recorder/stringpool/jfrStringPoolWriter.hpp src/hotspot/share/jfr/support/jfrAllocationTracer.cpp src/hotspot/share/jfr/support/jfrAllocationTracer.hpp src/hotspot/share/jfr/support/jfrEventClass.cpp src/hotspot/share/jfr/support/jfrEventClass.hpp src/hotspot/share/jfr/support/jfrFlush.cpp src/hotspot/share/jfr/support/jfrFlush.hpp src/hotspot/share/jfr/support/jfrIntrinsics.hpp src/hotspot/share/jfr/support/jfrKlassExtension.hpp src/hotspot/share/jfr/support/jfrStackTraceMark.cpp src/hotspot/share/jfr/support/jfrStackTraceMark.hpp src/hotspot/share/jfr/support/jfrThreadExtension.hpp src/hotspot/share/jfr/support/jfrThreadId.hpp src/hotspot/share/jfr/support/jfrThreadLocal.cpp src/hotspot/share/jfr/support/jfrThreadLocal.hpp src/hotspot/share/jfr/support/jfrTraceIdExtension.hpp src/hotspot/share/jfr/utilities/jfrAllocation.cpp src/hotspot/share/jfr/utilities/jfrAllocation.hpp src/hotspot/share/jfr/utilities/jfrBigEndian.hpp src/hotspot/share/jfr/utilities/jfrDoublyLinkedList.hpp src/hotspot/share/jfr/utilities/jfrHashtable.hpp src/hotspot/share/jfr/utilities/jfrIterator.hpp src/hotspot/share/jfr/utilities/jfrJavaLog.cpp src/hotspot/share/jfr/utilities/jfrJavaLog.hpp src/hotspot/share/jfr/utilities/jfrLogTagSets.hpp src/hotspot/share/jfr/utilities/jfrRefCountPointer.hpp src/hotspot/share/jfr/utilities/jfrResourceManager.hpp src/hotspot/share/jfr/utilities/jfrSpinlockHelper.hpp src/hotspot/share/jfr/utilities/jfrTime.cpp src/hotspot/share/jfr/utilities/jfrTime.hpp src/hotspot/share/jfr/utilities/jfrTimeConverter.cpp src/hotspot/share/jfr/utilities/jfrTimeConverter.hpp src/hotspot/share/jfr/utilities/jfrTryLock.hpp src/hotspot/share/jfr/utilities/jfrTypes.hpp src/hotspot/share/jfr/writers/jfrBigEndianWriter.hpp src/hotspot/share/jfr/writers/jfrEncoders.hpp src/hotspot/share/jfr/writers/jfrEncoding.hpp src/hotspot/share/jfr/writers/jfrEventWriterHost.hpp src/hotspot/share/jfr/writers/jfrEventWriterHost.inline.hpp src/hotspot/share/jfr/writers/jfrJavaEventWriter.cpp src/hotspot/share/jfr/writers/jfrJavaEventWriter.hpp src/hotspot/share/jfr/writers/jfrMemoryWriterHost.hpp src/hotspot/share/jfr/writers/jfrMemoryWriterHost.inline.hpp src/hotspot/share/jfr/writers/jfrNativeEventWriter.hpp src/hotspot/share/jfr/writers/jfrPosition.hpp src/hotspot/share/jfr/writers/jfrPosition.inline.hpp src/hotspot/share/jfr/writers/jfrStorageAdapter.hpp src/hotspot/share/jfr/writers/jfrStorageHost.hpp src/hotspot/share/jfr/writers/jfrStorageHost.inline.hpp src/hotspot/share/jfr/writers/jfrStreamWriterHost.hpp src/hotspot/share/jfr/writers/jfrStreamWriterHost.inline.hpp src/hotspot/share/jfr/writers/jfrWriterHost.hpp src/hotspot/share/jfr/writers/jfrWriterHost.inline.hpp src/hotspot/share/logging/logTag.hpp src/hotspot/share/memory/metaspaceTracer.cpp src/hotspot/share/oops/arrayKlass.cpp src/hotspot/share/oops/instanceKlass.hpp src/hotspot/share/oops/klass.cpp src/hotspot/share/oops/klass.hpp src/hotspot/share/oops/method.hpp src/hotspot/share/opto/bytecodeInfo.cpp src/hotspot/share/opto/c2compiler.cpp src/hotspot/share/opto/compile.hpp src/hotspot/share/opto/graphKit.cpp src/hotspot/share/opto/library_call.cpp src/hotspot/share/prims/jni.cpp src/hotspot/share/prims/jvm.cpp src/hotspot/share/prims/nativeLookup.cpp src/hotspot/share/prims/unsafe.cpp src/hotspot/share/runtime/arguments.cpp src/hotspot/share/runtime/biasedLocking.cpp src/hotspot/share/runtime/flags/jvmFlag.cpp src/hotspot/share/runtime/globals.cpp src/hotspot/share/runtime/globals.hpp src/hotspot/share/runtime/java.cpp src/hotspot/share/runtime/jniHandles.cpp src/hotspot/share/runtime/mutexLocker.cpp src/hotspot/share/runtime/mutexLocker.hpp src/hotspot/share/runtime/objectMonitor.cpp src/hotspot/share/runtime/objectMonitor.hpp src/hotspot/share/runtime/os_perf.hpp src/hotspot/share/runtime/safepoint.cpp src/hotspot/share/runtime/sharedRuntime.cpp src/hotspot/share/runtime/sweeper.cpp src/hotspot/share/runtime/synchronizer.cpp src/hotspot/share/runtime/thread.cpp src/hotspot/share/runtime/thread.hpp src/hotspot/share/runtime/vmStructs.cpp src/hotspot/share/runtime/vmStructs_trace.hpp src/hotspot/share/runtime/vmThread.cpp src/hotspot/share/runtime/vm_operations.cpp src/hotspot/share/trace/noTraceBackend.hpp src/hotspot/share/trace/trace.dtd src/hotspot/share/trace/trace.xml src/hotspot/share/trace/traceBackend.cpp src/hotspot/share/trace/traceBackend.hpp src/hotspot/share/trace/traceDataTypes.hpp src/hotspot/share/trace/traceEvent.hpp src/hotspot/share/trace/traceEventClasses.xsl src/hotspot/share/trace/traceEventIds.xsl src/hotspot/share/trace/traceMacros.hpp src/hotspot/share/trace/traceStream.cpp src/hotspot/share/trace/traceStream.hpp src/hotspot/share/trace/traceTime.hpp src/hotspot/share/trace/traceTypes.xsl src/hotspot/share/trace/traceevents.xml src/hotspot/share/trace/tracerelationdecls.xml src/hotspot/share/trace/tracetypes.xml src/hotspot/share/trace/tracing.hpp src/hotspot/share/trace/tracingExport.cpp src/hotspot/share/trace/tracingExport.hpp src/hotspot/share/trace/xinclude.mod src/hotspot/share/trace/xsl_util.xsl src/hotspot/share/utilities/hashtable.cpp src/hotspot/share/utilities/macros.hpp src/hotspot/share/utilities/spinYield.cpp src/hotspot/share/utilities/ticks.cpp src/hotspot/share/utilities/ticks.hpp src/hotspot/share/utilities/ticks.inline.hpp src/hotspot/share/utilities/vmError.cpp src/java.base/share/classes/module-info.java src/java.management/share/classes/module-info.java src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/VMOps.java src/jdk.jfr/share/classes/jdk/jfr/AnnotationElement.java src/jdk.jfr/share/classes/jdk/jfr/BooleanFlag.java src/jdk.jfr/share/classes/jdk/jfr/Category.java src/jdk.jfr/share/classes/jdk/jfr/Configuration.java src/jdk.jfr/share/classes/jdk/jfr/ContentType.java src/jdk.jfr/share/classes/jdk/jfr/DataAmount.java src/jdk.jfr/share/classes/jdk/jfr/Description.java src/jdk.jfr/share/classes/jdk/jfr/Enabled.java src/jdk.jfr/share/classes/jdk/jfr/Event.java src/jdk.jfr/share/classes/jdk/jfr/EventFactory.java src/jdk.jfr/share/classes/jdk/jfr/EventSettings.java src/jdk.jfr/share/classes/jdk/jfr/EventType.java src/jdk.jfr/share/classes/jdk/jfr/Experimental.java src/jdk.jfr/share/classes/jdk/jfr/FlightRecorder.java src/jdk.jfr/share/classes/jdk/jfr/FlightRecorderListener.java src/jdk.jfr/share/classes/jdk/jfr/FlightRecorderPermission.java src/jdk.jfr/share/classes/jdk/jfr/Frequency.java src/jdk.jfr/share/classes/jdk/jfr/Label.java src/jdk.jfr/share/classes/jdk/jfr/MemoryAddress.java src/jdk.jfr/share/classes/jdk/jfr/MetadataDefinition.java src/jdk.jfr/share/classes/jdk/jfr/Name.java src/jdk.jfr/share/classes/jdk/jfr/Percentage.java src/jdk.jfr/share/classes/jdk/jfr/Period.java src/jdk.jfr/share/classes/jdk/jfr/Recording.java src/jdk.jfr/share/classes/jdk/jfr/RecordingState.java src/jdk.jfr/share/classes/jdk/jfr/Registered.java src/jdk.jfr/share/classes/jdk/jfr/Relational.java src/jdk.jfr/share/classes/jdk/jfr/SettingControl.java src/jdk.jfr/share/classes/jdk/jfr/SettingDefinition.java src/jdk.jfr/share/classes/jdk/jfr/SettingDescriptor.java src/jdk.jfr/share/classes/jdk/jfr/StackTrace.java src/jdk.jfr/share/classes/jdk/jfr/Threshold.java src/jdk.jfr/share/classes/jdk/jfr/Timespan.java src/jdk.jfr/share/classes/jdk/jfr/Timestamp.java src/jdk.jfr/share/classes/jdk/jfr/TransitionFrom.java src/jdk.jfr/share/classes/jdk/jfr/TransitionTo.java src/jdk.jfr/share/classes/jdk/jfr/Unsigned.java src/jdk.jfr/share/classes/jdk/jfr/ValueDescriptor.java src/jdk.jfr/share/classes/jdk/jfr/consumer/ChunkParser.java src/jdk.jfr/share/classes/jdk/jfr/consumer/ConstantMap.java src/jdk.jfr/share/classes/jdk/jfr/consumer/EventParser.java src/jdk.jfr/share/classes/jdk/jfr/consumer/LongMap.java src/jdk.jfr/share/classes/jdk/jfr/consumer/ObjectFactory.java src/jdk.jfr/share/classes/jdk/jfr/consumer/Parser.java src/jdk.jfr/share/classes/jdk/jfr/consumer/ParserFactory.java src/jdk.jfr/share/classes/jdk/jfr/consumer/RecordedClass.java src/jdk.jfr/share/classes/jdk/jfr/consumer/RecordedClassLoader.java src/jdk.jfr/share/classes/jdk/jfr/consumer/RecordedEvent.java src/jdk.jfr/share/classes/jdk/jfr/consumer/RecordedFrame.java src/jdk.jfr/share/classes/jdk/jfr/consumer/RecordedMethod.java src/jdk.jfr/share/classes/jdk/jfr/consumer/RecordedObject.java src/jdk.jfr/share/classes/jdk/jfr/consumer/RecordedStackTrace.java src/jdk.jfr/share/classes/jdk/jfr/consumer/RecordedThread.java src/jdk.jfr/share/classes/jdk/jfr/consumer/RecordedThreadGroup.java src/jdk.jfr/share/classes/jdk/jfr/consumer/RecordingFile.java src/jdk.jfr/share/classes/jdk/jfr/consumer/TimeConverter.java src/jdk.jfr/share/classes/jdk/jfr/consumer/package-info.java src/jdk.jfr/share/classes/jdk/jfr/events/AbstractJDKEvent.java src/jdk.jfr/share/classes/jdk/jfr/events/ActiveRecordingEvent.java src/jdk.jfr/share/classes/jdk/jfr/events/ActiveSettingEvent.java src/jdk.jfr/share/classes/jdk/jfr/events/ErrorThrownEvent.java src/jdk.jfr/share/classes/jdk/jfr/events/ExceptionStatisticsEvent.java src/jdk.jfr/share/classes/jdk/jfr/events/ExceptionThrownEvent.java src/jdk.jfr/share/classes/jdk/jfr/events/FileForceEvent.java src/jdk.jfr/share/classes/jdk/jfr/events/FileReadEvent.java src/jdk.jfr/share/classes/jdk/jfr/events/FileWriteEvent.java src/jdk.jfr/share/classes/jdk/jfr/events/SocketReadEvent.java src/jdk.jfr/share/classes/jdk/jfr/events/SocketWriteEvent.java src/jdk.jfr/share/classes/jdk/jfr/internal/ASMToolkit.java src/jdk.jfr/share/classes/jdk/jfr/internal/AnnotationConstruct.java src/jdk.jfr/share/classes/jdk/jfr/internal/Bits.java src/jdk.jfr/share/classes/jdk/jfr/internal/ChunkInputStream.java src/jdk.jfr/share/classes/jdk/jfr/internal/ChunksChannel.java src/jdk.jfr/share/classes/jdk/jfr/internal/Control.java src/jdk.jfr/share/classes/jdk/jfr/internal/Cutoff.java src/jdk.jfr/share/classes/jdk/jfr/internal/EventClassBuilder.java src/jdk.jfr/share/classes/jdk/jfr/internal/EventControl.java src/jdk.jfr/share/classes/jdk/jfr/internal/EventHandlerCreator.java src/jdk.jfr/share/classes/jdk/jfr/internal/EventInstrumentation.java src/jdk.jfr/share/classes/jdk/jfr/internal/EventWriter.java src/jdk.jfr/share/classes/jdk/jfr/internal/EventWriterMethod.java src/jdk.jfr/share/classes/jdk/jfr/internal/JVM.java src/jdk.jfr/share/classes/jdk/jfr/internal/JVMSupport.java src/jdk.jfr/share/classes/jdk/jfr/internal/JVMUpcalls.java src/jdk.jfr/share/classes/jdk/jfr/internal/LogLevel.java src/jdk.jfr/share/classes/jdk/jfr/internal/LogTag.java src/jdk.jfr/share/classes/jdk/jfr/internal/Logger.java src/jdk.jfr/share/classes/jdk/jfr/internal/MetadataDescriptor.java src/jdk.jfr/share/classes/jdk/jfr/internal/MetadataHandler.java src/jdk.jfr/share/classes/jdk/jfr/internal/MetadataReader.java src/jdk.jfr/share/classes/jdk/jfr/internal/MetadataRepository.java src/jdk.jfr/share/classes/jdk/jfr/internal/MetadataWriter.java src/jdk.jfr/share/classes/jdk/jfr/internal/Options.java src/jdk.jfr/share/classes/jdk/jfr/internal/PlatformEventType.java src/jdk.jfr/share/classes/jdk/jfr/internal/PlatformRecorder.java src/jdk.jfr/share/classes/jdk/jfr/internal/PlatformRecording.java src/jdk.jfr/share/classes/jdk/jfr/internal/PrivateAccess.java src/jdk.jfr/share/classes/jdk/jfr/internal/Repository.java src/jdk.jfr/share/classes/jdk/jfr/internal/RepositoryChunk.java src/jdk.jfr/share/classes/jdk/jfr/internal/RequestEngine.java src/jdk.jfr/share/classes/jdk/jfr/internal/SecuritySupport.java src/jdk.jfr/share/classes/jdk/jfr/internal/SettingsManager.java src/jdk.jfr/share/classes/jdk/jfr/internal/ShutdownHook.java src/jdk.jfr/share/classes/jdk/jfr/internal/StringPool.java src/jdk.jfr/share/classes/jdk/jfr/internal/Type.java src/jdk.jfr/share/classes/jdk/jfr/internal/TypeLibrary.java src/jdk.jfr/share/classes/jdk/jfr/internal/Utils.java src/jdk.jfr/share/classes/jdk/jfr/internal/WriteableUserPath.java src/jdk.jfr/share/classes/jdk/jfr/internal/cmd/Command.java src/jdk.jfr/share/classes/jdk/jfr/internal/cmd/Execute.java src/jdk.jfr/share/classes/jdk/jfr/internal/cmd/HelpCommand.java src/jdk.jfr/share/classes/jdk/jfr/internal/cmd/JSONWriter.java src/jdk.jfr/share/classes/jdk/jfr/internal/cmd/PrettyWriter.java src/jdk.jfr/share/classes/jdk/jfr/internal/cmd/PrintCommand.java src/jdk.jfr/share/classes/jdk/jfr/internal/cmd/ReconstructCommand.java src/jdk.jfr/share/classes/jdk/jfr/internal/cmd/SplitCommand.java src/jdk.jfr/share/classes/jdk/jfr/internal/cmd/StructuredWriter.java src/jdk.jfr/share/classes/jdk/jfr/internal/cmd/SummaryCommand.java src/jdk.jfr/share/classes/jdk/jfr/internal/cmd/XMLWriter.java src/jdk.jfr/share/classes/jdk/jfr/internal/consumer/ChunkHeader.java src/jdk.jfr/share/classes/jdk/jfr/internal/consumer/RecordingInput.java src/jdk.jfr/share/classes/jdk/jfr/internal/dcmd/AbstractDCmd.java src/jdk.jfr/share/classes/jdk/jfr/internal/dcmd/DCmdCheck.java src/jdk.jfr/share/classes/jdk/jfr/internal/dcmd/DCmdConfigure.java src/jdk.jfr/share/classes/jdk/jfr/internal/dcmd/DCmdDump.java src/jdk.jfr/share/classes/jdk/jfr/internal/dcmd/DCmdException.java src/jdk.jfr/share/classes/jdk/jfr/internal/dcmd/DCmdStart.java src/jdk.jfr/share/classes/jdk/jfr/internal/dcmd/DCmdStop.java src/jdk.jfr/share/classes/jdk/jfr/internal/handlers/EventHandler.java src/jdk.jfr/share/classes/jdk/jfr/internal/instrument/ConstructorTracerWriter.java src/jdk.jfr/share/classes/jdk/jfr/internal/instrument/ConstructorWriter.java src/jdk.jfr/share/classes/jdk/jfr/internal/instrument/FileChannelImplInstrumentor.java src/jdk.jfr/share/classes/jdk/jfr/internal/instrument/FileInputStreamInstrumentor.java src/jdk.jfr/share/classes/jdk/jfr/internal/instrument/FileOutputStreamInstrumentor.java src/jdk.jfr/share/classes/jdk/jfr/internal/instrument/JDKEvents.java src/jdk.jfr/share/classes/jdk/jfr/internal/instrument/JIClassInstrumentation.java src/jdk.jfr/share/classes/jdk/jfr/internal/instrument/JIInliner.java src/jdk.jfr/share/classes/jdk/jfr/internal/instrument/JIInstrumentationMethod.java src/jdk.jfr/share/classes/jdk/jfr/internal/instrument/JIInstrumentationTarget.java src/jdk.jfr/share/classes/jdk/jfr/internal/instrument/JIMethodCallInliner.java src/jdk.jfr/share/classes/jdk/jfr/internal/instrument/JIMethodInliningAdapter.java src/jdk.jfr/share/classes/jdk/jfr/internal/instrument/JIMethodMergeAdapter.java src/jdk.jfr/share/classes/jdk/jfr/internal/instrument/JITypeMapping.java src/jdk.jfr/share/classes/jdk/jfr/internal/instrument/RandomAccessFileInstrumentor.java src/jdk.jfr/share/classes/jdk/jfr/internal/instrument/SocketChannelImplInstrumentor.java src/jdk.jfr/share/classes/jdk/jfr/internal/instrument/SocketInputStreamInstrumentor.java src/jdk.jfr/share/classes/jdk/jfr/internal/instrument/SocketOutputStreamInstrumentor.java src/jdk.jfr/share/classes/jdk/jfr/internal/instrument/ThrowableTracer.java src/jdk.jfr/share/classes/jdk/jfr/internal/jfc/JFC.java src/jdk.jfr/share/classes/jdk/jfr/internal/jfc/JFCParser.java src/jdk.jfr/share/classes/jdk/jfr/internal/jfc/JFCParserHandler.java src/jdk.jfr/share/classes/jdk/jfr/internal/jfc/jfc.xsd src/jdk.jfr/share/classes/jdk/jfr/internal/jfc/package-info.java src/jdk.jfr/share/classes/jdk/jfr/internal/management/ManagementSupport.java src/jdk.jfr/share/classes/jdk/jfr/internal/settings/BooleanValue.java src/jdk.jfr/share/classes/jdk/jfr/internal/settings/CutoffSetting.java src/jdk.jfr/share/classes/jdk/jfr/internal/settings/EnabledSetting.java src/jdk.jfr/share/classes/jdk/jfr/internal/settings/PeriodSetting.java src/jdk.jfr/share/classes/jdk/jfr/internal/settings/StackTraceSetting.java src/jdk.jfr/share/classes/jdk/jfr/internal/settings/ThresholdSetting.java src/jdk.jfr/share/classes/jdk/jfr/internal/test/WhiteBox.java src/jdk.jfr/share/classes/jdk/jfr/package-info.java src/jdk.jfr/share/classes/module-info.java src/jdk.jfr/share/conf/jfr/default.jfc src/jdk.jfr/share/conf/jfr/profile.jfc src/jdk.management.jfr/share/classes/jdk/management/jfr/ConfigurationInfo.java src/jdk.management.jfr/share/classes/jdk/management/jfr/EventTypeInfo.java src/jdk.management.jfr/share/classes/jdk/management/jfr/FlightRecorderMXBean.java src/jdk.management.jfr/share/classes/jdk/management/jfr/FlightRecorderMXBeanImpl.java src/jdk.management.jfr/share/classes/jdk/management/jfr/MBeanUtils.java src/jdk.management.jfr/share/classes/jdk/management/jfr/RecordingInfo.java src/jdk.management.jfr/share/classes/jdk/management/jfr/SettingDescriptorInfo.java src/jdk.management.jfr/share/classes/jdk/management/jfr/Stream.java src/jdk.management.jfr/share/classes/jdk/management/jfr/StreamCleanupTask.java src/jdk.management.jfr/share/classes/jdk/management/jfr/StreamManager.java src/jdk.management.jfr/share/classes/jdk/management/jfr/Stringifier.java src/jdk.management.jfr/share/classes/jdk/management/jfr/internal/FlightRecorderMXBeanProvider.java src/jdk.management.jfr/share/classes/jdk/management/jfr/package-info.java src/jdk.management.jfr/share/classes/module-info.java test/hotspot/gtest/gc/shared/test_oopStorage_parperf.cpp test/hotspot/gtest/jfr/precompiled.hpp test/hotspot/gtest/jfr/test_threadCpuLoad.cpp test/hotspot/jtreg/runtime/appcds/CDSandJFR.java test/hotspot/jtreg/runtime/appcds/TestWithProfiler.java test/hotspot/jtreg/runtime/appcds/test-classes/GetFlightRecorder.java test/hotspot/jtreg/runtime/appcds/test-classes/MyThread.java test/hotspot/jtreg/runtime/appcds/test-classes/TestWithProfilerHelper.java test/jdk/ProblemList.txt test/jdk/TEST.ROOT test/jdk/TEST.groups test/jdk/jdk/jfr/TEST.properties test/jdk/jdk/jfr/api/consumer/TEST.properties test/jdk/jdk/jfr/api/consumer/TestFieldAccess.java test/jdk/jdk/jfr/api/consumer/TestGetStackTrace.java test/jdk/jdk/jfr/api/consumer/TestHiddenMethod.java test/jdk/jdk/jfr/api/consumer/TestMethodGetModifiers.java test/jdk/jdk/jfr/api/consumer/TestReadTwice.java test/jdk/jdk/jfr/api/consumer/TestRecordedClassLoader.java test/jdk/jdk/jfr/api/consumer/TestRecordedEvent.java test/jdk/jdk/jfr/api/consumer/TestRecordedEventGetThread.java test/jdk/jdk/jfr/api/consumer/TestRecordedEventGetThreadOther.java test/jdk/jdk/jfr/api/consumer/TestRecordedFrame.java test/jdk/jdk/jfr/api/consumer/TestRecordedFullStackTrace.java test/jdk/jdk/jfr/api/consumer/TestRecordedInstantEventTimestamp.java test/jdk/jdk/jfr/api/consumer/TestRecordedMethodDescriptor.java test/jdk/jdk/jfr/api/consumer/TestRecordedObject.java test/jdk/jdk/jfr/api/consumer/TestRecordedThreadGroupParent.java test/jdk/jdk/jfr/api/consumer/TestRecordingFile.java test/jdk/jdk/jfr/api/consumer/TestRecordingFileReadEventEof.java test/jdk/jdk/jfr/api/consumer/TestRecordingInternals.java test/jdk/jdk/jfr/api/consumer/TestSingleRecordedEvent.java test/jdk/jdk/jfr/api/consumer/TestToString.java test/jdk/jdk/jfr/api/consumer/TestValueDescriptorRecorded.java test/jdk/jdk/jfr/api/event/TEST.properties test/jdk/jdk/jfr/api/event/TestAbstractEvent.java test/jdk/jdk/jfr/api/event/TestBeginEnd.java test/jdk/jdk/jfr/api/event/TestClinitRegistration.java test/jdk/jdk/jfr/api/event/TestClonedEvent.java test/jdk/jdk/jfr/api/event/TestEnableDisable.java test/jdk/jdk/jfr/api/event/TestEventFactory.java test/jdk/jdk/jfr/api/event/TestEventFactoryRegisterTwice.java test/jdk/jdk/jfr/api/event/TestEventFactoryRegistration.java test/jdk/jdk/jfr/api/event/TestExtends.java test/jdk/jdk/jfr/api/event/TestGetDuration.java test/jdk/jdk/jfr/api/event/TestIsEnabled.java test/jdk/jdk/jfr/api/event/TestIsEnabledMultiple.java test/jdk/jdk/jfr/api/event/TestOwnCommit.java test/jdk/jdk/jfr/api/event/TestShouldCommit.java test/jdk/jdk/jfr/api/event/TestStaticEnable.java test/jdk/jdk/jfr/api/event/dynamic/TestDynamicAnnotations.java test/jdk/jdk/jfr/api/event/dynamic/TestEventFactory.java test/jdk/jdk/jfr/api/flightrecorder/MyListener.java test/jdk/jdk/jfr/api/flightrecorder/TestAddListenerTwice.java test/jdk/jdk/jfr/api/flightrecorder/TestAddPeriodicEvent.java test/jdk/jdk/jfr/api/flightrecorder/TestFlightRecorderListenerRecorderInitialized.java test/jdk/jdk/jfr/api/flightrecorder/TestGetEventTypes.java test/jdk/jdk/jfr/api/flightrecorder/TestGetPlatformRecorder.java test/jdk/jdk/jfr/api/flightrecorder/TestGetRecordings.java test/jdk/jdk/jfr/api/flightrecorder/TestGetSettings.java test/jdk/jdk/jfr/api/flightrecorder/TestIsAvailable.java test/jdk/jdk/jfr/api/flightrecorder/TestIsInitialized.java test/jdk/jdk/jfr/api/flightrecorder/TestListener.java test/jdk/jdk/jfr/api/flightrecorder/TestListenerNull.java test/jdk/jdk/jfr/api/flightrecorder/TestPeriodicEventsSameHook.java test/jdk/jdk/jfr/api/flightrecorder/TestRecorderInitializationCallback.java test/jdk/jdk/jfr/api/flightrecorder/TestRegisterUnregisterEvent.java test/jdk/jdk/jfr/api/flightrecorder/TestSettingsControl.java test/jdk/jdk/jfr/api/flightrecorder/TestSnapshot.java test/jdk/jdk/jfr/api/metadata/annotations/TestCategory.java test/jdk/jdk/jfr/api/metadata/annotations/TestContentType.java test/jdk/jdk/jfr/api/metadata/annotations/TestDescription.java test/jdk/jdk/jfr/api/metadata/annotations/TestDynamicAnnotation.java test/jdk/jdk/jfr/api/metadata/annotations/TestEnabled.java test/jdk/jdk/jfr/api/metadata/annotations/TestExperimental.java test/jdk/jdk/jfr/api/metadata/annotations/TestFieldAnnotations.java test/jdk/jdk/jfr/api/metadata/annotations/TestHasValue.java test/jdk/jdk/jfr/api/metadata/annotations/TestInheritedAnnotations.java test/jdk/jdk/jfr/api/metadata/annotations/TestLabel.java test/jdk/jdk/jfr/api/metadata/annotations/TestMetadata.java test/jdk/jdk/jfr/api/metadata/annotations/TestName.java test/jdk/jdk/jfr/api/metadata/annotations/TestPeriod.java test/jdk/jdk/jfr/api/metadata/annotations/TestRegistered.java test/jdk/jdk/jfr/api/metadata/annotations/TestRegisteredFalseAndRunning.java test/jdk/jdk/jfr/api/metadata/annotations/TestRelational.java test/jdk/jdk/jfr/api/metadata/annotations/TestSimpleMetadataEvent.java test/jdk/jdk/jfr/api/metadata/annotations/TestStackTrace.java test/jdk/jdk/jfr/api/metadata/annotations/TestThreshold.java test/jdk/jdk/jfr/api/metadata/annotations/TestTypesIdentical.java test/jdk/jdk/jfr/api/metadata/eventtype/EventWithCustomSettings.java test/jdk/jdk/jfr/api/metadata/eventtype/TestGetAnnotation.java test/jdk/jdk/jfr/api/metadata/eventtype/TestGetAnnotationElements.java test/jdk/jdk/jfr/api/metadata/eventtype/TestGetAnnotations.java test/jdk/jdk/jfr/api/metadata/eventtype/TestGetCategory.java test/jdk/jdk/jfr/api/metadata/eventtype/TestGetDefaultValues.java test/jdk/jdk/jfr/api/metadata/eventtype/TestGetDescription.java test/jdk/jdk/jfr/api/metadata/eventtype/TestGetEventType.java test/jdk/jdk/jfr/api/metadata/eventtype/TestGetField.java test/jdk/jdk/jfr/api/metadata/eventtype/TestGetFields.java test/jdk/jdk/jfr/api/metadata/eventtype/TestGetSettings.java test/jdk/jdk/jfr/api/metadata/eventtype/TestUnloadingEventClass.java test/jdk/jdk/jfr/api/metadata/settingdescriptor/AnnotatedSetting.java test/jdk/jdk/jfr/api/metadata/settingdescriptor/BaseEvent.java test/jdk/jdk/jfr/api/metadata/settingdescriptor/CustomEvent.java test/jdk/jdk/jfr/api/metadata/settingdescriptor/PlainSetting.java test/jdk/jdk/jfr/api/metadata/settingdescriptor/TestDefaultValue.java test/jdk/jdk/jfr/api/metadata/settingdescriptor/TestGetAnnotation.java test/jdk/jdk/jfr/api/metadata/settingdescriptor/TestGetAnnotationElement.java test/jdk/jdk/jfr/api/metadata/settingdescriptor/TestGetContentType.java test/jdk/jdk/jfr/api/metadata/settingdescriptor/TestGetDescription.java test/jdk/jdk/jfr/api/metadata/settingdescriptor/TestGetLabel.java test/jdk/jdk/jfr/api/metadata/settingdescriptor/TestGetName.java test/jdk/jdk/jfr/api/metadata/settingdescriptor/TestGetTypeId.java test/jdk/jdk/jfr/api/metadata/settingdescriptor/TestGetTypeName.java test/jdk/jdk/jfr/api/metadata/valuedescriptor/TestClasses.java test/jdk/jdk/jfr/api/metadata/valuedescriptor/TestConstructor.java test/jdk/jdk/jfr/api/metadata/valuedescriptor/TestGetAnnotations.java test/jdk/jdk/jfr/api/metadata/valuedescriptor/TestGetFields.java test/jdk/jdk/jfr/api/metadata/valuedescriptor/TestIsArray.java test/jdk/jdk/jfr/api/metadata/valuedescriptor/TestSimpleTypes.java test/jdk/jdk/jfr/api/metadata/valuedescriptor/TestValueDescriptorContentType.java test/jdk/jdk/jfr/api/modules/TestModularizedEvent.java test/jdk/jdk/jfr/api/modules/src_mods/test.jfr.annotation/module-info.java test/jdk/jdk/jfr/api/modules/src_mods/test.jfr.annotation/test/jfr/annotation/ModularizedAnnotation.java test/jdk/jdk/jfr/api/modules/src_mods/test.jfr.event/module-info.java test/jdk/jdk/jfr/api/modules/src_mods/test.jfr.event/test/jfr/event/ModularizedOrdinaryEvent.java test/jdk/jdk/jfr/api/modules/src_mods/test.jfr.event/test/jfr/event/ModularizedPeriodicEvent.java test/jdk/jdk/jfr/api/modules/src_mods/test.jfr.main/module-info.java test/jdk/jdk/jfr/api/modules/src_mods/test.jfr.main/test/jfr/main/MainTest.java test/jdk/jdk/jfr/api/modules/src_mods/test.jfr.setting/module-info.java test/jdk/jdk/jfr/api/modules/src_mods/test.jfr.setting/test/jfr/setting/ModularizedSetting.java test/jdk/jdk/jfr/api/recorder/TestRecorderInitialized.java test/jdk/jdk/jfr/api/recorder/TestRecorderListener.java test/jdk/jdk/jfr/api/recorder/TestStartStopRecording.java test/jdk/jdk/jfr/api/recording/destination/TestDestFileExist.java test/jdk/jdk/jfr/api/recording/destination/TestDestFileReadOnly.java test/jdk/jdk/jfr/api/recording/destination/TestDestInvalid.java test/jdk/jdk/jfr/api/recording/destination/TestDestLongPath.java test/jdk/jdk/jfr/api/recording/destination/TestDestMultiple.java test/jdk/jdk/jfr/api/recording/destination/TestDestReadOnly.java test/jdk/jdk/jfr/api/recording/destination/TestDestState.java test/jdk/jdk/jfr/api/recording/destination/TestDestToDiskFalse.java test/jdk/jdk/jfr/api/recording/destination/TestDestToDiskTrue.java test/jdk/jdk/jfr/api/recording/destination/TestDestWithDuration.java test/jdk/jdk/jfr/api/recording/dump/TestDump.java test/jdk/jdk/jfr/api/recording/dump/TestDumpInvalid.java test/jdk/jdk/jfr/api/recording/dump/TestDumpLongPath.java test/jdk/jdk/jfr/api/recording/dump/TestDumpMultiple.java test/jdk/jdk/jfr/api/recording/dump/TestDumpReadOnly.java test/jdk/jdk/jfr/api/recording/dump/TestDumpState.java test/jdk/jdk/jfr/api/recording/event/TEST.properties test/jdk/jdk/jfr/api/recording/event/TestChunkPeriod.java test/jdk/jdk/jfr/api/recording/event/TestEnableClass.java test/jdk/jdk/jfr/api/recording/event/TestEnableName.java test/jdk/jdk/jfr/api/recording/event/TestEventTime.java test/jdk/jdk/jfr/api/recording/event/TestLoadEventAfterStart.java test/jdk/jdk/jfr/api/recording/event/TestPeriod.java test/jdk/jdk/jfr/api/recording/event/TestReEnableClass.java test/jdk/jdk/jfr/api/recording/event/TestReEnableMultiple.java test/jdk/jdk/jfr/api/recording/event/TestReEnableName.java test/jdk/jdk/jfr/api/recording/event/TestRecordingEnableDisable.java test/jdk/jdk/jfr/api/recording/event/TestThreshold.java test/jdk/jdk/jfr/api/recording/misc/TestGetId.java test/jdk/jdk/jfr/api/recording/misc/TestGetSize.java test/jdk/jdk/jfr/api/recording/misc/TestGetSizeToMem.java test/jdk/jdk/jfr/api/recording/misc/TestGetStream.java test/jdk/jdk/jfr/api/recording/misc/TestRecordingBase.java test/jdk/jdk/jfr/api/recording/misc/TestRecordingCopy.java test/jdk/jdk/jfr/api/recording/options/TestDuration.java test/jdk/jdk/jfr/api/recording/options/TestName.java test/jdk/jdk/jfr/api/recording/settings/TestConfigurationGetContents.java test/jdk/jdk/jfr/api/recording/settings/TestCreateConfigFromPath.java test/jdk/jdk/jfr/api/recording/settings/TestCreateConfigFromReader.java test/jdk/jdk/jfr/api/recording/settings/TestGetConfigurations.java test/jdk/jdk/jfr/api/recording/settings/TestSettingsAvailability.java test/jdk/jdk/jfr/api/recording/settings/settings.jfc test/jdk/jdk/jfr/api/recording/state/TestOptionState.java test/jdk/jdk/jfr/api/recording/state/TestState.java test/jdk/jdk/jfr/api/recording/state/TestStateDuration.java test/jdk/jdk/jfr/api/recording/state/TestStateIdenticalListeners.java test/jdk/jdk/jfr/api/recording/state/TestStateInvalid.java test/jdk/jdk/jfr/api/recording/state/TestStateMultiple.java test/jdk/jdk/jfr/api/recording/state/TestStateScheduleStart.java test/jdk/jdk/jfr/api/recording/time/TestTime.java test/jdk/jdk/jfr/api/recording/time/TestTimeDuration.java test/jdk/jdk/jfr/api/recording/time/TestTimeMultiple.java test/jdk/jdk/jfr/api/recording/time/TestTimeScheduleStart.java test/jdk/jdk/jfr/api/settings/RegExpControl.java test/jdk/jdk/jfr/api/settings/StringListSetting.java test/jdk/jdk/jfr/api/settings/TestFilterEvents.java test/jdk/jdk/jfr/cmd/ExecuteHelper.java test/jdk/jdk/jfr/cmd/TestHelp.java test/jdk/jdk/jfr/cmd/TestPrint.java test/jdk/jdk/jfr/cmd/TestPrintDefault.java test/jdk/jdk/jfr/cmd/TestPrintJSON.java test/jdk/jdk/jfr/cmd/TestPrintXML.java test/jdk/jdk/jfr/cmd/TestReconstruct.java test/jdk/jdk/jfr/cmd/TestSplit.java test/jdk/jdk/jfr/cmd/TestSummary.java test/jdk/jdk/jfr/event/TEST.properties test/jdk/jdk/jfr/event/compiler/TestAllocInNewTLAB.java test/jdk/jdk/jfr/event/compiler/TestAllocOutsideTLAB.java test/jdk/jdk/jfr/event/compiler/TestCodeCacheConfig.java test/jdk/jdk/jfr/event/compiler/TestCodeCacheFull.java test/jdk/jdk/jfr/event/compiler/TestCodeCacheStats.java test/jdk/jdk/jfr/event/compiler/TestCodeSweeper.java test/jdk/jdk/jfr/event/compiler/TestCodeSweeperConfig.java test/jdk/jdk/jfr/event/compiler/TestCodeSweeperStats.java test/jdk/jdk/jfr/event/compiler/TestCompilerCompile.java test/jdk/jdk/jfr/event/compiler/TestCompilerConfig.java test/jdk/jdk/jfr/event/compiler/TestCompilerInlining.java test/jdk/jdk/jfr/event/compiler/TestCompilerPhase.java test/jdk/jdk/jfr/event/compiler/TestCompilerStats.java test/jdk/jdk/jfr/event/gc/collection/AppGCProvoker.java test/jdk/jdk/jfr/event/gc/collection/GCEventAll.java test/jdk/jdk/jfr/event/gc/collection/GCGarbageCollectionUtil.java test/jdk/jdk/jfr/event/gc/collection/TestGCCauseWithCMSConcurrent.java test/jdk/jdk/jfr/event/gc/collection/TestGCCauseWithCMSMarkSweep.java test/jdk/jdk/jfr/event/gc/collection/TestGCCauseWithG1ConcurrentMark.java test/jdk/jdk/jfr/event/gc/collection/TestGCCauseWithG1FullCollection.java test/jdk/jdk/jfr/event/gc/collection/TestGCCauseWithPSMarkSweep.java test/jdk/jdk/jfr/event/gc/collection/TestGCCauseWithParallelOld.java test/jdk/jdk/jfr/event/gc/collection/TestGCCauseWithSerial.java test/jdk/jdk/jfr/event/gc/collection/TestGCEventMixedWithCMSConcurrent.java test/jdk/jdk/jfr/event/gc/collection/TestGCEventMixedWithCMSMarkSweep.java test/jdk/jdk/jfr/event/gc/collection/TestGCEventMixedWithG1ConcurrentMark.java test/jdk/jdk/jfr/event/gc/collection/TestGCEventMixedWithG1FullCollection.java test/jdk/jdk/jfr/event/gc/collection/TestGCEventMixedWithPSMarkSweep.java test/jdk/jdk/jfr/event/gc/collection/TestGCEventMixedWithParNew.java test/jdk/jdk/jfr/event/gc/collection/TestGCEventMixedWithParallelOld.java test/jdk/jdk/jfr/event/gc/collection/TestGCEventMixedWithSerial.java test/jdk/jdk/jfr/event/gc/collection/TestGCGarbageCollectionEvent.java test/jdk/jdk/jfr/event/gc/collection/TestGCWithFasttime.java test/jdk/jdk/jfr/event/gc/collection/TestYoungGarbageCollectionEventWithDefNew.java test/jdk/jdk/jfr/event/gc/collection/TestYoungGarbageCollectionEventWithG1New.java test/jdk/jdk/jfr/event/gc/collection/TestYoungGarbageCollectionEventWithParNew.java test/jdk/jdk/jfr/event/gc/collection/TestYoungGarbageCollectionEventWithParallelScavenge.java test/jdk/jdk/jfr/event/gc/collection/YoungGarbageCollectionEvent.java test/jdk/jdk/jfr/event/gc/collection/gc-testsettings.jfc test/jdk/jdk/jfr/event/gc/configuration/GCHeapConfigurationEventTester.java test/jdk/jdk/jfr/event/gc/configuration/GCHeapConfigurationEventVerifier.java test/jdk/jdk/jfr/event/gc/configuration/GCYoungGenerationConfigurationEventTester.java test/jdk/jdk/jfr/event/gc/configuration/TestGCConfigurationEvent.java test/jdk/jdk/jfr/event/gc/configuration/TestGCConfigurationEventWithDefaultPauseTarget.java test/jdk/jdk/jfr/event/gc/configuration/TestGCHeapConfigurationEventWith32BitOops.java test/jdk/jdk/jfr/event/gc/configuration/TestGCHeapConfigurationEventWith32BitOops.sh test/jdk/jdk/jfr/event/gc/configuration/TestGCHeapConfigurationEventWithHeapBasedOops.java test/jdk/jdk/jfr/event/gc/configuration/TestGCHeapConfigurationEventWithHeapBasedOops.sh test/jdk/jdk/jfr/event/gc/configuration/TestGCHeapConfigurationEventWithZeroBasedOops.java test/jdk/jdk/jfr/event/gc/configuration/TestGCHeapConfigurationEventWithZeroBasedOops.sh test/jdk/jdk/jfr/event/gc/configuration/TestGCSurvivorConfigurationEvent.java test/jdk/jdk/jfr/event/gc/configuration/TestGCTLABConfigurationEvent.java test/jdk/jdk/jfr/event/gc/configuration/TestGCYoungGenerationConfigurationEventWithMinAndMaxSize.java test/jdk/jdk/jfr/event/gc/configuration/TestGCYoungGenerationConfigurationEventWithNewRatio.java test/jdk/jdk/jfr/event/gc/detailed/ExecuteOOMApp.java test/jdk/jdk/jfr/event/gc/detailed/OOMApp.java test/jdk/jdk/jfr/event/gc/detailed/PromotionEvent.java test/jdk/jdk/jfr/event/gc/detailed/PromotionFailedEvent.java test/jdk/jdk/jfr/event/gc/detailed/StressAllocationGCEvents.java test/jdk/jdk/jfr/event/gc/detailed/TestCMSConcurrentModeFailureEvent.java test/jdk/jdk/jfr/event/gc/detailed/TestEvacuationFailedEvent.java test/jdk/jdk/jfr/event/gc/detailed/TestEvacuationInfoEvent.java test/jdk/jdk/jfr/event/gc/detailed/TestG1AIHOPEvent.java test/jdk/jdk/jfr/event/gc/detailed/TestG1ConcurrentModeFailureEvent.java test/jdk/jdk/jfr/event/gc/detailed/TestG1EvacMemoryStatsEvent.java test/jdk/jdk/jfr/event/gc/detailed/TestG1HeapRegionInformationEvent.java test/jdk/jdk/jfr/event/gc/detailed/TestG1HeapRegionTypeChangeEvent.java test/jdk/jdk/jfr/event/gc/detailed/TestG1IHOPEvent.java test/jdk/jdk/jfr/event/gc/detailed/TestG1MMUEvent.java test/jdk/jdk/jfr/event/gc/detailed/TestPromotionEventWithG1.java test/jdk/jdk/jfr/event/gc/detailed/TestPromotionEventWithParallelScavenge.java test/jdk/jdk/jfr/event/gc/detailed/TestPromotionFailedEventWithDefNew.java test/jdk/jdk/jfr/event/gc/detailed/TestPromotionFailedEventWithParNew.java test/jdk/jdk/jfr/event/gc/detailed/TestPromotionFailedEventWithParallelScavenge.java test/jdk/jdk/jfr/event/gc/detailed/TestStressAllocationGCEventsWithCMS.java test/jdk/jdk/jfr/event/gc/detailed/TestStressAllocationGCEventsWithDefNew.java test/jdk/jdk/jfr/event/gc/detailed/TestStressAllocationGCEventsWithG1.java test/jdk/jdk/jfr/event/gc/detailed/TestStressAllocationGCEventsWithParNew.java test/jdk/jdk/jfr/event/gc/detailed/TestStressAllocationGCEventsWithParallel.java test/jdk/jdk/jfr/event/gc/detailed/TestStressBigAllocationGCEventsWithCMS.java test/jdk/jdk/jfr/event/gc/detailed/TestStressBigAllocationGCEventsWithDefNew.java test/jdk/jdk/jfr/event/gc/detailed/TestStressBigAllocationGCEventsWithG1.java test/jdk/jdk/jfr/event/gc/detailed/TestStressBigAllocationGCEventsWithParNew.java test/jdk/jdk/jfr/event/gc/detailed/TestStressBigAllocationGCEventsWithParallel.java test/jdk/jdk/jfr/event/gc/detailed/TestTenuringDistributionEvent.java test/jdk/jdk/jfr/event/gc/detailed/concurrentmodefailure-testsettings.jfc test/jdk/jdk/jfr/event/gc/detailed/evacuationfailed-testsettings.jfc test/jdk/jdk/jfr/event/gc/detailed/promotionfailed-testsettings.jfc test/jdk/jdk/jfr/event/gc/heapsummary/HeapSummaryEventAllGcs.java test/jdk/jdk/jfr/event/gc/heapsummary/TestHeapSummaryCommittedSize.java test/jdk/jdk/jfr/event/gc/heapsummary/TestHeapSummaryEventConcurrentCMS.java test/jdk/jdk/jfr/event/gc/heapsummary/TestHeapSummaryEventDefNewSerial.java test/jdk/jdk/jfr/event/gc/heapsummary/TestHeapSummaryEventG1.java test/jdk/jdk/jfr/event/gc/heapsummary/TestHeapSummaryEventPSParOld.java test/jdk/jdk/jfr/event/gc/heapsummary/TestHeapSummaryEventPSSerial.java test/jdk/jdk/jfr/event/gc/heapsummary/TestHeapSummaryEventParNewCMS.java test/jdk/jdk/jfr/event/gc/objectcount/ObjectCountAfterGCEvent.java test/jdk/jdk/jfr/event/gc/objectcount/ObjectCountEventVerifier.java test/jdk/jdk/jfr/event/gc/objectcount/TestObjectCountAfterGCEventWithCMSConcurrent.java test/jdk/jdk/jfr/event/gc/objectcount/TestObjectCountAfterGCEventWithCMSMarkSweep.java test/jdk/jdk/jfr/event/gc/objectcount/TestObjectCountAfterGCEventWithG1ConcurrentMark.java test/jdk/jdk/jfr/event/gc/objectcount/TestObjectCountAfterGCEventWithG1FullCollection.java test/jdk/jdk/jfr/event/gc/objectcount/TestObjectCountAfterGCEventWithPSMarkSweep.java test/jdk/jdk/jfr/event/gc/objectcount/TestObjectCountAfterGCEventWithParallelOld.java test/jdk/jdk/jfr/event/gc/objectcount/TestObjectCountAfterGCEventWithSerial.java test/jdk/jdk/jfr/event/gc/objectcount/TestObjectCountEvent.java test/jdk/jdk/jfr/event/gc/refstat/RefStatEvent.java test/jdk/jdk/jfr/event/gc/refstat/TestRefStatEventWithCMSConcurrent.java test/jdk/jdk/jfr/event/gc/refstat/TestRefStatEventWithCMSMarkSweep.java test/jdk/jdk/jfr/event/gc/refstat/TestRefStatEventWithDefNew.java test/jdk/jdk/jfr/event/gc/refstat/TestRefStatEventWithG1ConcurrentMark.java test/jdk/jdk/jfr/event/gc/refstat/TestRefStatEventWithG1FullCollection.java test/jdk/jdk/jfr/event/gc/refstat/TestRefStatEventWithG1New.java test/jdk/jdk/jfr/event/gc/refstat/TestRefStatEventWithPSMarkSweep.java test/jdk/jdk/jfr/event/gc/refstat/TestRefStatEventWithParallelOld.java test/jdk/jdk/jfr/event/gc/refstat/TestRefStatEventWithParallelScavenge.java test/jdk/jdk/jfr/event/gc/stacktrace/AllocationStackTrace.java test/jdk/jdk/jfr/event/gc/stacktrace/TEST.properties test/jdk/jdk/jfr/event/gc/stacktrace/TestConcMarkSweepAllocationPendingStackTrace.java test/jdk/jdk/jfr/event/gc/stacktrace/TestDefNewAllocationPendingStackTrace.java test/jdk/jdk/jfr/event/gc/stacktrace/TestG1HumongousAllocationPendingStackTrace.java test/jdk/jdk/jfr/event/gc/stacktrace/TestG1OldAllocationPendingStackTrace.java test/jdk/jdk/jfr/event/gc/stacktrace/TestG1YoungAllocationPendingStackTrace.java test/jdk/jdk/jfr/event/gc/stacktrace/TestMarkSweepCompactAllocationPendingStackTrace.java test/jdk/jdk/jfr/event/gc/stacktrace/TestMetaspaceConcMarkSweepGCAllocationPendingStackTrace.java test/jdk/jdk/jfr/event/gc/stacktrace/TestMetaspaceG1GCAllocationPendingStackTrace.java test/jdk/jdk/jfr/event/gc/stacktrace/TestMetaspaceParallelGCAllocationPendingStackTrace.java test/jdk/jdk/jfr/event/gc/stacktrace/TestMetaspaceSerialGCAllocationPendingStackTrace.java test/jdk/jdk/jfr/event/gc/stacktrace/TestParNewAllocationPendingStackTrace.java test/jdk/jdk/jfr/event/gc/stacktrace/TestParallelMarkSweepAllocationPendingStackTrace.java test/jdk/jdk/jfr/event/gc/stacktrace/TestParallelScavengeAllocationPendingStackTrace.java test/jdk/jdk/jfr/event/io/EvilInstrument.java test/jdk/jdk/jfr/event/io/IOEvent.java test/jdk/jdk/jfr/event/io/IOHelper.java test/jdk/jdk/jfr/event/io/InstrumentationCallback.java test/jdk/jdk/jfr/event/io/MakeJAR.sh test/jdk/jdk/jfr/event/io/TestDisabledEvents.java test/jdk/jdk/jfr/event/io/TestFileChannelEvents.java test/jdk/jdk/jfr/event/io/TestFileReadOnly.java test/jdk/jdk/jfr/event/io/TestFileStreamEvents.java test/jdk/jdk/jfr/event/io/TestInstrumentation.java test/jdk/jdk/jfr/event/io/TestInstrumentation.mf test/jdk/jdk/jfr/event/io/TestRandomAccessFileEvents.java test/jdk/jdk/jfr/event/io/TestRandomAccessFileThread.java test/jdk/jdk/jfr/event/io/TestSocketChannelEvents.java test/jdk/jdk/jfr/event/io/TestSocketEvents.java test/jdk/jdk/jfr/event/metadata/TestDefaultConfigurations.java test/jdk/jdk/jfr/event/metadata/TestEventMetadata.java test/jdk/jdk/jfr/event/oldobject/OldObjects.java test/jdk/jdk/jfr/event/oldobject/TestAllocationTime.java test/jdk/jdk/jfr/event/oldobject/TestArrayInformation.java test/jdk/jdk/jfr/event/oldobject/TestCMS.java test/jdk/jdk/jfr/event/oldobject/TestCircularReference.java test/jdk/jdk/jfr/event/oldobject/TestClassLoader.java test/jdk/jdk/jfr/event/oldobject/TestClassLoaderLeak.java test/jdk/jdk/jfr/event/oldobject/TestFieldInformation.java test/jdk/jdk/jfr/event/oldobject/TestG1.java test/jdk/jdk/jfr/event/oldobject/TestHeapDeep.java test/jdk/jdk/jfr/event/oldobject/TestHeapShallow.java test/jdk/jdk/jfr/event/oldobject/TestLargeRootSet.java test/jdk/jdk/jfr/event/oldobject/TestListenerLeak.java test/jdk/jdk/jfr/event/oldobject/TestMetadataObject.java test/jdk/jdk/jfr/event/oldobject/TestMetadataRetention.java test/jdk/jdk/jfr/event/oldobject/TestObjectDescription.java test/jdk/jdk/jfr/event/oldobject/TestParallel.java test/jdk/jdk/jfr/event/oldobject/TestParallelOld.java test/jdk/jdk/jfr/event/oldobject/TestReferenceChainLimit.java test/jdk/jdk/jfr/event/oldobject/TestSanityDefault.java test/jdk/jdk/jfr/event/oldobject/TestSerial.java test/jdk/jdk/jfr/event/oldobject/TestThreadLocalLeak.java test/jdk/jdk/jfr/event/os/TestCPUInformation.java test/jdk/jdk/jfr/event/os/TestCPULoad.java test/jdk/jdk/jfr/event/os/TestCPUTimeStampCounter.java test/jdk/jdk/jfr/event/os/TestInitialEnvironmentVariable.java test/jdk/jdk/jfr/event/os/TestInitialEnvironmentVariable.sh test/jdk/jdk/jfr/event/os/TestOSInfo.java test/jdk/jdk/jfr/event/os/TestPhysicalMemoryEvent.java test/jdk/jdk/jfr/event/os/TestSystemProcess.java test/jdk/jdk/jfr/event/os/TestThreadContextSwitches.java test/jdk/jdk/jfr/event/profiling/TestFullStackTrace.java test/jdk/jdk/jfr/event/runtime/TestActiveRecordingEvent.java test/jdk/jdk/jfr/event/runtime/TestActiveSettingEvent.java test/jdk/jdk/jfr/event/runtime/TestBiasedLockRevocationEvents.java test/jdk/jdk/jfr/event/runtime/TestClassDefineEvent.java test/jdk/jdk/jfr/event/runtime/TestClassLoadEvent.java test/jdk/jdk/jfr/event/runtime/TestClassLoaderStatsEvent.java test/jdk/jdk/jfr/event/runtime/TestClassLoadingStatisticsEvent.java test/jdk/jdk/jfr/event/runtime/TestClassUnloadEvent.java test/jdk/jdk/jfr/event/runtime/TestClasses.java test/jdk/jdk/jfr/event/runtime/TestExceptionEvents.java test/jdk/jdk/jfr/event/runtime/TestExceptionSubclass.java test/jdk/jdk/jfr/event/runtime/TestJavaBlockedEvent.java test/jdk/jdk/jfr/event/runtime/TestJavaMonitorInflateEvent.java test/jdk/jdk/jfr/event/runtime/TestJavaMonitorWaitEvent.java test/jdk/jdk/jfr/event/runtime/TestJavaMonitorWaitTimeOut.java test/jdk/jdk/jfr/event/runtime/TestJavaThreadStatisticsEvent.java test/jdk/jdk/jfr/event/runtime/TestJavaThreadStatisticsEventBean.java test/jdk/jdk/jfr/event/runtime/TestModuleEvents.java test/jdk/jdk/jfr/event/runtime/TestNativeLibrariesEvent.java test/jdk/jdk/jfr/event/runtime/TestSafepointEvents.java test/jdk/jdk/jfr/event/runtime/TestSizeTFlags.java test/jdk/jdk/jfr/event/runtime/TestSystemPropertyEvent.java test/jdk/jdk/jfr/event/runtime/TestThreadAllocationEvent.java test/jdk/jdk/jfr/event/runtime/TestThreadCpuTimeEvent.java test/jdk/jdk/jfr/event/runtime/TestThreadDumpEvent.java test/jdk/jdk/jfr/event/runtime/TestThreadParkEvent.java test/jdk/jdk/jfr/event/runtime/TestThreadSleepEvent.java test/jdk/jdk/jfr/event/runtime/TestThreadStartEndEvents.java test/jdk/jdk/jfr/event/runtime/TestThrowableInstrumentation.java test/jdk/jdk/jfr/event/runtime/TestVMInfoEvent.flags test/jdk/jdk/jfr/event/runtime/TestVMInfoEvent.java test/jdk/jdk/jfr/event/runtime/TestVMInfoEvent.sh test/jdk/jdk/jfr/event/runtime/TestVMOperation.java test/jdk/jdk/jfr/event/runtime/TestVmFlagChangedEvent.java test/jdk/jdk/jfr/event/runtime/exception.security.policy test/jdk/jdk/jfr/event/sampling/TestNative.java test/jdk/jdk/jfr/event/sampling/libTestNative.c test/jdk/jdk/jfr/jcmd/JcmdAsserts.java test/jdk/jdk/jfr/jcmd/JcmdHelper.java test/jdk/jdk/jfr/jcmd/TEST.properties test/jdk/jdk/jfr/jcmd/TestJcmdChangeLogLevel.java test/jdk/jdk/jfr/jcmd/TestJcmdConfigure.java test/jdk/jdk/jfr/jcmd/TestJcmdDump.java test/jdk/jdk/jfr/jcmd/TestJcmdDumpPathToGCRoots.java test/jdk/jdk/jfr/jcmd/TestJcmdLegacy.java test/jdk/jdk/jfr/jcmd/TestJcmdSaveToFile.java test/jdk/jdk/jfr/jcmd/TestJcmdStartDirNotExist.java test/jdk/jdk/jfr/jcmd/TestJcmdStartInvaldFile.java test/jdk/jdk/jfr/jcmd/TestJcmdStartPathToGCRoots.java test/jdk/jdk/jfr/jcmd/TestJcmdStartReadOnlyFile.java test/jdk/jdk/jfr/jcmd/TestJcmdStartStopDefault.java test/jdk/jdk/jfr/jcmd/TestJcmdStartWithOptions.java test/jdk/jdk/jfr/jcmd/TestJcmdStartWithSettings.java test/jdk/jdk/jfr/jcmd/TestJcmdStopInvalidFile.java test/jdk/jdk/jfr/jcmd/TestJcmdStopReadOnlyFile.java test/jdk/jdk/jfr/jcmd/jcmd-testsettings.2.jfc test/jdk/jdk/jfr/jcmd/jcmd-testsettings.jfc test/jdk/jdk/jfr/jcmd/jcmd-testsettings3.jfc test/jdk/jdk/jfr/jcmd/legacy.jfc test/jdk/jdk/jfr/jmx/JmxHelper.java test/jdk/jdk/jfr/jmx/TEST.properties test/jdk/jdk/jfr/jmx/TestClone.java test/jdk/jdk/jfr/jmx/TestCloneRepeat.java test/jdk/jdk/jfr/jmx/TestConfigurationInfo.java test/jdk/jdk/jfr/jmx/TestCopyTo.java test/jdk/jdk/jfr/jmx/TestCopyToInvalidPath.java test/jdk/jdk/jfr/jmx/TestCopyToReadOnlyDir.java test/jdk/jdk/jfr/jmx/TestCopyToRunning.java test/jdk/jdk/jfr/jmx/TestEventTypes.java test/jdk/jdk/jfr/jmx/TestGetRecordings.java test/jdk/jdk/jfr/jmx/TestGetRecordingsMultiple.java test/jdk/jdk/jfr/jmx/TestMultipleRecordings.java test/jdk/jdk/jfr/jmx/TestNotificationListener.java test/jdk/jdk/jfr/jmx/TestPredefinedConfiguration.java test/jdk/jdk/jfr/jmx/TestPredefinedConfigurationInvalid.java test/jdk/jdk/jfr/jmx/TestRecordingOptions.java test/jdk/jdk/jfr/jmx/TestRecordingSettings.java test/jdk/jdk/jfr/jmx/TestRecordingSettingsInvalid.java test/jdk/jdk/jfr/jmx/TestRecordingSettingsMultiple.java test/jdk/jdk/jfr/jmx/TestRecordingState.java test/jdk/jdk/jfr/jmx/TestRecordingStateInvalid.java test/jdk/jdk/jfr/jmx/TestSetConfiguration.java test/jdk/jdk/jfr/jmx/TestSetConfigurationInvalid.java test/jdk/jdk/jfr/jmx/TestSnapshot.java test/jdk/jdk/jfr/jmx/TestStartRecording.java test/jdk/jdk/jfr/jmx/TestStream.java test/jdk/jdk/jfr/jmx/TestStreamClosed.java test/jdk/jdk/jfr/jmx/TestStreamMultiple.java test/jdk/jdk/jfr/jmx/TestWrongId.java test/jdk/jdk/jfr/jmx/info/TestConfigurationInfo.java test/jdk/jdk/jfr/jmx/info/TestEventTypeInfo.java test/jdk/jdk/jfr/jmx/info/TestRecordingInfo.java test/jdk/jdk/jfr/jmx/info/TestSettingDescriptorInfo.java test/jdk/jdk/jfr/jmx/security/TestEnoughPermission.java test/jdk/jdk/jfr/jmx/security/TestNoControlPermission.java test/jdk/jdk/jfr/jmx/security/TestNoMonitorPermission.java test/jdk/jdk/jfr/jmx/security/TestNotificationListenerPermission.java test/jdk/jdk/jfr/jmx/security/enough.policy test/jdk/jdk/jfr/jmx/security/listener.policy test/jdk/jdk/jfr/jmx/security/nocontrol.policy test/jdk/jdk/jfr/jmx/security/nomonitor.policy test/jdk/jdk/jfr/jvm/HelloWorldEvent1.java test/jdk/jdk/jfr/jvm/HelloWorldEvent2.java test/jdk/jdk/jfr/jvm/TestBeginAndEnd.java test/jdk/jdk/jfr/jvm/TestClassId.java test/jdk/jdk/jfr/jvm/TestCounterTime.java test/jdk/jdk/jfr/jvm/TestCreateNative.java test/jdk/jdk/jfr/jvm/TestDumpOnCrash.java test/jdk/jdk/jfr/jvm/TestGetAllEventClasses.java test/jdk/jdk/jfr/jvm/TestGetEventWriter.java test/jdk/jdk/jfr/jvm/TestGetStackTraceId.java test/jdk/jdk/jfr/jvm/TestJFRIntrinsic.java test/jdk/jdk/jfr/jvm/TestJavaEvent.java test/jdk/jdk/jfr/jvm/TestJfrJavaBase.java test/jdk/jdk/jfr/jvm/TestLargeJavaEvent512k.java test/jdk/jdk/jfr/jvm/TestLargeJavaEvent64k.java test/jdk/jdk/jfr/jvm/TestLogImplementation.java test/jdk/jdk/jfr/jvm/TestLogOutput.java test/jdk/jdk/jfr/jvm/TestPid.java test/jdk/jdk/jfr/jvm/TestUnloadEventClassCount.java test/jdk/jdk/jfr/jvm/TestUnsupportedVM.java test/jdk/jdk/jfr/startupargs/StartupHelper.java test/jdk/jdk/jfr/startupargs/TestBadOptionValues.java test/jdk/jdk/jfr/startupargs/TestDumpOnExit.java test/jdk/jdk/jfr/startupargs/TestMemoryOptions.java test/jdk/jdk/jfr/startupargs/TestOldObjectQueueSize.java test/jdk/jdk/jfr/startupargs/TestRepositoryPath.java test/jdk/jdk/jfr/startupargs/TestRepositoryPathLong.java test/jdk/jdk/jfr/startupargs/TestRetransform.java test/jdk/jdk/jfr/startupargs/TestRetransformUsingLog.java test/jdk/jdk/jfr/startupargs/TestStartDelay.java test/jdk/jdk/jfr/startupargs/TestStartDelayRunning.java test/jdk/jdk/jfr/startupargs/TestStartDuration.java test/jdk/jdk/jfr/startupargs/TestStartMaxAgeSize.java test/jdk/jdk/jfr/startupargs/TestStartName.java test/jdk/jdk/jfr/startupargs/TestStartRecording.java test/lib/jdk/test/lib/jfr/AppExecutorHelper.java test/lib/jdk/test/lib/jfr/CommonHelper.java test/lib/jdk/test/lib/jfr/EventField.java test/lib/jdk/test/lib/jfr/EventNames.java test/lib/jdk/test/lib/jfr/EventTypePrototype.java test/lib/jdk/test/lib/jfr/EventVerifier.java test/lib/jdk/test/lib/jfr/Events.java test/lib/jdk/test/lib/jfr/FileHelper.java test/lib/jdk/test/lib/jfr/GCHelper.java test/lib/jdk/test/lib/jfr/RecurseThread.java test/lib/jdk/test/lib/jfr/SimpleEvent.java test/lib/jdk/test/lib/jfr/SimpleEventHelper.java test/lib/jdk/test/lib/jfr/SimpleSetting.java test/lib/jdk/test/lib/jfr/Stressor.java test/lib/jdk/test/lib/jfr/TestClassLoader.java test/lib/jdk/test/lib/jfr/VoidFunction.java test/lib/jdk/test/lib/thread/TestThread.java test/lib/jdk/test/lib/thread/XRun.java
diffstat 1071 files changed, 119402 insertions(+), 3407 deletions(-) [+]
line wrap: on
line diff
--- a/make/CompileJavaModules.gmk	Tue May 15 11:28:29 2018 -0700
+++ b/make/CompileJavaModules.gmk	Tue May 15 20:24:34 2018 +0200
@@ -509,6 +509,15 @@
 # Exclude BreakIterator classes that are just used in compile process to generate
 # data files and shouldn't go in the product
 jdk.localedata_EXCLUDE_FILES += sun/text/resources/ext/BreakIteratorRules_th.java
+################################################################################
+
+# There is an issue in sjavac that triggers a warning in jdk.jfr that isn't
+# triggered without sjavac.
+ifeq ($(ENABLE_SJAVAC), yes)
+  jdk.jfr_SETUP := GENERATE_JDKBYTECODE_NOWARNINGS
+endif
+jdk.jfr_COPY := .xsd .xml .dtd
+jdk.jfr_ADD_JAVAC_FLAGS := -XDstringConcat=inline -Xlint:-exports
 
 ################################################################################
 # If this is an imported module that has prebuilt classes, only compile
--- a/make/autoconf/hotspot.m4	Tue May 15 11:28:29 2018 -0700
+++ b/make/autoconf/hotspot.m4	Tue May 15 20:24:34 2018 +0200
@@ -26,7 +26,7 @@
 # All valid JVM features, regardless of platform
 VALID_JVM_FEATURES="compiler1 compiler2 zero minimal dtrace jvmti jvmci \
     graal vm-structs jni-check services management cmsgc g1gc parallelgc serialgc nmt cds \
-    static-build link-time-opt aot"
+    static-build link-time-opt aot jfr"
 
 # All valid JVM variants
 VALID_JVM_VARIANTS="server client minimal core zero custom"
@@ -309,6 +309,11 @@
     AC_MSG_ERROR([Specified JVM feature 'cmsgc' requires feature 'serialgc'])
   fi
 
+  # Enable JFR by default, except on linux-sparcv9 and on minimal.
+  if test "x$OPENJDK_TARGET_OS" != xlinux || test "x$OPENJDK_TARGET_CPU" != xsparcv9; then
+    NON_MINIMAL_FEATURES="$NON_MINIMAL_FEATURES jfr"
+  fi
+
   # Turn on additional features based on other parts of configure
   if test "x$INCLUDE_DTRACE" = "xtrue"; then
     JVM_FEATURES="$JVM_FEATURES dtrace"
@@ -396,7 +401,7 @@
     NON_MINIMAL_FEATURES="$NON_MINIMAL_FEATURES cds"
   fi
 
-  # Enable default features depending on variant.
+  # Enable features depending on variant.
   JVM_FEATURES_server="compiler1 compiler2 $NON_MINIMAL_FEATURES $JVM_FEATURES $JVM_FEATURES_jvmci $JVM_FEATURES_aot $JVM_FEATURES_graal"
   JVM_FEATURES_client="compiler1 $NON_MINIMAL_FEATURES $JVM_FEATURES $JVM_FEATURES_jvmci"
   JVM_FEATURES_core="$NON_MINIMAL_FEATURES $JVM_FEATURES"
--- a/make/autoconf/libraries.m4	Tue May 15 11:28:29 2018 -0700
+++ b/make/autoconf/libraries.m4	Tue May 15 20:24:34 2018 +0200
@@ -130,7 +130,7 @@
 
   if test "x$OPENJDK_TARGET_OS" = xsolaris; then
     BASIC_JVM_LIBS="$BASIC_JVM_LIBS -lsocket -lsched -ldoor -ldemangle -lnsl \
-        -lrt"
+        -lrt -lkstat"
     BASIC_JVM_LIBS="$BASIC_JVM_LIBS $LIBCXX_JVM"
   fi
 
--- a/make/common/Modules.gmk	Tue May 15 11:28:29 2018 -0700
+++ b/make/common/Modules.gmk	Tue May 15 20:24:34 2018 +0200
@@ -59,7 +59,9 @@
     java.security.sasl \
     java.xml \
     jdk.internal.vm.ci \
+    jdk.jfr \
     jdk.management \
+    jdk.management.jfr \
     jdk.management.agent \
     jdk.net \
     jdk.sctp \
@@ -152,6 +154,7 @@
     jdk.jdeps \
     jdk.jdi \
     jdk.jdwp.agent \
+    jdk.jfr \
     jdk.jlink \
     jdk.jsobject \
     jdk.jshell \
@@ -159,6 +162,7 @@
     jdk.localedata \
     jdk.management \
     jdk.management.agent \
+    jdk.management.jfr \
     jdk.naming.dns \
     jdk.naming.rmi \
     jdk.net \
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/make/copy/Copy-jdk.jfr.gmk	Tue May 15 20:24:34 2018 +0200
@@ -0,0 +1,46 @@
+#
+# Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.  Oracle designates this
+# particular file as subject to the "Classpath" exception as provided
+# by Oracle in the LICENSE file that accompanied this code.
+#
+# This code is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+# or visit www.oracle.com if you need additional information or have any
+# questions.
+#
+
+include CopyCommon.gmk
+
+################################################################################
+
+$(eval $(call SetupCopyFiles, COPY_JFR_METADATA, \
+    SRC := $(TOPDIR)/src/hotspot/share/jfr/metadata, \
+    DEST := $(JDK_OUTPUTDIR)/modules/jdk.jfr/jdk/jfr/internal/types, \
+    FILES := metadata.xml \
+))
+
+TARGETS += $(COPY_JFR_METADATA)
+
+JFR_CONF_DIR := $(TOPDIR)/src/jdk.jfr/share/conf/jfr
+$(eval $(call SetupCopyFiles, COPY_JFR_CONF, \
+    DEST := $(LIB_DST_DIR)/jfr, \
+    FILES := $(wildcard $(JFR_CONF_DIR)/*.jfc), \
+    FLATTEN := true, \
+))
+TARGETS += $(COPY_JFR_CONF)
+
+################################################################################
--- a/make/hotspot/gensrc/GenerateSources.gmk	Tue May 15 11:28:29 2018 -0700
+++ b/make/hotspot/gensrc/GenerateSources.gmk	Tue May 15 20:24:34 2018 +0200
@@ -38,6 +38,7 @@
 include gensrc/GensrcAdlc.gmk
 include gensrc/GensrcDtrace.gmk
 include gensrc/GensrcJvmti.gmk
+include gensrc/GensrcJfr.gmk
 
 $(eval $(call IncludeCustomExtension, hotspot/gensrc/GenerateSources.gmk))
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/make/hotspot/gensrc/GensrcJfr.gmk	Tue May 15 20:24:34 2018 +0200
@@ -0,0 +1,94 @@
+#
+# Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.  Oracle designates this
+# particular file as subject to the "Classpath" exception as provided
+# by Oracle in the LICENSE file that accompanied this code.
+#
+# This code is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+# or visit www.oracle.com if you need additional information or have any
+# questions.
+#
+
+$(eval $(call IncludeCustomExtension, hotspot/gensrc/GensrcJfr.gmk))
+
+################################################################################
+# Build tools needed for the Jfr source code generation
+
+JFR_TOOLS_SRCDIR := $(TOPDIR)/src/hotspot/share/jfr/metadata
+JFR_TOOLS_OUTPUTDIR := $(JVM_VARIANT_OUTPUTDIR)/tools/jfr
+
+$(eval $(call SetupJavaCompiler, GENERATE_JFRBYTECODE, \
+    JAVAC := $(JAVAC), \
+    FLAGS := $(DISABLE_WARNINGS), \
+    SERVER_DIR := $(SJAVAC_SERVER_DIR), \
+    SERVER_JVM := $(SJAVAC_SERVER_JAVA), \
+    DISABLE_SJAVAC := true, \
+))
+
+$(eval $(call SetupJavaCompilation, BUILD_JFR_TOOLS, \
+    SETUP := GENERATE_JFRBYTECODE, \
+    SRC := $(JFR_TOOLS_SRCDIR), \
+    INCLUDE_FILES := GenerateJfrFiles.java, \
+    BIN := $(JFR_TOOLS_OUTPUTDIR), \
+))
+
+TOOL_JFR_GEN := $(JAVA_SMALL) -cp $(JFR_TOOLS_OUTPUTDIR) GenerateJfrFiles
+
+################################################################################
+# Setup make rules for Jfr file file generation.
+#
+# Parameter 1 is the name of the rule. This name is used as variable prefix,
+# and the targets generated are listed in a variable by that name. This name is
+# also used as the name of the output file.
+#
+# Remaining parameters are named arguments. These include:
+#   XML_FILE -- The input source file to use
+#   XSD_FILE -- The input schema for validation
+#   OUTPUT_DIR -- The directory to put the generated file in
+SetupJfrGeneration = $(NamedParamsMacroTemplate)
+define SetupJfrGenerationBody
+  $$($1_OUTPUT_DIR)/$1: $$($1_XML_FILE) $$($1_XSD_FILE) $$(BUILD_JFR_TOOLS)
+	$$(call LogInfo, Generating $$(@F))
+	$$(call MakeDir, $$(@D))
+	$$(call ExecuteWithLog, $$@, $$(TOOL_JFR_GEN) $$($1_XML_FILE) $$($1_XSD_FILE) $$($1_OUTPUT_DIR))
+	test -f $$@
+
+  TARGETS += $$($1_OUTPUT_DIR)/$1
+
+endef
+
+################################################################################
+# Create files in gensrc/jfrfiles
+
+JFR_OUTPUTDIR := $(JVM_VARIANT_OUTPUTDIR)/gensrc/jfrfiles
+JFR_SRCDIR := $(TOPDIR)/src/hotspot/share/jfr/metadata
+
+METADATA_XML ?= $(JFR_SRCDIR)/metadata.xml
+METADATA_XSD ?= $(JFR_SRCDIR)/metadata.xsd
+
+# Changing these will trigger a rebuild of generated jfr files.
+JFR_DEPS += \
+    $(METADATA_XML) \
+    $(METADATA_XSD) \
+    #
+
+# our generator will generate all files in one go, so only need to setup one target rule
+$(eval $(call SetupJfrGeneration, jfrEventClasses.hpp, \
+    XML_FILE := $(METADATA_XML), \
+    XSD_FILE := $(METADATA_XSD), \
+    OUTPUT_DIR := $(JFR_OUTPUTDIR), \
+))
\ No newline at end of file
--- a/make/hotspot/gensrc/GensrcJvmti.gmk	Tue May 15 11:28:29 2018 -0700
+++ b/make/hotspot/gensrc/GensrcJvmti.gmk	Tue May 15 20:24:34 2018 +0200
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -50,7 +50,7 @@
 TOOL_JVMTI_ENV_FILL := $(JAVA_SMALL) -cp $(JVMTI_TOOLS_OUTPUTDIR) jvmtiEnvFill
 
 ################################################################################
-# Setup make rules for an xml transform for jvmti/trace file generation.
+# Setup make rules for an xml transform for jvmti file generation.
 #
 # Parameter 1 is the name of the rule. This name is used as variable prefix,
 # and the targets generated are listed in a variable by that name. This name is
@@ -126,48 +126,3 @@
 
   TARGETS += $(COPY_JVMTI_H)
 endif
-
-################################################################################
-# Create trace files in gensrc/tracefiles
-
-TRACE_OUTPUTDIR := $(JVM_VARIANT_OUTPUTDIR)/gensrc/tracefiles
-TRACE_SRCDIR := $(TOPDIR)/src/hotspot/share/trace
-
-# Append list of XSL files to search (might have been set by custom extensions)
-TRACE_XSL_FILES += $(wildcard $(TRACE_SRCDIR)/*.xsl)
-
-TRACE_XML ?= $(TRACE_SRCDIR)/trace.xml
-
-# Changing these will trigger a rebuild of generated trace files.
-TRACE_DEPS += \
-    $(TRACE_XML) \
-    $(TRACE_SRCDIR)/tracetypes.xml \
-    $(TRACE_SRCDIR)/tracerelationdecls.xml \
-    $(TRACE_SRCDIR)/traceevents.xml \
-    $(TRACE_SRCDIR)/trace.dtd \
-    $(TRACE_SRCDIR)/xinclude.mod \
-    #
-
-# Setup rule for generating a trace file
-#
-# $1 is generated source file name in $(TRACE_OUTPUTDIR)
-define SetupTraceGeneration
-  $$(eval $$(call SetupXslTransform, $1, \
-      XML_FILE := $$(TRACE_XML), \
-      XSL_FILE := $$(firstword $$(filter %/$$(basename $1).xsl, $$(TRACE_XSL_FILES))), \
-      OUTPUT_DIR := $$(TRACE_OUTPUTDIR), \
-      DEPS := $$(TRACE_DEPS), \
-  ))
-endef
-
-# Append files to generated (might have been set by custom extensions)
-TRACE_GENSRC_FILES += \
-    traceEventClasses.hpp \
-    traceEventIds.hpp \
-    traceTypes.hpp \
-    #
-
-# Call SetupTraceGeneration for all trace gensrc files
-$(foreach tracefile, $(TRACE_GENSRC_FILES), \
-  $(eval $(call SetupTraceGeneration, $(tracefile))) \
-)
--- a/make/hotspot/lib/JvmFeatures.gmk	Tue May 15 11:28:29 2018 -0700
+++ b/make/hotspot/lib/JvmFeatures.gmk	Tue May 15 20:24:34 2018 +0200
@@ -154,6 +154,12 @@
   # If serial is disabled, we cannot use serial as OldGC in parallel
   JVM_EXCLUDE_FILES += psMarkSweep.cpp psMarkSweepDecorator.cpp
 endif
+
+ifneq ($(call check-jvm-feature, jfr), true)
+  JVM_CFLAGS_FEATURES += -DINCLUDE_JFR=0
+  JVM_EXCLUDE_PATTERNS += jfr
+endif
+
 ################################################################################
 
 ifeq ($(call check-jvm-feature, link-time-opt), true)
--- a/make/hotspot/src/classes/build/tools/projectcreator/BuildConfig.java	Tue May 15 11:28:29 2018 -0700
+++ b/make/hotspot/src/classes/build/tools/projectcreator/BuildConfig.java	Tue May 15 20:24:34 2018 +0200
@@ -223,7 +223,7 @@
         sysDefines.add("_WINDOWS");
         sysDefines.add("HOTSPOT_BUILD_USER=\\\""+System.getProperty("user.name")+"\\\"");
         sysDefines.add("HOTSPOT_BUILD_TARGET=\\\""+get("Build")+"\\\"");
-        sysDefines.add("INCLUDE_TRACE=1");
+        sysDefines.add("INCLUDE_JFR=1");
         sysDefines.add("_JNI_IMPLEMENTATION_");
         if (vars.get("PlatformName").equals("Win32")) {
             sysDefines.add("HOTSPOT_LIB_ARCH=\\\"i386\\\"");
--- a/make/jprt.properties	Tue May 15 11:28:29 2018 -0700
+++ b/make/jprt.properties	Tue May 15 20:24:34 2018 +0200
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2006, 2017, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2006, 2018, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -273,6 +273,7 @@
     ${my.test.target.set:TESTNAME=jdk_instrument},			\
     ${my.test.target.set:TESTNAME=jdk_jmx},				\
     ${my.test.target.set:TESTNAME=jdk_jdi},				\
+    ${my.test.target.set:TESTNAME=jdk_jfr},                             \
     ${my.test.target.set:TESTNAME=svc_tools},                           \
     ${my.make.rule.test.targets.svc.extra}
 
--- a/make/nashorn/project.properties	Tue May 15 11:28:29 2018 -0700
+++ b/make/nashorn/project.properties	Tue May 15 20:24:34 2018 +0200
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2010, 2018, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -98,8 +98,8 @@
 dist.nashornapi.javadoc.dir=${dist.javadoc.dir}/nashornapi
 dist.dynalinkapi.javadoc.dir=${dist.javadoc.dir}/dynalinkapi
 
-# configuration for java flight recorder
-run.test.jvmargs.jfr=-XX:+UnlockCommercialFeatures -XX:+FlightRecorder -XX:FlightRecorderOptions=defaultrecording=true,disk=true,dumponexit=true,dumponexitpath=${build.dir},stackdepth=128
+# configuration for flight recorder
+run.test.jvmargs.jfr=XX:StartFlightRecording=disk=true,dumponexit=true,dumponexitpath=${build.dir},stackdepth=128
 
 # test library location
 test.lib=test/nashorn/lib
@@ -354,7 +354,7 @@
 # uncomment this jfr.args to enable light recordings. the stack needs to be cranked up to 1024 frames,
 # or everything will as of the now drown in lambda forms and be cut off.
 #
-#jfr.args=-XX:+UnlockCommercialFeatures -XX:+FlightRecorder -XX:FlightRecorderOptions=defaultrecording=true,disk=true,dumponexit=true,dumponexitpath="test_suite.jfr",stackdepth=1024 \
+#jfr.args=-XX:StartFlightRecording=disk=true,dumponexit=true,dumponexitpath="test_suite.jfr",stackdepth=1024
 
 jfr.args=
 
--- a/make/nb_native/nbproject/configurations.xml	Tue May 15 11:28:29 2018 -0700
+++ b/make/nb_native/nbproject/configurations.xml	Tue May 15 20:24:34 2018 +0200
@@ -2891,7 +2891,6 @@
               <in>stringUtils.hpp</in>
               <in>ticks.cpp</in>
               <in>ticks.hpp</in>
-              <in>ticks.inline.hpp</in>
               <in>utf8.cpp</in>
               <in>utf8.hpp</in>
               <in>vmError.cpp</in>
@@ -6887,7 +6886,7 @@
             <pElem>../../hotspot/src/share/vm/ci</pElem>
             <pElem>../../hotspot/src/share/vm/oops</pElem>
             <pElem>../../hotspot/src/share/vm/trace</pElem>
-            <pElem>../../build/macosx-x86_64-normal-server-release/hotspot/variant-server/gensrc/tracefiles</pElem>
+            <pElem>../../build/macosx-x86_64-normal-server-release/hotspot/variant-server/gensrc/jfrfiles</pElem>
             <pElem>../../hotspot/src/share/vm/gc/parallel</pElem>
             <pElem>../../hotspot/src/share/vm/gc/shared</pElem>
             <pElem>../../hotspot/src/share/vm/classfile</pElem>
@@ -15408,11 +15407,6 @@
             tool="3"
             flavor2="0">
       </item>
-      <item path="../../src/hotspot/share/utilities/ticks.inline.hpp"
-            ex="false"
-            tool="3"
-            flavor2="0">
-      </item>
       <item path="../../src/hotspot/share/utilities/utf8.cpp"
             ex="false"
             tool="1"
@@ -29190,11 +29184,6 @@
             tool="3"
             flavor2="0">
       </item>
-      <item path="../../src/hotspot/share/utilities/ticks.inline.hpp"
-            ex="false"
-            tool="3"
-            flavor2="0">
-      </item>
       <item path="../../src/hotspot/share/utilities/utf8.cpp"
             ex="false"
             tool="1"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/hotspot/cpu/aarch64/vm_version_ext_aarch64.cpp	Tue May 15 20:24:34 2018 +0200
@@ -0,0 +1,90 @@
+/*
+ * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+#include "memory/allocation.hpp"
+#include "memory/allocation.inline.hpp"
+#include "runtime/os.inline.hpp"
+#include "vm_version_ext_aarch64.hpp"
+
+// VM_Version_Ext statics
+int VM_Version_Ext::_no_of_threads = 0;
+int VM_Version_Ext::_no_of_cores = 0;
+int VM_Version_Ext::_no_of_sockets = 0;
+bool VM_Version_Ext::_initialized = false;
+char VM_Version_Ext::_cpu_name[CPU_TYPE_DESC_BUF_SIZE] = {0};
+char VM_Version_Ext::_cpu_desc[CPU_DETAILED_DESC_BUF_SIZE] = {0};
+
+void VM_Version_Ext::initialize_cpu_information(void) {
+  // do nothing if cpu info has been initialized
+  if (_initialized) {
+    return;
+  }
+
+  int core_id = -1;
+  int chip_id = -1;
+  int len = 0;
+  char* src_string = NULL;
+
+  _no_of_cores  = os::processor_count();
+  _no_of_threads = _no_of_cores;
+  _no_of_sockets = _no_of_cores;
+  snprintf(_cpu_name, CPU_TYPE_DESC_BUF_SIZE - 1, "AArch64");
+  snprintf(_cpu_desc, CPU_DETAILED_DESC_BUF_SIZE, "%s", _features_string);
+  _initialized = true;
+}
+
+int VM_Version_Ext::number_of_threads(void) {
+  initialize_cpu_information();
+  return _no_of_threads;
+}
+
+int VM_Version_Ext::number_of_cores(void) {
+  initialize_cpu_information();
+  return _no_of_cores;
+}
+
+int VM_Version_Ext::number_of_sockets(void) {
+  initialize_cpu_information();
+  return _no_of_sockets;
+}
+
+const char* VM_Version_Ext::cpu_name(void) {
+  initialize_cpu_information();
+  char* tmp = NEW_C_HEAP_ARRAY_RETURN_NULL(char, CPU_TYPE_DESC_BUF_SIZE, mtTracing);
+  if (NULL == tmp) {
+    return NULL;
+  }
+  strncpy(tmp, _cpu_name, CPU_TYPE_DESC_BUF_SIZE);
+  return tmp;
+}
+
+const char* VM_Version_Ext::cpu_description(void) {
+  initialize_cpu_information();
+  char* tmp = NEW_C_HEAP_ARRAY_RETURN_NULL(char, CPU_DETAILED_DESC_BUF_SIZE, mtTracing);
+  if (NULL == tmp) {
+    return NULL;
+  }
+  strncpy(tmp, _cpu_desc, CPU_DETAILED_DESC_BUF_SIZE);
+  return tmp;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/hotspot/cpu/aarch64/vm_version_ext_aarch64.hpp	Tue May 15 20:24:34 2018 +0200
@@ -0,0 +1,54 @@
+/*
+ * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+#ifndef CPU_AARCH64_VM_VM_VERSION_EXT_AARCH64_HPP
+#define CPU_AARCH64_VM_VM_VERSION_EXT_AARCH64_HPP
+
+#include "utilities/macros.hpp"
+#include "vm_version_aarch64.hpp"
+
+class VM_Version_Ext : public VM_Version {
+ private:
+  static const size_t      CPU_TYPE_DESC_BUF_SIZE = 256;
+  static const size_t      CPU_DETAILED_DESC_BUF_SIZE = 4096;
+
+  static int               _no_of_threads;
+  static int               _no_of_cores;
+  static int               _no_of_sockets;
+  static bool              _initialized;
+  static char              _cpu_name[CPU_TYPE_DESC_BUF_SIZE];
+  static char              _cpu_desc[CPU_DETAILED_DESC_BUF_SIZE];
+
+ public:
+  static int number_of_threads(void);
+  static int number_of_cores(void);
+  static int number_of_sockets(void);
+
+  static const char* cpu_name(void);
+  static const char* cpu_description(void);
+  static void initialize_cpu_information(void);
+
+};
+
+#endif // CPU_AARCH64_VM_VM_VERSION_EXT_AARCH64_HPP
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/hotspot/cpu/arm/vm_version_ext_arm.cpp	Tue May 15 20:24:34 2018 +0200
@@ -0,0 +1,94 @@
+/*
+ * Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+#include "memory/allocation.hpp"
+#include "memory/allocation.inline.hpp"
+#include "runtime/os.inline.hpp"
+#include "vm_version_ext_arm.hpp"
+
+// VM_Version_Ext statics
+int VM_Version_Ext::_no_of_threads = 0;
+int VM_Version_Ext::_no_of_cores = 0;
+int VM_Version_Ext::_no_of_sockets = 0;
+bool VM_Version_Ext::_initialized = false;
+char VM_Version_Ext::_cpu_name[CPU_TYPE_DESC_BUF_SIZE] = {0};
+char VM_Version_Ext::_cpu_desc[CPU_DETAILED_DESC_BUF_SIZE] = {0};
+
+void VM_Version_Ext::initialize_cpu_information(void) {
+  // do nothing if cpu info has been initialized
+  if (_initialized) {
+    return;
+  }
+
+  int core_id = -1;
+  int chip_id = -1;
+  int len = 0;
+  char* src_string = NULL;
+
+  _no_of_cores  = os::processor_count();
+  _no_of_threads = _no_of_cores;
+  _no_of_sockets = _no_of_cores;
+#ifdef AARCH64
+  snprintf(_cpu_name, CPU_TYPE_DESC_BUF_SIZE - 1, "AArch64");
+#else
+  snprintf(_cpu_name, CPU_TYPE_DESC_BUF_SIZE - 1, "ARM%d", _arm_arch);
+#endif
+  snprintf(_cpu_desc, CPU_DETAILED_DESC_BUF_SIZE, "%s", _features_string);
+  _initialized = true;
+}
+
+int VM_Version_Ext::number_of_threads(void) {
+  initialize_cpu_information();
+  return _no_of_threads;
+}
+
+int VM_Version_Ext::number_of_cores(void) {
+  initialize_cpu_information();
+  return _no_of_cores;
+}
+
+int VM_Version_Ext::number_of_sockets(void) {
+  initialize_cpu_information();
+  return _no_of_sockets;
+}
+
+const char* VM_Version_Ext::cpu_name(void) {
+  initialize_cpu_information();
+  char* tmp = NEW_C_HEAP_ARRAY_RETURN_NULL(char, CPU_TYPE_DESC_BUF_SIZE, mtTracing);
+  if (NULL == tmp) {
+    return NULL;
+  }
+  strncpy(tmp, _cpu_name, CPU_TYPE_DESC_BUF_SIZE);
+  return tmp;
+}
+
+const char* VM_Version_Ext::cpu_description(void) {
+  initialize_cpu_information();
+  char* tmp = NEW_C_HEAP_ARRAY_RETURN_NULL(char, CPU_DETAILED_DESC_BUF_SIZE, mtTracing);
+  if (NULL == tmp) {
+    return NULL;
+  }
+  strncpy(tmp, _cpu_desc, CPU_DETAILED_DESC_BUF_SIZE);
+  return tmp;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/hotspot/cpu/arm/vm_version_ext_arm.hpp	Tue May 15 20:24:34 2018 +0200
@@ -0,0 +1,54 @@
+/*
+ * Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+#ifndef CPU_ARM_VM_VM_VERSION_EXT_ARM_HPP
+#define CPU_ARM_VM_VM_VERSION_EXT_ARM_HPP
+
+#include "utilities/macros.hpp"
+#include "vm_version_arm.hpp"
+
+class VM_Version_Ext : public VM_Version {
+ private:
+  static const size_t      CPU_TYPE_DESC_BUF_SIZE = 256;
+  static const size_t      CPU_DETAILED_DESC_BUF_SIZE = 4096;
+
+  static int               _no_of_threads;
+  static int               _no_of_cores;
+  static int               _no_of_sockets;
+  static bool              _initialized;
+  static char              _cpu_name[CPU_TYPE_DESC_BUF_SIZE];
+  static char              _cpu_desc[CPU_DETAILED_DESC_BUF_SIZE];
+
+ public:
+  static int number_of_threads(void);
+  static int number_of_cores(void);
+  static int number_of_sockets(void);
+
+  static const char* cpu_name(void);
+  static const char* cpu_description(void);
+  static void initialize_cpu_information(void);
+
+};
+
+#endif // CPU_ARM_VM_VM_VERSION_EXT_ARM_HPP
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/hotspot/cpu/sparc/vm_version_ext_sparc.cpp	Tue May 15 20:24:34 2018 +0200
@@ -0,0 +1,185 @@
+/*
+ * Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+#include "jvm.h"
+#include "memory/allocation.hpp"
+#include "memory/allocation.inline.hpp"
+#include "vm_version_ext_sparc.hpp"
+
+// VM_Version_Ext statics
+int   VM_Version_Ext::_no_of_threads = 0;
+int   VM_Version_Ext::_no_of_cores = 0;
+int   VM_Version_Ext::_no_of_sockets = 0;
+kid_t VM_Version_Ext::_kcid = -1;
+char  VM_Version_Ext::_cpu_name[CPU_TYPE_DESC_BUF_SIZE] = {0};
+char  VM_Version_Ext::_cpu_desc[CPU_DETAILED_DESC_BUF_SIZE] = {0};
+
+// get cpu information. It takes into account if the kstat chain id
+// has been changed and update the info if necessary.
+bool VM_Version_Ext::initialize_cpu_information(void) {
+
+  int core_id = -1;
+  int chip_id = -1;
+  int len = 0;
+  char* src_string = NULL;
+  kstat_ctl_t* kc = kstat_open();
+  if (!kc) {
+    return false;
+  }
+
+  // check if kstat chain has been updated
+  kid_t kcid = kstat_chain_update(kc);
+  if (kcid == -1) {
+    kstat_close(kc);
+    return false;
+  }
+
+  bool updated = ((kcid > 0) && (kcid != _kcid)) ||
+                 ((kcid == 0) && (_kcid == -1));
+  if (!updated) {
+    kstat_close(kc);
+    return true;
+  }
+
+  // update the cached _kcid
+  _kcid = kcid;
+
+  // find the number of online processors
+  // for modern processsors, it is also known as the
+  // hardware threads.
+  _no_of_threads  = sysconf(_SC_NPROCESSORS_ONLN);
+
+  if (_no_of_threads <= 0 ) {
+    kstat_close(kc);
+    return false;
+  }
+
+  _no_of_cores = 0;
+  _no_of_sockets = 0;
+
+  // loop through the kstat chain
+  kstat_t* ksp = NULL;
+  for (ksp = kc->kc_chain; ksp != NULL; ksp = ksp->ks_next) {
+    // only interested in "cpu_info"
+    if (strcmp(ksp->ks_module, (char*)CPU_INFO) == 0) {
+      if (kstat_read(kc, ksp, NULL) == -1) {
+        kstat_close(kc);
+        return false;
+      }
+      if (ksp->ks_data != NULL) {
+        kstat_named_t* knm = (kstat_named_t *)ksp->ks_data;
+        // loop through the number of fields in each record
+        for (int i = 0; i < ksp->ks_ndata; i++) {
+          // set cpu type if it hasn't been already set
+          if ((strcmp((const char*)&(knm[i].name), CPU_TYPE) == 0) &&
+                     (_cpu_name[0] == '\0')) {
+            if (knm[i].data_type == KSTAT_DATA_STRING) {
+              src_string = (char*)KSTAT_NAMED_STR_PTR(&knm[i]);
+            } else {
+              src_string = (char*)&(knm[i].value.c[0]);
+            }
+            len = strlen(src_string);
+            if (len < CPU_TYPE_DESC_BUF_SIZE) {
+              jio_snprintf(_cpu_name, CPU_TYPE_DESC_BUF_SIZE,
+                                         "%s", src_string);
+            }
+          }
+
+          // set cpu description if it hasn't been already set
+          if ((strcmp((const char*)&(knm[i].name), CPU_DESCRIPTION) == 0) &&
+                      (_cpu_desc[0] == '\0')) {
+            if (knm[i].data_type == KSTAT_DATA_STRING) {
+              src_string = (char*)KSTAT_NAMED_STR_PTR(&knm[i]);
+            } else {
+              src_string = (char*)&(knm[i].value.c[0]);
+            }
+            len = strlen(src_string);
+            if (len < CPU_DETAILED_DESC_BUF_SIZE) {
+              jio_snprintf(_cpu_desc, CPU_DETAILED_DESC_BUF_SIZE,
+                                         "%s", src_string);
+            }
+          }
+
+          // count the number of sockets based on the chip id
+          if (strcmp((const char*)&(knm[i].name), CHIP_ID) == 0) {
+            if (chip_id != knm[i].value.l) {
+              chip_id = knm[i].value.l;
+              _no_of_sockets++;
+            }
+          }
+
+          // count the number of cores based on the core id
+          if (strcmp((const char*)&(knm[i].name), CORE_ID) == 0) {
+            if (core_id != knm[i].value.l) {
+              core_id = knm[i].value.l;
+              _no_of_cores++;
+            }
+          }
+        }
+      }
+    }
+  }
+
+  kstat_close(kc);
+  return true;
+}
+
+int VM_Version_Ext::number_of_threads(void) {
+  initialize_cpu_information();
+  return _no_of_threads;
+}
+
+int VM_Version_Ext::number_of_cores(void) {
+  initialize_cpu_information();
+  return _no_of_cores;
+}
+
+int VM_Version_Ext::number_of_sockets(void) {
+  initialize_cpu_information();
+  return _no_of_sockets;
+}
+
+const char* VM_Version_Ext::cpu_name(void) {
+  if (!initialize_cpu_information()) {
+    return NULL;
+  }
+  char* tmp = NEW_C_HEAP_ARRAY_RETURN_NULL(char, CPU_TYPE_DESC_BUF_SIZE, mtTracing);
+  if (NULL == tmp) {
+    return NULL;
+  }
+  strncpy(tmp, _cpu_name, CPU_TYPE_DESC_BUF_SIZE);
+  return tmp;
+}
+
+const char* VM_Version_Ext::cpu_description(void) {
+  if (!initialize_cpu_information()) {
+    return NULL;
+  }
+  char* tmp = NEW_C_HEAP_ARRAY_RETURN_NULL(char, CPU_DETAILED_DESC_BUF_SIZE, mtTracing);
+  if (NULL == tmp) {
+    return NULL;
+  }
+  strncpy(tmp, _cpu_desc, CPU_DETAILED_DESC_BUF_SIZE);
+  return tmp;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/hotspot/cpu/sparc/vm_version_ext_sparc.hpp	Tue May 15 20:24:34 2018 +0200
@@ -0,0 +1,64 @@
+/*
+ * Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+#ifndef CPU_SPARC_VM_VM_VERSION_EXT_SPARC_HPP
+#define CPU_SPARC_VM_VM_VERSION_EXT_SPARC_HPP
+
+#include "utilities/macros.hpp"
+#include "vm_version_sparc.hpp"
+#include <kstat.h>
+#include <sys/processor.h>
+
+#define CPU_INFO        "cpu_info"
+#define CPU_TYPE        "fpu_type"
+#define CPU_DESCRIPTION "implementation"
+#define CHIP_ID         "chip_id"
+#define CORE_ID         "core_id"
+
+class VM_Version_Ext : public VM_Version {
+ private:
+
+  static const size_t      CPU_TYPE_DESC_BUF_SIZE = 256;
+  static const size_t      CPU_DETAILED_DESC_BUF_SIZE = 4096;
+
+  static int               _no_of_threads;
+  static int               _no_of_cores;
+  static int               _no_of_sockets;
+  static kid_t             _kcid;
+  static char              _cpu_name[CPU_TYPE_DESC_BUF_SIZE];
+  static char              _cpu_desc[CPU_DETAILED_DESC_BUF_SIZE];
+
+  static bool initialize_cpu_information(void);
+
+ public:
+
+  static int number_of_threads(void);
+  static int number_of_cores(void);
+  static int number_of_sockets(void);
+
+  static const char* cpu_name(void);
+  static const char* cpu_description(void);
+};
+
+#endif // CPU_SPARC_VM_VM_VERSION_EXT_SPARC_HPP
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/hotspot/cpu/x86/rdtsc_x86.cpp	Tue May 15 20:24:34 2018 +0200
@@ -0,0 +1,210 @@
+/*
+ * Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+#include "precompiled.hpp"
+#include "rdtsc_x86.hpp"
+#include "runtime/thread.inline.hpp"
+#include "vm_version_ext_x86.hpp"
+
+// The following header contains the implementations of rdtsc()
+#include OS_CPU_HEADER_INLINE(os)
+
+static jlong _epoch = 0;
+static bool rdtsc_elapsed_counter_enabled = false;
+static jlong tsc_frequency = 0;
+
+static jlong set_epoch() {
+  assert(0 == _epoch, "invariant");
+  _epoch = os::rdtsc();
+  return _epoch;
+}
+
+// Base loop to estimate ticks frequency for tsc counter from user mode.
+// Volatiles and sleep() are used to prevent compiler from applying optimizations.
+static void do_time_measurements(volatile jlong& time_base,
+                                 volatile jlong& time_fast,
+                                 volatile jlong& time_base_elapsed,
+                                 volatile jlong& time_fast_elapsed) {
+  static const unsigned int FT_SLEEP_MILLISECS = 1;
+  const unsigned int loopcount = 3;
+
+  volatile jlong start = 0;
+  volatile jlong fstart = 0;
+  volatile jlong end = 0;
+  volatile jlong fend = 0;
+
+  // Figure out the difference between rdtsc and os provided timer.
+  // base algorithm adopted from JRockit.
+  for (unsigned int times = 0; times < loopcount; times++) {
+    start = os::elapsed_counter();
+    OrderAccess::fence();
+    fstart = os::rdtsc();
+
+    // use sleep to prevent compiler from optimizing
+    os::sleep(Thread::current(), FT_SLEEP_MILLISECS, true);
+
+    end = os::elapsed_counter();
+    OrderAccess::fence();
+    fend = os::rdtsc();
+
+    time_base += end - start;
+    time_fast += fend - fstart;
+
+    // basis for calculating the os tick start
+    // to fast time tick start offset
+    time_base_elapsed += end;
+    time_fast_elapsed += (fend - _epoch);
+  }
+
+  time_base /= loopcount;
+  time_fast /= loopcount;
+  time_base_elapsed /= loopcount;
+  time_fast_elapsed /= loopcount;
+}
+
+static jlong initialize_frequency() {
+  assert(0 == tsc_frequency, "invariant");
+  assert(0 == _epoch, "invariant");
+  const jlong initial_counter = set_epoch();
+  if (initial_counter == 0) {
+    return 0;
+  }
+  // os time frequency
+  static double os_freq = (double)os::elapsed_frequency();
+  assert(os_freq > 0, "os_elapsed frequency corruption!");
+
+  double tsc_freq = .0;
+  double os_to_tsc_conv_factor = 1.0;
+
+  // if platform supports invariant tsc,
+  // apply higher resolution and granularity for conversion calculations
+  if (VM_Version_Ext::supports_tscinv_ext()) {
+    // for invariant tsc platforms, take the maximum qualified cpu frequency
+    tsc_freq = (double)VM_Version_Ext::maximum_qualified_cpu_frequency();
+    os_to_tsc_conv_factor = tsc_freq / os_freq;
+  } else {
+    // use measurements to estimate
+    // a conversion factor and the tsc frequency
+
+    volatile jlong time_base = 0;
+    volatile jlong time_fast = 0;
+    volatile jlong time_base_elapsed = 0;
+    volatile jlong time_fast_elapsed = 0;
+
+    // do measurements to get base data
+    // on os timer and fast ticks tsc time relation.
+    do_time_measurements(time_base, time_fast, time_base_elapsed, time_fast_elapsed);
+
+    // if invalid measurements, cannot proceed
+    if (time_fast == 0 || time_base == 0) {
+      return 0;
+    }
+
+    os_to_tsc_conv_factor = (double)time_fast / (double)time_base;
+    if (os_to_tsc_conv_factor > 1) {
+      // estimate on tsc counter frequency
+      tsc_freq = os_to_tsc_conv_factor * os_freq;
+    }
+  }
+
+  if ((tsc_freq < 0) || (tsc_freq > 0 && tsc_freq <= os_freq) || (os_to_tsc_conv_factor <= 1)) {
+    // safer to run with normal os time
+    tsc_freq = .0;
+  }
+
+  // frequency of the tsc_counter
+  return (jlong)tsc_freq;
+}
+
+static bool initialize_elapsed_counter() {
+  tsc_frequency = initialize_frequency();
+  return tsc_frequency != 0 && _epoch != 0;
+}
+
+static bool ergonomics() {
+  const bool invtsc_support = Rdtsc::is_supported();
+  if (FLAG_IS_DEFAULT(UseFastUnorderedTimeStamps) && invtsc_support) {
+    FLAG_SET_ERGO(bool, UseFastUnorderedTimeStamps, true);
+  }
+
+  bool ft_enabled = UseFastUnorderedTimeStamps && invtsc_support;
+
+  if (!ft_enabled) {
+    if (UseFastUnorderedTimeStamps && VM_Version::supports_tsc()) {
+      warning("\nThe hardware does not support invariant tsc (INVTSC) register and/or cannot guarantee tsc synchronization between sockets at startup.\n"\
+        "Values returned via rdtsc() are not guaranteed to be accurate, esp. when comparing values from cross sockets reads. Enabling UseFastUnorderedTimeStamps on non-invariant tsc hardware should be considered experimental.\n");
+      ft_enabled = true;
+    }
+  }
+
+  if (!ft_enabled) {
+    // Warn if unable to support command-line flag
+    if (UseFastUnorderedTimeStamps && !VM_Version::supports_tsc()) {
+      warning("Ignoring UseFastUnorderedTimeStamps, hardware does not support normal tsc");
+    }
+  }
+
+  return ft_enabled;
+}
+
+bool Rdtsc::is_supported() {
+  return VM_Version_Ext::supports_tscinv_ext();
+}
+
+bool Rdtsc::is_elapsed_counter_enabled() {
+  return rdtsc_elapsed_counter_enabled;
+}
+
+jlong Rdtsc::frequency() {
+  return tsc_frequency;
+}
+
+jlong Rdtsc::elapsed_counter() {
+  return os::rdtsc() - _epoch;
+}
+
+jlong Rdtsc::epoch() {
+  return _epoch;
+}
+
+jlong Rdtsc::raw() {
+  return os::rdtsc();
+}
+
+bool Rdtsc::initialize() {
+  static bool initialized = false;
+  if (!initialized) {
+    assert(!rdtsc_elapsed_counter_enabled, "invariant");
+    VM_Version_Ext::initialize();
+    assert(0 == tsc_frequency, "invariant");
+    assert(0 == _epoch, "invariant");
+    bool result = initialize_elapsed_counter(); // init hw
+    if (result) {
+      result = ergonomics(); // check logical state
+    }
+    rdtsc_elapsed_counter_enabled = result;
+    initialized = true;
+  }
+  return rdtsc_elapsed_counter_enabled;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/hotspot/cpu/x86/rdtsc_x86.hpp	Tue May 15 20:24:34 2018 +0200
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+#ifndef CPU_X86_VM_RDTSC_X86_HPP
+#define CPU_X86_VM_RDTSC_X86_HPP
+
+#include "memory/allocation.hpp"
+#include "utilities/macros.hpp"
+
+// Interface to the x86 rdtsc() time counter, if available.
+// Not guaranteed to be synchronized across hardware threads and
+// therefore software threads, and can be updated asynchronously
+// by software. elapsed_counter() can jump backwards
+// as well as jump forward when threads query different cores/sockets.
+// Very much not recommended for general use.
+// INVTSC is a minimal requirement for auto-enablement.
+
+class Rdtsc : AllStatic {
+ public:
+  static jlong elapsed_counter(); // provides quick time stamps
+  static jlong frequency();       // tsc register
+  static bool  is_supported();    // InvariantTSC
+  static jlong raw();             // direct rdtsc() access
+  static bool  is_elapsed_counter_enabled(); // turn off with -XX:-UseFastUnorderedTimeStamps
+  static jlong epoch();
+  static bool  initialize();
+};
+
+#endif // CPU_X86_VM_RDTSC_X86_HPP
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/hotspot/cpu/x86/vm_version_ext_x86.cpp	Tue May 15 20:24:34 2018 +0200
@@ -0,0 +1,967 @@
+/*
+ * Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+#include "precompiled.hpp"
+#include "jvm.h"
+#include "utilities/macros.hpp"
+#include "asm/macroAssembler.hpp"
+#include "asm/macroAssembler.inline.hpp"
+#include "memory/allocation.inline.hpp"
+#include "memory/resourceArea.hpp"
+#include "runtime/java.hpp"
+#include "runtime/stubCodeGenerator.hpp"
+#include "vm_version_ext_x86.hpp"
+
+typedef enum {
+   CPU_FAMILY_8086_8088  = 0,
+   CPU_FAMILY_INTEL_286  = 2,
+   CPU_FAMILY_INTEL_386  = 3,
+   CPU_FAMILY_INTEL_486  = 4,
+   CPU_FAMILY_PENTIUM    = 5,
+   CPU_FAMILY_PENTIUMPRO = 6,    // Same family several models
+   CPU_FAMILY_PENTIUM_4  = 0xF
+} FamilyFlag;
+
+ typedef enum {
+    RDTSCP_FLAG  = 0x08000000, // bit 27
+    INTEL64_FLAG = 0x20000000  // bit 29
+  } _featureExtendedEdxFlag;
+
+#define CPUID_STANDARD_FN   0x0
+#define CPUID_STANDARD_FN_1 0x1
+#define CPUID_STANDARD_FN_4 0x4
+#define CPUID_STANDARD_FN_B 0xb
+
+#define CPUID_EXTENDED_FN   0x80000000
+#define CPUID_EXTENDED_FN_1 0x80000001
+#define CPUID_EXTENDED_FN_2 0x80000002
+#define CPUID_EXTENDED_FN_3 0x80000003
+#define CPUID_EXTENDED_FN_4 0x80000004
+#define CPUID_EXTENDED_FN_7 0x80000007
+#define CPUID_EXTENDED_FN_8 0x80000008
+
+typedef enum {
+   FPU_FLAG     = 0x00000001,
+   VME_FLAG     = 0x00000002,
+   DE_FLAG      = 0x00000004,
+   PSE_FLAG     = 0x00000008,
+   TSC_FLAG     = 0x00000010,
+   MSR_FLAG     = 0x00000020,
+   PAE_FLAG     = 0x00000040,
+   MCE_FLAG     = 0x00000080,
+   CX8_FLAG     = 0x00000100,
+   APIC_FLAG    = 0x00000200,
+   SEP_FLAG     = 0x00000800,
+   MTRR_FLAG    = 0x00001000,
+   PGE_FLAG     = 0x00002000,
+   MCA_FLAG     = 0x00004000,
+   CMOV_FLAG    = 0x00008000,
+   PAT_FLAG     = 0x00010000,
+   PSE36_FLAG   = 0x00020000,
+   PSNUM_FLAG   = 0x00040000,
+   CLFLUSH_FLAG = 0x00080000,
+   DTS_FLAG     = 0x00200000,
+   ACPI_FLAG    = 0x00400000,
+   MMX_FLAG     = 0x00800000,
+   FXSR_FLAG    = 0x01000000,
+   SSE_FLAG     = 0x02000000,
+   SSE2_FLAG    = 0x04000000,
+   SS_FLAG      = 0x08000000,
+   HTT_FLAG     = 0x10000000,
+   TM_FLAG      = 0x20000000
+} FeatureEdxFlag;
+
+static BufferBlob* cpuid_brand_string_stub_blob;
+static const int   cpuid_brand_string_stub_size = 550;
+
+extern "C" {
+  typedef void (*getCPUIDBrandString_stub_t)(void*);
+}
+
+static getCPUIDBrandString_stub_t getCPUIDBrandString_stub = NULL;
+
+class VM_Version_Ext_StubGenerator: public StubCodeGenerator {
+ public:
+
+  VM_Version_Ext_StubGenerator(CodeBuffer *c) : StubCodeGenerator(c) {}
+
+  address generate_getCPUIDBrandString(void) {
+    // Flags to test CPU type.
+    const uint32_t HS_EFL_AC           = 0x40000;
+    const uint32_t HS_EFL_ID           = 0x200000;
+    // Values for when we don't have a CPUID instruction.
+    const int      CPU_FAMILY_SHIFT = 8;
+    const uint32_t CPU_FAMILY_386   = (3 << CPU_FAMILY_SHIFT);
+    const uint32_t CPU_FAMILY_486   = (4 << CPU_FAMILY_SHIFT);
+
+    Label detect_486, cpu486, detect_586, done, ext_cpuid;
+
+    StubCodeMark mark(this, "VM_Version_Ext", "getCPUIDNameInfo_stub");
+#   define __ _masm->
+
+    address start = __ pc();
+
+    //
+    // void getCPUIDBrandString(VM_Version::CpuidInfo* cpuid_info);
+    //
+    // LP64: rcx and rdx are first and second argument registers on windows
+
+    __ push(rbp);
+#ifdef _LP64
+    __ mov(rbp, c_rarg0); // cpuid_info address
+#else
+    __ movptr(rbp, Address(rsp, 8)); // cpuid_info address
+#endif
+    __ push(rbx);
+    __ push(rsi);
+    __ pushf();          // preserve rbx, and flags
+    __ pop(rax);
+    __ push(rax);
+    __ mov(rcx, rax);
+    //
+    // if we are unable to change the AC flag, we have a 386
+    //
+    __ xorl(rax, HS_EFL_AC);
+    __ push(rax);
+    __ popf();
+    __ pushf();
+    __ pop(rax);
+    __ cmpptr(rax, rcx);
+    __ jccb(Assembler::notEqual, detect_486);
+
+    __ movl(rax, CPU_FAMILY_386);
+    __ jmp(done);
+
+    //
+    // If we are unable to change the ID flag, we have a 486 which does
+    // not support the "cpuid" instruction.
+    //
+    __ bind(detect_486);
+    __ mov(rax, rcx);
+    __ xorl(rax, HS_EFL_ID);
+    __ push(rax);
+    __ popf();
+    __ pushf();
+    __ pop(rax);
+    __ cmpptr(rcx, rax);
+    __ jccb(Assembler::notEqual, detect_586);
+
+    __ bind(cpu486);
+    __ movl(rax, CPU_FAMILY_486);
+    __ jmp(done);
+
+    //
+    // At this point, we have a chip which supports the "cpuid" instruction
+    //
+    __ bind(detect_586);
+    __ xorl(rax, rax);
+    __ cpuid();
+    __ orl(rax, rax);
+    __ jcc(Assembler::equal, cpu486);   // if cpuid doesn't support an input
+                                        // value of at least 1, we give up and
+                                        // assume a 486
+
+    //
+    // Extended cpuid(0x80000000) for processor brand string detection
+    //
+    __ bind(ext_cpuid);
+    __ movl(rax, CPUID_EXTENDED_FN);
+    __ cpuid();
+    __ cmpl(rax, CPUID_EXTENDED_FN_4);
+    __ jcc(Assembler::below, done);
+
+    //
+    // Extended cpuid(0x80000002)  // first 16 bytes in brand string
+    //
+    __ movl(rax, CPUID_EXTENDED_FN_2);
+    __ cpuid();
+    __ lea(rsi, Address(rbp, in_bytes(VM_Version_Ext::proc_name_0_offset())));
+    __ movl(Address(rsi, 0), rax);
+    __ lea(rsi, Address(rbp, in_bytes(VM_Version_Ext::proc_name_1_offset())));
+    __ movl(Address(rsi, 0), rbx);
+    __ lea(rsi, Address(rbp, in_bytes(VM_Version_Ext::proc_name_2_offset())));
+    __ movl(Address(rsi, 0), rcx);
+    __ lea(rsi, Address(rbp, in_bytes(VM_Version_Ext::proc_name_3_offset())));
+    __ movl(Address(rsi,0), rdx);
+
+    //
+    // Extended cpuid(0x80000003) // next 16 bytes in brand string
+    //
+    __ movl(rax, CPUID_EXTENDED_FN_3);
+    __ cpuid();
+    __ lea(rsi, Address(rbp, in_bytes(VM_Version_Ext::proc_name_4_offset())));
+    __ movl(Address(rsi, 0), rax);
+    __ lea(rsi, Address(rbp, in_bytes(VM_Version_Ext::proc_name_5_offset())));
+    __ movl(Address(rsi, 0), rbx);
+    __ lea(rsi, Address(rbp, in_bytes(VM_Version_Ext::proc_name_6_offset())));
+    __ movl(Address(rsi, 0), rcx);
+    __ lea(rsi, Address(rbp, in_bytes(VM_Version_Ext::proc_name_7_offset())));
+    __ movl(Address(rsi,0), rdx);
+
+    //
+    // Extended cpuid(0x80000004) // last 16 bytes in brand string
+    //
+    __ movl(rax, CPUID_EXTENDED_FN_4);
+    __ cpuid();
+    __ lea(rsi, Address(rbp, in_bytes(VM_Version_Ext::proc_name_8_offset())));
+    __ movl(Address(rsi, 0), rax);
+    __ lea(rsi, Address(rbp, in_bytes(VM_Version_Ext::proc_name_9_offset())));
+    __ movl(Address(rsi, 0), rbx);
+    __ lea(rsi, Address(rbp, in_bytes(VM_Version_Ext::proc_name_10_offset())));
+    __ movl(Address(rsi, 0), rcx);
+    __ lea(rsi, Address(rbp, in_bytes(VM_Version_Ext::proc_name_11_offset())));
+    __ movl(Address(rsi,0), rdx);
+
+    //
+    // return
+    //
+    __ bind(done);
+    __ popf();
+    __ pop(rsi);
+    __ pop(rbx);
+    __ pop(rbp);
+    __ ret(0);
+
+#   undef __
+
+    return start;
+  };
+};
+
+
+// VM_Version_Ext statics
+const size_t VM_Version_Ext::VENDOR_LENGTH = 13;
+const size_t VM_Version_Ext::CPU_EBS_MAX_LENGTH = (3 * 4 * 4 + 1);
+const size_t VM_Version_Ext::CPU_TYPE_DESC_BUF_SIZE = 256;
+const size_t VM_Version_Ext::CPU_DETAILED_DESC_BUF_SIZE = 4096;
+char* VM_Version_Ext::_cpu_brand_string = NULL;
+jlong VM_Version_Ext::_max_qualified_cpu_frequency = 0;
+
+int VM_Version_Ext::_no_of_threads = 0;
+int VM_Version_Ext::_no_of_cores = 0;
+int VM_Version_Ext::_no_of_packages = 0;
+
+void VM_Version_Ext::initialize(void) {
+  ResourceMark rm;
+
+  cpuid_brand_string_stub_blob = BufferBlob::create("getCPUIDBrandString_stub", cpuid_brand_string_stub_size);
+  if (cpuid_brand_string_stub_blob == NULL) {
+    vm_exit_during_initialization("Unable to allocate getCPUIDBrandString_stub");
+  }
+  CodeBuffer c(cpuid_brand_string_stub_blob);
+  VM_Version_Ext_StubGenerator g(&c);
+  getCPUIDBrandString_stub = CAST_TO_FN_PTR(getCPUIDBrandString_stub_t,
+                                   g.generate_getCPUIDBrandString());
+}
+
+const char* VM_Version_Ext::cpu_model_description(void) {
+  uint32_t cpu_family = extended_cpu_family();
+  uint32_t cpu_model = extended_cpu_model();
+  const char* model = NULL;
+
+  if (cpu_family == CPU_FAMILY_PENTIUMPRO) {
+    for (uint32_t i = 0; i <= cpu_model; i++) {
+      model = _model_id_pentium_pro[i];
+      if (model == NULL) {
+        break;
+      }
+    }
+  }
+  return model;
+}
+
+const char* VM_Version_Ext::cpu_brand_string(void) {
+  if (_cpu_brand_string == NULL) {
+    _cpu_brand_string = NEW_C_HEAP_ARRAY_RETURN_NULL(char, CPU_EBS_MAX_LENGTH, mtInternal);
+    if (NULL == _cpu_brand_string) {
+      return NULL;
+    }
+    int ret_val = cpu_extended_brand_string(_cpu_brand_string, CPU_EBS_MAX_LENGTH);
+    if (ret_val != OS_OK) {
+      FREE_C_HEAP_ARRAY(char, _cpu_brand_string);
+      _cpu_brand_string = NULL;
+    }
+  }
+  return _cpu_brand_string;
+}
+
+const char* VM_Version_Ext::cpu_brand(void) {
+  const char*  brand  = NULL;
+
+  if ((_cpuid_info.std_cpuid1_ebx.value & 0xFF) > 0) {
+    int brand_num = _cpuid_info.std_cpuid1_ebx.value & 0xFF;
+    brand = _brand_id[0];
+    for (int i = 0; brand != NULL && i <= brand_num; i += 1) {
+      brand = _brand_id[i];
+    }
+  }
+  return brand;
+}
+
+bool VM_Version_Ext::cpu_is_em64t(void) {
+  return ((_cpuid_info.ext_cpuid1_edx.value & INTEL64_FLAG) == INTEL64_FLAG);
+}
+
+bool VM_Version_Ext::is_netburst(void) {
+  return (is_intel() && (extended_cpu_family() == CPU_FAMILY_PENTIUM_4));
+}
+
+bool VM_Version_Ext::supports_tscinv_ext(void) {
+  if (!supports_tscinv_bit()) {
+    return false;
+  }
+
+  if (is_intel()) {
+    return true;
+  }
+
+  if (is_amd()) {
+    return !is_amd_Barcelona();
+  }
+
+  return false;
+}
+
+void VM_Version_Ext::resolve_cpu_information_details(void) {
+
+  // in future we want to base this information on proper cpu
+  // and cache topology enumeration such as:
+  // Intel 64 Architecture Processor Topology Enumeration
+  // which supports system cpu and cache topology enumeration
+  // either using 2xAPICIDs or initial APICIDs
+
+  // currently only rough cpu information estimates
+  // which will not necessarily reflect the exact configuration of the system
+
+  // this is the number of logical hardware threads
+  // visible to the operating system
+  _no_of_threads = os::processor_count();
+
+  // find out number of threads per cpu package
+  int threads_per_package = threads_per_core() * cores_per_cpu();
+
+  // use amount of threads visible to the process in order to guess number of sockets
+  _no_of_packages = _no_of_threads / threads_per_package;
+
+  // process might only see a subset of the total number of threads
+  // from a single processor package. Virtualization/resource management for example.
+  // If so then just write a hard 1 as num of pkgs.
+  if (0 == _no_of_packages) {
+    _no_of_packages = 1;
+  }
+
+  // estimate the number of cores
+  _no_of_cores = cores_per_cpu() * _no_of_packages;
+}
+
+int VM_Version_Ext::number_of_threads(void) {
+  if (_no_of_threads == 0) {
+   resolve_cpu_information_details();
+  }
+  return _no_of_threads;
+}
+
+int VM_Version_Ext::number_of_cores(void) {
+  if (_no_of_cores == 0) {
+    resolve_cpu_information_details();
+  }
+  return _no_of_cores;
+}
+
+int VM_Version_Ext::number_of_sockets(void) {
+  if (_no_of_packages == 0) {
+    resolve_cpu_information_details();
+  }
+  return _no_of_packages;
+}
+
+const char* VM_Version_Ext::cpu_family_description(void) {
+  int cpu_family_id = extended_cpu_family();
+  if (is_amd()) {
+    return _family_id_amd[cpu_family_id];
+  }
+  if (is_intel()) {
+    if (cpu_family_id == CPU_FAMILY_PENTIUMPRO) {
+      return cpu_model_description();
+    }
+    return _family_id_intel[cpu_family_id];
+  }
+  return "Unknown x86";
+}
+
+int VM_Version_Ext::cpu_type_description(char* const buf, size_t buf_len) {
+  assert(buf != NULL, "buffer is NULL!");
+  assert(buf_len >= CPU_TYPE_DESC_BUF_SIZE, "buffer len should at least be == CPU_TYPE_DESC_BUF_SIZE!");
+
+  const char* cpu_type = NULL;
+  const char* x64 = NULL;
+
+  if (is_intel()) {
+    cpu_type = "Intel";
+    x64 = cpu_is_em64t() ? " Intel64" : "";
+  } else if (is_amd()) {
+    cpu_type = "AMD";
+    x64 = cpu_is_em64t() ? " AMD64" : "";
+  } else {
+    cpu_type = "Unknown x86";
+    x64 = cpu_is_em64t() ? " x86_64" : "";
+  }
+
+  jio_snprintf(buf, buf_len, "%s %s%s SSE SSE2%s%s%s%s%s%s%s%s",
+    cpu_type,
+    cpu_family_description(),
+    supports_ht() ? " (HT)" : "",
+    supports_sse3() ? " SSE3" : "",
+    supports_ssse3() ? " SSSE3" : "",
+    supports_sse4_1() ? " SSE4.1" : "",
+    supports_sse4_2() ? " SSE4.2" : "",
+    supports_sse4a() ? " SSE4A" : "",
+    is_netburst() ? " Netburst" : "",
+    is_intel_family_core() ? " Core" : "",
+    x64);
+
+  return OS_OK;
+}
+
+int VM_Version_Ext::cpu_extended_brand_string(char* const buf, size_t buf_len) {
+  assert(buf != NULL, "buffer is NULL!");
+  assert(buf_len >= CPU_EBS_MAX_LENGTH, "buffer len should at least be == CPU_EBS_MAX_LENGTH!");
+  assert(getCPUIDBrandString_stub != NULL, "not initialized");
+
+  // invoke newly generated asm code to fetch CPU Brand String
+  getCPUIDBrandString_stub(&_cpuid_info);
+
+  // fetch results into buffer
+  *((uint32_t*) &buf[0])  = _cpuid_info.proc_name_0;
+  *((uint32_t*) &buf[4])  = _cpuid_info.proc_name_1;
+  *((uint32_t*) &buf[8])  = _cpuid_info.proc_name_2;
+  *((uint32_t*) &buf[12]) = _cpuid_info.proc_name_3;
+  *((uint32_t*) &buf[16]) = _cpuid_info.proc_name_4;
+  *((uint32_t*) &buf[20]) = _cpuid_info.proc_name_5;
+  *((uint32_t*) &buf[24]) = _cpuid_info.proc_name_6;
+  *((uint32_t*) &buf[28]) = _cpuid_info.proc_name_7;
+  *((uint32_t*) &buf[32]) = _cpuid_info.proc_name_8;
+  *((uint32_t*) &buf[36]) = _cpuid_info.proc_name_9;
+  *((uint32_t*) &buf[40]) = _cpuid_info.proc_name_10;
+  *((uint32_t*) &buf[44]) = _cpuid_info.proc_name_11;
+
+  return OS_OK;
+}
+
+size_t VM_Version_Ext::cpu_write_support_string(char* const buf, size_t buf_len) {
+  assert(buf != NULL, "buffer is NULL!");
+  assert(buf_len > 0, "buffer len not enough!");
+
+  unsigned int flag = 0;
+  unsigned int fi = 0;
+  size_t       written = 0;
+  const char*  prefix = "";
+
+#define WRITE_TO_BUF(string)                                                          \
+  {                                                                                   \
+    int res = jio_snprintf(&buf[written], buf_len - written, "%s%s", prefix, string); \
+    if (res < 0 || (size_t) res >= buf_len - 1) {                                     \
+      buf[buf_len-1] = '\0';                                                          \
+      return buf_len - 1;                                                             \
+    }                                                                                 \
+    written += res;                                                                   \
+    if (prefix[0] == '\0') {                                                          \
+      prefix = ", ";                                                                  \
+    }                                                                                 \
+  }
+
+  for (flag = 1, fi = 0; flag <= 0x20000000 ; flag <<= 1, fi++) {
+    if (flag == HTT_FLAG && (((_cpuid_info.std_cpuid1_ebx.value >> 16) & 0xff) <= 1)) {
+      continue; /* no hyperthreading */
+    } else if (flag == SEP_FLAG && (cpu_family() == CPU_FAMILY_PENTIUMPRO && ((_cpuid_info.std_cpuid1_eax.value & 0xff) < 0x33))) {
+      continue; /* no fast system call */
+    }
+    if ((_cpuid_info.std_cpuid1_edx.value & flag) && strlen(_feature_edx_id[fi]) > 0) {
+      WRITE_TO_BUF(_feature_edx_id[fi]);
+    }
+  }
+
+  for (flag = 1, fi = 0; flag <= 0x20000000; flag <<= 1, fi++) {
+    if ((_cpuid_info.std_cpuid1_ecx.value & flag) && strlen(_feature_ecx_id[fi]) > 0) {
+      WRITE_TO_BUF(_feature_ecx_id[fi]);
+    }
+  }
+
+  for (flag = 1, fi = 0; flag <= 0x20000000 ; flag <<= 1, fi++) {
+    if ((_cpuid_info.ext_cpuid1_ecx.value & flag) && strlen(_feature_extended_ecx_id[fi]) > 0) {
+      WRITE_TO_BUF(_feature_extended_ecx_id[fi]);
+    }
+  }
+
+  for (flag = 1, fi = 0; flag <= 0x20000000; flag <<= 1, fi++) {
+    if ((_cpuid_info.ext_cpuid1_edx.value & flag) && strlen(_feature_extended_edx_id[fi]) > 0) {
+      WRITE_TO_BUF(_feature_extended_edx_id[fi]);
+    }
+  }
+
+  if (supports_tscinv_bit()) {
+      WRITE_TO_BUF("Invariant TSC");
+  }
+
+  return written;
+}
+
+/**
+ * Write a detailed description of the cpu to a given buffer, including
+ * feature set.
+ */
+int VM_Version_Ext::cpu_detailed_description(char* const buf, size_t buf_len) {
+  assert(buf != NULL, "buffer is NULL!");
+  assert(buf_len >= CPU_DETAILED_DESC_BUF_SIZE, "buffer len should at least be == CPU_DETAILED_DESC_BUF_SIZE!");
+
+  static const char* unknown = "<unknown>";
+  char               vendor_id[VENDOR_LENGTH];
+  const char*        family = NULL;
+  const char*        model = NULL;
+  const char*        brand = NULL;
+  int                outputLen = 0;
+
+  family = cpu_family_description();
+  if (family == NULL) {
+    family = unknown;
+  }
+
+  model = cpu_model_description();
+  if (model == NULL) {
+    model = unknown;
+  }
+
+  brand = cpu_brand_string();
+
+  if (brand == NULL) {
+    brand = cpu_brand();
+    if (brand == NULL) {
+      brand = unknown;
+    }
+  }
+
+  *((uint32_t*) &vendor_id[0]) = _cpuid_info.std_vendor_name_0;
+  *((uint32_t*) &vendor_id[4]) = _cpuid_info.std_vendor_name_2;
+  *((uint32_t*) &vendor_id[8]) = _cpuid_info.std_vendor_name_1;
+  vendor_id[VENDOR_LENGTH-1] = '\0';
+
+  outputLen = jio_snprintf(buf, buf_len, "Brand: %s, Vendor: %s\n"
+    "Family: %s (0x%x), Model: %s (0x%x), Stepping: 0x%x\n"
+    "Ext. family: 0x%x, Ext. model: 0x%x, Type: 0x%x, Signature: 0x%8.8x\n"
+    "Features: ebx: 0x%8.8x, ecx: 0x%8.8x, edx: 0x%8.8x\n"
+    "Ext. features: eax: 0x%8.8x, ebx: 0x%8.8x, ecx: 0x%8.8x, edx: 0x%8.8x\n"
+    "Supports: ",
+    brand,
+    vendor_id,
+    family,
+    extended_cpu_family(),
+    model,
+    extended_cpu_model(),
+    cpu_stepping(),
+    _cpuid_info.std_cpuid1_eax.bits.ext_family,
+    _cpuid_info.std_cpuid1_eax.bits.ext_model,
+    _cpuid_info.std_cpuid1_eax.bits.proc_type,
+    _cpuid_info.std_cpuid1_eax.value,
+    _cpuid_info.std_cpuid1_ebx.value,
+    _cpuid_info.std_cpuid1_ecx.value,
+    _cpuid_info.std_cpuid1_edx.value,
+    _cpuid_info.ext_cpuid1_eax,
+    _cpuid_info.ext_cpuid1_ebx,
+    _cpuid_info.ext_cpuid1_ecx,
+    _cpuid_info.ext_cpuid1_edx);
+
+  if (outputLen < 0 || (size_t) outputLen >= buf_len - 1) {
+    buf[buf_len-1] = '\0';
+    return OS_ERR;
+  }
+
+  cpu_write_support_string(&buf[outputLen], buf_len - outputLen);
+
+  return OS_OK;
+}
+
+const char* VM_Version_Ext::cpu_name(void) {
+  char cpu_type_desc[CPU_TYPE_DESC_BUF_SIZE];
+  size_t cpu_desc_len = sizeof(cpu_type_desc);
+
+  cpu_type_description(cpu_type_desc, cpu_desc_len);
+  char* tmp = NEW_C_HEAP_ARRAY_RETURN_NULL(char, cpu_desc_len, mtTracing);
+  if (NULL == tmp) {
+    return NULL;
+  }
+  strncpy(tmp, cpu_type_desc, cpu_desc_len);
+  return tmp;
+}
+
+const char* VM_Version_Ext::cpu_description(void) {
+  char cpu_detailed_desc_buffer[CPU_DETAILED_DESC_BUF_SIZE];
+  size_t cpu_detailed_desc_len = sizeof(cpu_detailed_desc_buffer);
+
+  cpu_detailed_description(cpu_detailed_desc_buffer, cpu_detailed_desc_len);
+
+  char* tmp = NEW_C_HEAP_ARRAY_RETURN_NULL(char, cpu_detailed_desc_len, mtTracing);
+
+  if (NULL == tmp) {
+    return NULL;
+  }
+
+  strncpy(tmp, cpu_detailed_desc_buffer, cpu_detailed_desc_len);
+  return tmp;
+}
+
+/**
+ *  See Intel Application note 485 (chapter 10) for details
+ *  on frequency extraction from cpu brand string.
+ *  http://www.intel.com/content/dam/www/public/us/en/documents/application-notes/processor-identification-cpuid-instruction-note.pdf
+ *
+ */
+jlong VM_Version_Ext::max_qualified_cpu_freq_from_brand_string(void) {
+  // get brand string
+  const char* const brand_string = cpu_brand_string();
+  if (brand_string == NULL) {
+    return 0;
+  }
+
+  const u8 MEGA = 1000000;
+  u8 multiplier = 0;
+  jlong frequency = 0;
+
+  // the frequency information in the cpu brand string
+  // is given in either of two formats "x.xxyHz" or "xxxxyHz",
+  // where y=M,G,T and x is digits
+  const char* Hz_location = strchr(brand_string, 'H');
+
+  if (Hz_location != NULL) {
+    if (*(Hz_location + 1) == 'z') {
+      // switch on y in "yHz"
+      switch(*(Hz_location - 1)) {
+        case 'M' :
+          // Set multiplier to frequency is in Hz
+          multiplier = MEGA;
+          break;
+        case 'G' :
+          multiplier = MEGA * 1000;
+          break;
+        case 'T' :
+          multiplier = MEGA * 1000 * 1000;
+          break;
+      }
+    }
+  }
+
+  if (multiplier > 0) {
+    // compute frequency (in Hz) from brand string
+    if (*(Hz_location - 4) == '.') { // if format is "x.xx"
+      frequency =  (jlong)(*(Hz_location - 5) - '0') * (multiplier);
+      frequency += (jlong)(*(Hz_location - 3) - '0') * (multiplier / 10);
+      frequency += (jlong)(*(Hz_location - 2) - '0') * (multiplier / 100);
+    } else { // format is "xxxx"
+      frequency =  (jlong)(*(Hz_location - 5) - '0') * 1000;
+      frequency += (jlong)(*(Hz_location - 4) - '0') * 100;
+      frequency += (jlong)(*(Hz_location - 3) - '0') * 10;
+      frequency += (jlong)(*(Hz_location - 2) - '0');
+      frequency *= multiplier;
+    }
+  }
+  return frequency;
+}
+
+
+jlong VM_Version_Ext::maximum_qualified_cpu_frequency(void) {
+  if (_max_qualified_cpu_frequency == 0) {
+    _max_qualified_cpu_frequency = max_qualified_cpu_freq_from_brand_string();
+  }
+  return _max_qualified_cpu_frequency;
+}
+
+const char* const VM_Version_Ext::_family_id_intel[] = {
+  "8086/8088",
+  "",
+  "286",
+  "386",
+  "486",
+  "Pentium",
+  "Pentium Pro",   //or Pentium-M/Woodcrest depeding on model
+  "",
+  "",
+  "",
+  "",
+  "",
+  "",
+  "",
+  "",
+  "Pentium 4"
+};
+
+const char* const VM_Version_Ext::_family_id_amd[] = {
+  "",
+  "",
+  "",
+  "",
+  "5x86",
+  "K5/K6",
+  "Athlon/AthlonXP",
+  "",
+  "",
+  "",
+  "",
+  "",
+  "",
+  "",
+  "",
+  "Opteron/Athlon64",
+  "Opteron QC/Phenom"  // Barcelona et.al.
+};
+// Partially from Intel 64 and IA-32 Architecture Software Developer's Manual,
+// September 2013, Vol 3C Table 35-1
+const char* const VM_Version_Ext::_model_id_pentium_pro[] = {
+  "",
+  "Pentium Pro",
+  "",
+  "Pentium II model 3",
+  "",
+  "Pentium II model 5/Xeon/Celeron",
+  "Celeron",
+  "Pentium III/Pentium III Xeon",
+  "Pentium III/Pentium III Xeon",
+  "Pentium M model 9",    // Yonah
+  "Pentium III, model A",
+  "Pentium III, model B",
+  "",
+  "Pentium M model D",    // Dothan
+  "",
+  "Core 2",               // 0xf Woodcrest/Conroe/Merom/Kentsfield/Clovertown
+  "",
+  "",
+  "",
+  "",
+  "",
+  "",
+  "Celeron",              // 0x16 Celeron 65nm
+  "Core 2",               // 0x17 Penryn / Harpertown
+  "",
+  "",
+  "Core i7",              // 0x1A CPU_MODEL_NEHALEM_EP
+  "Atom",                 // 0x1B Z5xx series Silverthorn
+  "",
+  "Core 2",               // 0x1D Dunnington (6-core)
+  "Nehalem",              // 0x1E CPU_MODEL_NEHALEM
+  "",
+  "",
+  "",
+  "",
+  "",
+  "",
+  "Westmere",             // 0x25 CPU_MODEL_WESTMERE
+  "",
+  "",
+  "",                     // 0x28
+  "",
+  "Sandy Bridge",         // 0x2a "2nd Generation Intel Core i7, i5, i3"
+  "",
+  "Westmere-EP",          // 0x2c CPU_MODEL_WESTMERE_EP
+  "Sandy Bridge-EP",      // 0x2d CPU_MODEL_SANDYBRIDGE_EP
+  "Nehalem-EX",           // 0x2e CPU_MODEL_NEHALEM_EX
+  "Westmere-EX",          // 0x2f CPU_MODEL_WESTMERE_EX
+  "",
+  "",
+  "",
+  "",
+  "",
+  "",
+  "",
+  "",
+  "",
+  "",
+  "Ivy Bridge",           // 0x3a
+  "",
+  "Haswell",              // 0x3c "4th Generation Intel Core Processor"
+  "",                     // 0x3d "Next Generation Intel Core Processor"
+  "Ivy Bridge-EP",        // 0x3e "Next Generation Intel Xeon Processor E7 Family"
+  "",                     // 0x3f "Future Generation Intel Xeon Processor"
+  "",
+  "",
+  "",
+  "",
+  "",
+  "Haswell",              // 0x45 "4th Generation Intel Core Processor"
+  "Haswell",              // 0x46 "4th Generation Intel Core Processor"
+  NULL
+};
+
+/* Brand ID is for back compability
+ * Newer CPUs uses the extended brand string */
+const char* const VM_Version_Ext::_brand_id[] = {
+  "",
+  "Celeron processor",
+  "Pentium III processor",
+  "Intel Pentium III Xeon processor",
+  "",
+  "",
+  "",
+  "",
+  "Intel Pentium 4 processor",
+  NULL
+};
+
+
+const char* const VM_Version_Ext::_feature_edx_id[] = {
+  "On-Chip FPU",
+  "Virtual Mode Extensions",
+  "Debugging Extensions",
+  "Page Size Extensions",
+  "Time Stamp Counter",
+  "Model Specific Registers",
+  "Physical Address Extension",
+  "Machine Check Exceptions",
+  "CMPXCHG8B Instruction",
+  "On-Chip APIC",
+  "",
+  "Fast System Call",
+  "Memory Type Range Registers",
+  "Page Global Enable",
+  "Machine Check Architecture",
+  "Conditional Mov Instruction",
+  "Page Attribute Table",
+  "36-bit Page Size Extension",
+  "Processor Serial Number",
+  "CLFLUSH Instruction",
+  "",
+  "Debug Trace Store feature",
+  "ACPI registers in MSR space",
+  "Intel Architecture MMX Technology",
+  "Fast Float Point Save and Restore",
+  "Streaming SIMD extensions",
+  "Streaming SIMD extensions 2",
+  "Self-Snoop",
+  "Hyper Threading",
+  "Thermal Monitor",
+  "",
+  "Pending Break Enable"
+};
+
+const char* const VM_Version_Ext::_feature_extended_edx_id[] = {
+  "",
+  "",
+  "",
+  "",
+  "",
+  "",
+  "",
+  "",
+  "",
+  "",
+  "",
+  "SYSCALL/SYSRET",
+  "",
+  "",
+  "",
+  "",
+  "",
+  "",
+  "",
+  "",
+  "Execute Disable Bit",
+  "",
+  "",
+  "",
+  "",
+  "",
+  "",
+  "RDTSCP",
+  "",
+  "Intel 64 Architecture",
+  "",
+  ""
+};
+
+const char* const VM_Version_Ext::_feature_ecx_id[] = {
+  "Streaming SIMD Extensions 3",
+  "PCLMULQDQ",
+  "64-bit DS Area",
+  "MONITOR/MWAIT instructions",
+  "CPL Qualified Debug Store",
+  "Virtual Machine Extensions",
+  "Safer Mode Extensions",
+  "Enhanced Intel SpeedStep technology",
+  "Thermal Monitor 2",
+  "Supplemental Streaming SIMD Extensions 3",
+  "L1 Context ID",
+  "",
+  "Fused Multiply-Add",
+  "CMPXCHG16B",
+  "xTPR Update Control",
+  "Perfmon and Debug Capability",
+  "",
+  "Process-context identifiers",
+  "Direct Cache Access",
+  "Streaming SIMD extensions 4.1",
+  "Streaming SIMD extensions 4.2",
+  "x2APIC",
+  "MOVBE",
+  "Popcount instruction",
+  "TSC-Deadline",
+  "AESNI",
+  "XSAVE",
+  "OSXSAVE",
+  "AVX",
+  "F16C",
+  "RDRAND",
+  ""
+};
+
+const char* const VM_Version_Ext::_feature_extended_ecx_id[] = {
+  "LAHF/SAHF instruction support",
+  "Core multi-processor leagacy mode",
+  "",
+  "",
+  "",
+  "Advanced Bit Manipulations: LZCNT",
+  "SSE4A: MOVNTSS, MOVNTSD, EXTRQ, INSERTQ",
+  "Misaligned SSE mode",
+  "",
+  "",
+  "",
+  "",
+  "",
+  "",
+  "",
+  "",
+  "",
+  "",
+  "",
+  "",
+  "",
+  "",
+  "",
+  "",
+  "",
+  "",
+  "",
+  "",
+  "",
+  "",
+  "",
+  ""
+};
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/hotspot/cpu/x86/vm_version_ext_x86.hpp	Tue May 15 20:24:34 2018 +0200
@@ -0,0 +1,99 @@
+/*
+ * Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+#ifndef CPU_X86_VM_VM_VERSION_EXT_X86_HPP
+#define CPU_X86_VM_VM_VERSION_EXT_X86_HPP
+
+#include "utilities/macros.hpp"
+#include "vm_version_x86.hpp"
+
+class VM_Version_Ext : public VM_Version {
+ private:
+  static const size_t      VENDOR_LENGTH;
+  static const size_t      CPU_EBS_MAX_LENGTH;
+  static const size_t      CPU_TYPE_DESC_BUF_SIZE;
+  static const size_t      CPU_DETAILED_DESC_BUF_SIZE;
+
+  static const char* const _family_id_intel[];
+  static const char* const _family_id_amd[];
+  static const char* const _brand_id[];
+  static const char* const _model_id_pentium_pro[];
+
+  static const char* const _feature_edx_id[];
+  static const char* const _feature_extended_edx_id[];
+  static const char* const _feature_ecx_id[];
+  static const char* const _feature_extended_ecx_id[];
+
+  static int               _no_of_threads;
+  static int               _no_of_cores;
+  static int               _no_of_packages;
+  static char*             _cpu_brand_string;
+  static jlong             _max_qualified_cpu_frequency;
+
+  static const char* cpu_family_description(void);
+  static const char* cpu_model_description(void);
+  static const char* cpu_brand(void);
+  static const char* cpu_brand_string(void);
+
+  static int cpu_type_description(char* const buf, size_t buf_len);
+  static int cpu_detailed_description(char* const buf, size_t buf_len);
+  static int cpu_extended_brand_string(char* const buf, size_t buf_len);
+
+  static bool cpu_is_em64t(void);
+  static bool is_netburst(void);
+
+  static size_t cpu_write_support_string(char* const buf, size_t buf_len);
+  static void resolve_cpu_information_details(void);
+  static jlong max_qualified_cpu_freq_from_brand_string(void);
+
+ public:
+  // Offsets for cpuid asm stub brand string
+  static ByteSize proc_name_0_offset() { return byte_offset_of(CpuidInfo, proc_name_0); }
+  static ByteSize proc_name_1_offset() { return byte_offset_of(CpuidInfo, proc_name_1); }
+  static ByteSize proc_name_2_offset() { return byte_offset_of(CpuidInfo, proc_name_2); }
+  static ByteSize proc_name_3_offset() { return byte_offset_of(CpuidInfo, proc_name_3); }
+  static ByteSize proc_name_4_offset() { return byte_offset_of(CpuidInfo, proc_name_4); }
+  static ByteSize proc_name_5_offset() { return byte_offset_of(CpuidInfo, proc_name_5); }
+  static ByteSize proc_name_6_offset() { return byte_offset_of(CpuidInfo, proc_name_6); }
+  static ByteSize proc_name_7_offset() { return byte_offset_of(CpuidInfo, proc_name_7); }
+  static ByteSize proc_name_8_offset() { return byte_offset_of(CpuidInfo, proc_name_8); }
+  static ByteSize proc_name_9_offset() { return byte_offset_of(CpuidInfo, proc_name_9); }
+  static ByteSize proc_name_10_offset() { return byte_offset_of(CpuidInfo, proc_name_10); }
+  static ByteSize proc_name_11_offset() { return byte_offset_of(CpuidInfo, proc_name_11); }
+
+  static int number_of_threads(void);
+  static int number_of_cores(void);
+  static int number_of_sockets(void);
+
+  static jlong maximum_qualified_cpu_frequency(void);
+
+  static bool supports_tscinv_ext(void);
+
+  static const char* cpu_name(void);
+  static const char* cpu_description(void);
+
+  static void initialize();
+};
+
+#endif // CPU_X86_VM_VM_VERSION_EXT_X86_HPP
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/hotspot/os/bsd/os_perf_bsd.cpp	Tue May 15 20:24:34 2018 +0200
@@ -0,0 +1,405 @@
+/*
+ * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+#include "precompiled.hpp"
+#include "memory/allocation.inline.hpp"
+#include "memory/resourceArea.hpp"
+#include "runtime/os.hpp"
+#include "runtime/os_perf.hpp"
+#include "vm_version_ext_x86.hpp"
+
+#ifdef __APPLE__
+  #import <libproc.h>
+  #include <sys/time.h>
+  #include <sys/sysctl.h>
+  #include <mach/mach.h>
+  #include <mach/task_info.h>
+#endif
+
+static const double NANOS_PER_SEC = 1000000000.0;
+
+class CPUPerformanceInterface::CPUPerformance : public CHeapObj<mtInternal> {
+   friend class CPUPerformanceInterface;
+ private:
+  long _total_cpu_nanos;
+  long _total_csr_nanos;
+  long _jvm_user_nanos;
+  long _jvm_system_nanos;
+  long _jvm_context_switches;
+  long _used_ticks;
+  long _total_ticks;
+  int  _active_processor_count;
+
+  bool now_in_nanos(long* resultp) {
+    timeval current_time;
+    if (gettimeofday(&current_time, NULL) != 0) {
+      // Error getting current time
+      return false;
+    }
+    *resultp = current_time.tv_sec * NANOS_PER_SEC + 1000L * current_time.tv_usec;
+    return true;
+  }
+
+  double normalize(double value) {
+    return MIN2<double>(MAX2<double>(value, 0.0), 1.0);
+  }
+  int cpu_load(int which_logical_cpu, double* cpu_load);
+  int context_switch_rate(double* rate);
+  int cpu_load_total_process(double* cpu_load);
+  int cpu_loads_process(double* pjvmUserLoad, double* pjvmKernelLoad, double* psystemTotalLoad);
+
+  CPUPerformance(const CPUPerformance& rhs); // no impl
+  CPUPerformance& operator=(const CPUPerformance& rhs); // no impl
+ public:
+  CPUPerformance();
+  bool initialize();
+  ~CPUPerformance();
+};
+
+CPUPerformanceInterface::CPUPerformance::CPUPerformance() {
+  _total_cpu_nanos= 0;
+  _total_csr_nanos= 0;
+  _jvm_context_switches = 0;
+  _jvm_user_nanos = 0;
+  _jvm_system_nanos = 0;
+  _used_ticks = 0;
+  _total_ticks = 0;
+  _active_processor_count = 0;
+}
+
+bool CPUPerformanceInterface::CPUPerformance::initialize() {
+  return true;
+}
+
+CPUPerformanceInterface::CPUPerformance::~CPUPerformance() {
+}
+
+int CPUPerformanceInterface::CPUPerformance::cpu_load(int which_logical_cpu, double* cpu_load) {
+  return FUNCTIONALITY_NOT_IMPLEMENTED;
+}
+
+int CPUPerformanceInterface::CPUPerformance::cpu_load_total_process(double* cpu_load) {
+#ifdef __APPLE__
+  host_name_port_t host = mach_host_self();
+  host_flavor_t flavor = HOST_CPU_LOAD_INFO;
+  mach_msg_type_number_t host_info_count = HOST_CPU_LOAD_INFO_COUNT;
+  host_cpu_load_info_data_t cpu_load_info;
+
+  kern_return_t kr = host_statistics(host, flavor, (host_info_t)&cpu_load_info, &host_info_count);
+  if (kr != KERN_SUCCESS) {
+    return OS_ERR;
+  }
+
+  long used_ticks  = cpu_load_info.cpu_ticks[CPU_STATE_USER] + cpu_load_info.cpu_ticks[CPU_STATE_NICE] + cpu_load_info.cpu_ticks[CPU_STATE_SYSTEM];
+  long total_ticks = used_ticks + cpu_load_info.cpu_ticks[CPU_STATE_IDLE];
+
+  if (_used_ticks == 0 || _total_ticks == 0) {
+    // First call, just set the values
+    _used_ticks  = used_ticks;
+    _total_ticks = total_ticks;
+    return OS_ERR;
+  }
+
+  long used_delta  = used_ticks - _used_ticks;
+  long total_delta = total_ticks - _total_ticks;
+
+  _used_ticks  = used_ticks;
+  _total_ticks = total_ticks;
+
+  if (total_delta == 0) {
+    // Avoid division by zero
+    return OS_ERR;
+  }
+
+  *cpu_load = (double)used_delta / total_delta;
+
+  return OS_OK;
+#else
+  return FUNCTIONALITY_NOT_IMPLEMENTED;
+#endif
+}
+
+int CPUPerformanceInterface::CPUPerformance::cpu_loads_process(double* pjvmUserLoad, double* pjvmKernelLoad, double* psystemTotalLoad) {
+#ifdef __APPLE__
+  int result = cpu_load_total_process(psystemTotalLoad);
+  mach_port_t task = mach_task_self();
+  mach_msg_type_number_t task_info_count = TASK_INFO_MAX;
+  task_info_data_t task_info_data;
+  kern_return_t kr = task_info(task, TASK_ABSOLUTETIME_INFO, (task_info_t)task_info_data, &task_info_count);
+  if (kr != KERN_SUCCESS) {
+    return OS_ERR;
+  }
+  task_absolutetime_info_t absolutetime_info = (task_absolutetime_info_t)task_info_data;
+
+  int active_processor_count = os::active_processor_count();
+  long jvm_user_nanos = absolutetime_info->total_user;
+  long jvm_system_nanos = absolutetime_info->total_system;
+
+  long total_cpu_nanos;
+  if(!now_in_nanos(&total_cpu_nanos)) {
+    return OS_ERR;
+  }
+
+  if (_total_cpu_nanos == 0 || active_processor_count != _active_processor_count) {
+    // First call or change in active processor count
+    result = OS_ERR;
+  }
+
+  long delta_nanos = active_processor_count * (total_cpu_nanos - _total_cpu_nanos);
+  if (delta_nanos == 0) {
+    // Avoid division by zero
+    return OS_ERR;
+  }
+
+  *pjvmUserLoad = normalize((double)(jvm_user_nanos - _jvm_user_nanos)/delta_nanos);
+  *pjvmKernelLoad = normalize((double)(jvm_system_nanos - _jvm_system_nanos)/delta_nanos);
+
+  _active_processor_count = active_processor_count;
+  _total_cpu_nanos = total_cpu_nanos;
+  _jvm_user_nanos = jvm_user_nanos;
+  _jvm_system_nanos = jvm_system_nanos;
+
+  return result;
+#else
+  return FUNCTIONALITY_NOT_IMPLEMENTED;
+#endif
+}
+
+int CPUPerformanceInterface::CPUPerformance::context_switch_rate(double* rate) {
+#ifdef __APPLE__
+  mach_port_t task = mach_task_self();
+  mach_msg_type_number_t task_info_count = TASK_INFO_MAX;
+  task_info_data_t task_info_data;
+  kern_return_t kr = task_info(task, TASK_EVENTS_INFO, (task_info_t)task_info_data, &task_info_count);
+  if (kr != KERN_SUCCESS) {
+    return OS_ERR;
+  }
+
+  int result = OS_OK;
+  if (_total_csr_nanos == 0 || _jvm_context_switches == 0) {
+    // First call just set initial values.
+    result = OS_ERR;
+  }
+
+  long jvm_context_switches = ((task_events_info_t)task_info_data)->csw;
+
+  long total_csr_nanos;
+  if(!now_in_nanos(&total_csr_nanos)) {
+    return OS_ERR;
+  }
+  double delta_in_sec = (double)(total_csr_nanos - _total_csr_nanos) / NANOS_PER_SEC;
+  if (delta_in_sec == 0.0) {
+    // Avoid division by zero
+    return OS_ERR;
+  }
+
+  *rate = (jvm_context_switches - _jvm_context_switches) / delta_in_sec;
+
+  _jvm_context_switches = jvm_context_switches;
+  _total_csr_nanos = total_csr_nanos;
+
+  return result;
+#else
+  return FUNCTIONALITY_NOT_IMPLEMENTED;
+#endif
+}
+
+CPUPerformanceInterface::CPUPerformanceInterface() {
+  _impl = NULL;
+}
+
+bool CPUPerformanceInterface::initialize() {
+  _impl = new CPUPerformanceInterface::CPUPerformance();
+  return _impl != NULL && _impl->initialize();
+}
+
+CPUPerformanceInterface::~CPUPerformanceInterface() {
+  if (_impl != NULL) {
+    delete _impl;
+  }
+}
+
+int CPUPerformanceInterface::cpu_load(int which_logical_cpu, double* cpu_load) const {
+  return _impl->cpu_load(which_logical_cpu, cpu_load);
+}
+
+int CPUPerformanceInterface::cpu_load_total_process(double* cpu_load) const {
+  return _impl->cpu_load_total_process(cpu_load);
+}
+
+int CPUPerformanceInterface::cpu_loads_process(double* pjvmUserLoad, double* pjvmKernelLoad, double* psystemTotalLoad) const {
+  return _impl->cpu_loads_process(pjvmUserLoad, pjvmKernelLoad, psystemTotalLoad);
+}
+
+int CPUPerformanceInterface::context_switch_rate(double* rate) const {
+  return _impl->context_switch_rate(rate);
+}
+
+class SystemProcessInterface::SystemProcesses : public CHeapObj<mtInternal> {
+  friend class SystemProcessInterface;
+ private:
+  SystemProcesses();
+  bool initialize();
+  SystemProcesses(const SystemProcesses& rhs); // no impl
+  SystemProcesses& operator=(const SystemProcesses& rhs); // no impl
+  ~SystemProcesses();
+
+  //information about system processes
+  int system_processes(SystemProcess** system_processes, int* no_of_sys_processes) const;
+};
+
+SystemProcessInterface::SystemProcesses::SystemProcesses() {
+}
+
+bool SystemProcessInterface::SystemProcesses::initialize() {
+  return true;
+}
+
+SystemProcessInterface::SystemProcesses::~SystemProcesses() {
+}
+int SystemProcessInterface::SystemProcesses::system_processes(SystemProcess** system_processes, int* no_of_sys_processes) const {
+  assert(system_processes != NULL, "system_processes pointer is NULL!");
+  assert(no_of_sys_processes != NULL, "system_processes counter pointer is NULL!");
+#ifdef __APPLE__
+  pid_t* pids = NULL;
+  int pid_count = 0;
+  ResourceMark rm;
+
+  int try_count = 0;
+  while (pids == NULL) {
+    // Find out buffer size
+    size_t pids_bytes = proc_listpids(PROC_ALL_PIDS, 0, NULL, 0);
+    if (pids_bytes <= 0) {
+      return OS_ERR;
+    }
+    pid_count = pids_bytes / sizeof(pid_t);
+    pids = NEW_RESOURCE_ARRAY(pid_t, pid_count);
+    memset(pids, 0, pids_bytes);
+
+    pids_bytes = proc_listpids(PROC_ALL_PIDS, 0, pids, pids_bytes);
+    if (pids_bytes <= 0) {
+       // couldn't fit buffer, retry.
+      FREE_RESOURCE_ARRAY(pid_t, pids, pid_count);
+      pids = NULL;
+      try_count++;
+      if (try_count > 3) {
+      return OS_ERR;
+      }
+    } else {
+      pid_count = pids_bytes / sizeof(pid_t);
+    }
+  }
+
+  int process_count = 0;
+  SystemProcess* next = NULL;
+  for (int i = 0; i < pid_count; i++) {
+    pid_t pid = pids[i];
+    if (pid != 0) {
+      char buffer[PROC_PIDPATHINFO_MAXSIZE];
+      memset(buffer, 0 , sizeof(buffer));
+      if (proc_pidpath(pid, buffer, sizeof(buffer)) != -1) {
+        int length = strlen(buffer);
+        if (length > 0) {
+          SystemProcess* current = new SystemProcess();
+          char * path = NEW_C_HEAP_ARRAY(char, length + 1, mtInternal);
+          strcpy(path, buffer);
+          current->set_path(path);
+          current->set_pid((int)pid);
+          current->set_next(next);
+          next = current;
+          process_count++;
+        }
+      }
+    }
+  }
+
+  *no_of_sys_processes = process_count;
+  *system_processes = next;
+
+  return OS_OK;
+#endif
+  return FUNCTIONALITY_NOT_IMPLEMENTED;
+}
+
+int SystemProcessInterface::system_processes(SystemProcess** system_procs, int* no_of_sys_processes) const {
+  return _impl->system_processes(system_procs, no_of_sys_processes);
+}
+
+SystemProcessInterface::SystemProcessInterface() {
+  _impl = NULL;
+}
+
+bool SystemProcessInterface::initialize() {
+  _impl = new SystemProcessInterface::SystemProcesses();
+  return _impl != NULL && _impl->initialize();
+}
+
+SystemProcessInterface::~SystemProcessInterface() {
+  if (_impl != NULL) {
+    delete _impl;
+ }
+}
+
+CPUInformationInterface::CPUInformationInterface() {
+  _cpu_info = NULL;
+}
+
+bool CPUInformationInterface::initialize() {
+  _cpu_info = new CPUInformation();
+
+  if (NULL == _cpu_info) {
+    return false;
+  }
+  _cpu_info->set_number_of_hardware_threads(VM_Version_Ext::number_of_threads());
+  _cpu_info->set_number_of_cores(VM_Version_Ext::number_of_cores());
+  _cpu_info->set_number_of_sockets(VM_Version_Ext::number_of_sockets());
+  _cpu_info->set_cpu_name(VM_Version_Ext::cpu_name());
+  _cpu_info->set_cpu_description(VM_Version_Ext::cpu_description());
+
+  return true;
+}
+
+CPUInformationInterface::~CPUInformationInterface() {
+  if (_cpu_info != NULL) {
+    if (_cpu_info->cpu_name() != NULL) {
+      const char* cpu_name = _cpu_info->cpu_name();
+      FREE_C_HEAP_ARRAY(char, cpu_name);
+      _cpu_info->set_cpu_name(NULL);
+    }
+    if (_cpu_info->cpu_description() != NULL) {
+      const char* cpu_desc = _cpu_info->cpu_description();
+      FREE_C_HEAP_ARRAY(char, cpu_desc);
+      _cpu_info->set_cpu_description(NULL);
+    }
+    delete _cpu_info;
+  }
+}
+
+int CPUInformationInterface::cpu_information(CPUInformation& cpu_info) {
+  if (NULL == _cpu_info) {
+    return OS_ERR;
+  }
+
+  cpu_info = *_cpu_info; // shallow copy assignment
+  return OS_OK;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/hotspot/os/linux/os_perf_linux.cpp	Tue May 15 20:24:34 2018 +0200
@@ -0,0 +1,1060 @@
+/*
+ * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+#include "precompiled.hpp"
+#include "jvm.h"
+#include "memory/allocation.inline.hpp"
+#include "os_linux.inline.hpp"
+#include "runtime/os.hpp"
+#include "runtime/os_perf.hpp"
+
+#ifdef X86
+#include "vm_version_ext_x86.hpp"
+#endif
+#ifdef ARM
+#include "vm_version_ext_arm.hpp"
+#endif
+#ifndef ARM
+#ifdef AARCH64
+#include "vm_version_ext_aarch64.hpp"
+#endif
+#endif
+
+#include <stdio.h>
+#include <stdarg.h>
+#include <unistd.h>
+#include <errno.h>
+#include <string.h>
+#include <sys/resource.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <dirent.h>
+#include <stdlib.h>
+#include <dlfcn.h>
+#include <pthread.h>
+#include <limits.h>
+
+/**
+   /proc/[number]/stat
+              Status information about the process.  This is used by ps(1).  It is defined in /usr/src/linux/fs/proc/array.c.
+
+              The fields, in order, with their proper scanf(3) format specifiers, are:
+
+              1. pid %d The process id.
+
+              2. comm %s
+                     The filename of the executable, in parentheses.  This is visible whether or not the executable is swapped out.
+
+              3. state %c
+                     One  character  from  the  string "RSDZTW" where R is running, S is sleeping in an interruptible wait, D is waiting in uninterruptible disk
+                     sleep, Z is zombie, T is traced or stopped (on a signal), and W is paging.
+
+              4. ppid %d
+                     The PID of the parent.
+
+              5. pgrp %d
+                     The process group ID of the process.
+
+              6. session %d
+                     The session ID of the process.
+
+              7. tty_nr %d
+                     The tty the process uses.
+
+              8. tpgid %d
+                     The process group ID of the process which currently owns the tty that the process is connected to.
+
+              9. flags %lu
+                     The flags of the process.  The math bit is decimal 4, and the traced bit is decimal 10.
+
+              10. minflt %lu
+                     The number of minor faults the process has made which have not required loading a memory page from disk.
+
+              11. cminflt %lu
+                     The number of minor faults that the process's waited-for children have made.
+
+              12. majflt %lu
+                     The number of major faults the process has made which have required loading a memory page from disk.
+
+              13. cmajflt %lu
+                     The number of major faults that the process's waited-for children have made.
+
+              14. utime %lu
+                     The number of jiffies that this process has been scheduled in user mode.
+
+              15. stime %lu
+                     The number of jiffies that this process has been scheduled in kernel mode.
+
+              16. cutime %ld
+                     The number of jiffies that this process's waited-for children have been scheduled in user mode. (See also times(2).)
+
+              17. cstime %ld
+                     The number of jiffies that this process' waited-for children have been scheduled in kernel mode.
+
+              18. priority %ld
+                     The standard nice value, plus fifteen.  The value is never negative in the kernel.
+
+              19. nice %ld
+                     The nice value ranges from 19 (nicest) to -19 (not nice to others).
+
+              20. 0 %ld  This value is hard coded to 0 as a placeholder for a removed field.
+
+              21. itrealvalue %ld
+                     The time in jiffies before the next SIGALRM is sent to the process due to an interval timer.
+
+              22. starttime %lu
+                     The time in jiffies the process started after system boot.
+
+              23. vsize %lu
+                     Virtual memory size in bytes.
+
+              24. rss %ld
+                     Resident Set Size: number of pages the process has in real memory, minus 3 for administrative purposes. This is just the pages which  count
+                     towards text, data, or stack space.  This does not include pages which have not been demand-loaded in, or which are swapped out.
+
+              25. rlim %lu
+                     Current limit in bytes on the rss of the process (usually 4294967295 on i386).
+
+              26. startcode %lu
+                     The address above which program text can run.
+
+              27. endcode %lu
+                     The address below which program text can run.
+
+              28. startstack %lu
+                     The address of the start of the stack.
+
+              29. kstkesp %lu
+                     The current value of esp (stack pointer), as found in the kernel stack page for the process.
+
+              30. kstkeip %lu
+                     The current EIP (instruction pointer).
+
+              31. signal %lu
+                     The bitmap of pending signals (usually 0).
+
+              32. blocked %lu
+                     The bitmap of blocked signals (usually 0, 2 for shells).
+
+              33. sigignore %lu
+                     The bitmap of ignored signals.
+
+              34. sigcatch %lu
+                     The bitmap of catched signals.
+
+              35. wchan %lu
+                     This  is the "channel" in which the process is waiting.  It is the address of a system call, and can be looked up in a namelist if you need
+                     a textual name.  (If you have an up-to-date /etc/psdatabase, then try ps -l to see the WCHAN field in action.)
+
+              36. nswap %lu
+                     Number of pages swapped - not maintained.
+
+              37. cnswap %lu
+                     Cumulative nswap for child processes.
+
+              38. exit_signal %d
+                     Signal to be sent to parent when we die.
+
+              39. processor %d
+                     CPU number last executed on.
+
+
+
+ ///// SSCANF FORMAT STRING. Copy and use.
+
+field:        1  2  3  4  5  6  7  8  9   10  11  12  13  14  15  16  17  18  19  20  21  22  23  24  25  26  27  28  29  30  31  32  33  34  35  36  37  38 39
+format:       %d %s %c %d %d %d %d %d %lu %lu %lu %lu %lu %lu %lu %ld %ld %ld %ld %ld %ld %lu %lu %ld %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %d %d
+
+
+*/
+
+/**
+ * For platforms that have them, when declaring
+ * a printf-style function,
+ *   formatSpec is the parameter number (starting at 1)
+ *       that is the format argument ("%d pid %s")
+ *   params is the parameter number where the actual args to
+ *       the format starts. If the args are in a va_list, this
+ *       should be 0.
+ */
+#ifndef PRINTF_ARGS
+#  define PRINTF_ARGS(formatSpec,  params) ATTRIBUTE_PRINTF(formatSpec, params)
+#endif
+
+#ifndef SCANF_ARGS
+#  define SCANF_ARGS(formatSpec,   params) ATTRIBUTE_SCANF(formatSpec, params)
+#endif
+
+#ifndef _PRINTFMT_
+#  define _PRINTFMT_
+#endif
+
+#ifndef _SCANFMT_
+#  define _SCANFMT_
+#endif
+
+
+struct CPUPerfTicks {
+  uint64_t  used;
+  uint64_t  usedKernel;
+  uint64_t  total;
+};
+
+typedef enum {
+  CPU_LOAD_VM_ONLY,
+  CPU_LOAD_GLOBAL,
+} CpuLoadTarget;
+
+enum {
+  UNDETECTED,
+  UNDETECTABLE,
+  LINUX26_NPTL,
+  BAREMETAL
+};
+
+struct CPUPerfCounters {
+  int   nProcs;
+  CPUPerfTicks jvmTicks;
+  CPUPerfTicks* cpus;
+};
+
+static double get_cpu_load(int which_logical_cpu, CPUPerfCounters* counters, double* pkernelLoad, CpuLoadTarget target);
+
+/** reads /proc/<pid>/stat data, with some checks and some skips.
+ *  Ensure that 'fmt' does _NOT_ contain the first two "%d %s"
+ */
+static int SCANF_ARGS(2, 0) vread_statdata(const char* procfile, _SCANFMT_ const char* fmt, va_list args) {
+  FILE*f;
+  int n;
+  char buf[2048];
+
+  if ((f = fopen(procfile, "r")) == NULL) {
+    return -1;
+  }
+
+  if ((n = fread(buf, 1, sizeof(buf), f)) != -1) {
+    char *tmp;
+
+    buf[n-1] = '\0';
+    /** skip through pid and exec name. */
+    if ((tmp = strrchr(buf, ')')) != NULL) {
+      // skip the ')' and the following space
+      // but check that buffer is long enough
+      tmp += 2;
+      if (tmp < buf + n) {
+        n = vsscanf(tmp, fmt, args);
+      }
+    }
+  }
+
+  fclose(f);
+
+  return n;
+}
+
+static int SCANF_ARGS(2, 3) read_statdata(const char* procfile, _SCANFMT_ const char* fmt, ...) {
+  int   n;
+  va_list args;
+
+  va_start(args, fmt);
+  n = vread_statdata(procfile, fmt, args);
+  va_end(args);
+  return n;
+}
+
+static FILE* open_statfile(void) {
+  FILE *f;
+
+  if ((f = fopen("/proc/stat", "r")) == NULL) {
+    static int haveWarned = 0;
+    if (!haveWarned) {
+      haveWarned = 1;
+    }
+  }
+  return f;
+}
+
+static void
+next_line(FILE *f) {
+  int c;
+  do {
+    c = fgetc(f);
+  } while (c != '\n' && c != EOF);
+}
+
+/**
+ * Return the total number of ticks since the system was booted.
+ * If the usedTicks parameter is not NULL, it will be filled with
+ * the number of ticks spent on actual processes (user, system or
+ * nice processes) since system boot. Note that this is the total number
+ * of "executed" ticks on _all_ CPU:s, that is on a n-way system it is
+ * n times the number of ticks that has passed in clock time.
+ *
+ * Returns a negative value if the reading of the ticks failed.
+ */
+static OSReturn get_total_ticks(int which_logical_cpu, CPUPerfTicks* pticks) {
+  FILE*         fh;
+  uint64_t      userTicks, niceTicks, systemTicks, idleTicks;
+  uint64_t      iowTicks = 0, irqTicks = 0, sirqTicks= 0;
+  int           logical_cpu = -1;
+  const int     expected_assign_count = (-1 == which_logical_cpu) ? 4 : 5;
+  int           n;
+
+  if ((fh = open_statfile()) == NULL) {
+    return OS_ERR;
+  }
+  if (-1 == which_logical_cpu) {
+    n = fscanf(fh, "cpu " UINT64_FORMAT " " UINT64_FORMAT " " UINT64_FORMAT " "
+            UINT64_FORMAT " " UINT64_FORMAT " " UINT64_FORMAT " " UINT64_FORMAT,
+            &userTicks, &niceTicks, &systemTicks, &idleTicks,
+            &iowTicks, &irqTicks, &sirqTicks);
+  } else {
+    // Move to next line
+    next_line(fh);
+
+    // find the line for requested cpu faster to just iterate linefeeds?
+    for (int i = 0; i < which_logical_cpu; i++) {
+      next_line(fh);
+    }
+
+    n = fscanf(fh, "cpu%u " UINT64_FORMAT " " UINT64_FORMAT " " UINT64_FORMAT " "
+               UINT64_FORMAT " " UINT64_FORMAT " " UINT64_FORMAT " " UINT64_FORMAT,
+               &logical_cpu, &userTicks, &niceTicks,
+               &systemTicks, &idleTicks, &iowTicks, &irqTicks, &sirqTicks);
+  }
+
+  fclose(fh);
+  if (n < expected_assign_count || logical_cpu != which_logical_cpu) {
+#ifdef DEBUG_LINUX_PROC_STAT
+    vm_fprintf(stderr, "[stat] read failed");
+#endif
+    return OS_ERR;
+  }
+
+#ifdef DEBUG_LINUX_PROC_STAT
+  vm_fprintf(stderr, "[stat] read "
+          UINT64_FORMAT " " UINT64_FORMAT " " UINT64_FORMAT " " UINT64_FORMAT " "
+          UINT64_FORMAT " " UINT64_FORMAT " " UINT64_FORMAT " \n",
+          userTicks, niceTicks, systemTicks, idleTicks,
+          iowTicks, irqTicks, sirqTicks);
+#endif
+
+  pticks->used       = userTicks + niceTicks;
+  pticks->usedKernel = systemTicks + irqTicks + sirqTicks;
+  pticks->total      = userTicks + niceTicks + systemTicks + idleTicks +
+                       iowTicks + irqTicks + sirqTicks;
+
+  return OS_OK;
+}
+
+
+static int get_systemtype(void) {
+  static int procEntriesType = UNDETECTED;
+  DIR *taskDir;
+
+  if (procEntriesType != UNDETECTED) {
+    return procEntriesType;
+  }
+
+  // Check whether we have a task subdirectory
+  if ((taskDir = opendir("/proc/self/task")) == NULL) {
+    procEntriesType = UNDETECTABLE;
+  } else {
+    // The task subdirectory exists; we're on a Linux >= 2.6 system
+    closedir(taskDir);
+    procEntriesType = LINUX26_NPTL;
+  }
+
+  return procEntriesType;
+}
+
+/** read user and system ticks from a named procfile, assumed to be in 'stat' format then. */
+static int read_ticks(const char* procfile, uint64_t* userTicks, uint64_t* systemTicks) {
+  return read_statdata(procfile, "%*c %*d %*d %*d %*d %*d %*u %*u %*u %*u %*u " UINT64_FORMAT " " UINT64_FORMAT,
+    userTicks, systemTicks);
+}
+
+/**
+ * Return the number of ticks spent in any of the processes belonging
+ * to the JVM on any CPU.
+ */
+static OSReturn get_jvm_ticks(CPUPerfTicks* pticks) {
+  uint64_t userTicks;
+  uint64_t systemTicks;
+
+  if (get_systemtype() != LINUX26_NPTL) {
+    return OS_ERR;
+  }
+
+  if (read_ticks("/proc/self/stat", &userTicks, &systemTicks) != 2) {
+    return OS_ERR;
+  }
+
+  // get the total
+  if (get_total_ticks(-1, pticks) != OS_OK) {
+    return OS_ERR;
+  }
+
+  pticks->used       = userTicks;
+  pticks->usedKernel = systemTicks;
+
+  return OS_OK;
+}
+
+/**
+ * Return the load of the CPU as a double. 1.0 means the CPU process uses all
+ * available time for user or system processes, 0.0 means the CPU uses all time
+ * being idle.
+ *
+ * Returns a negative value if there is a problem in determining the CPU load.
+ */
+static double get_cpu_load(int which_logical_cpu, CPUPerfCounters* counters, double* pkernelLoad, CpuLoadTarget target) {
+  uint64_t udiff, kdiff, tdiff;
+  CPUPerfTicks* pticks;
+  CPUPerfTicks  tmp;
+  double user_load;
+
+  *pkernelLoad = 0.0;
+
+  if (target == CPU_LOAD_VM_ONLY) {
+    pticks = &counters->jvmTicks;
+  } else if (-1 == which_logical_cpu) {
+    pticks = &counters->cpus[counters->nProcs];
+  } else {
+    pticks = &counters->cpus[which_logical_cpu];
+  }
+
+  tmp = *pticks;
+
+  if (target == CPU_LOAD_VM_ONLY) {
+    if (get_jvm_ticks(pticks) != OS_OK) {
+      return -1.0;
+    }
+  } else if (get_total_ticks(which_logical_cpu, pticks) != OS_OK) {
+    return -1.0;
+  }
+
+  // seems like we sometimes end up with less kernel ticks when
+  // reading /proc/self/stat a second time, timing issue between cpus?
+  if (pticks->usedKernel < tmp.usedKernel) {
+    kdiff = 0;
+  } else {
+    kdiff = pticks->usedKernel - tmp.usedKernel;
+  }
+  tdiff = pticks->total - tmp.total;
+  udiff = pticks->used - tmp.used;
+
+  if (tdiff == 0) {
+    return 0.0;
+  } else if (tdiff < (udiff + kdiff)) {
+    tdiff = udiff + kdiff;
+  }
+  *pkernelLoad = (kdiff / (double)tdiff);
+  // BUG9044876, normalize return values to sane values
+  *pkernelLoad = MAX2<double>(*pkernelLoad, 0.0);
+  *pkernelLoad = MIN2<double>(*pkernelLoad, 1.0);
+
+  user_load = (udiff / (double)tdiff);
+  user_load = MAX2<double>(user_load, 0.0);
+  user_load = MIN2<double>(user_load, 1.0);
+
+  return user_load;
+}
+
+static int SCANF_ARGS(1, 2) parse_stat(_SCANFMT_ const char* fmt, ...) {
+  FILE *f;
+  va_list args;
+
+  va_start(args, fmt);
+
+  if ((f = open_statfile()) == NULL) {
+    va_end(args);
+    return OS_ERR;
+  }
+  for (;;) {
+    char line[80];
+    if (fgets(line, sizeof(line), f) != NULL) {
+      if (vsscanf(line, fmt, args) == 1) {
+        fclose(f);
+        va_end(args);
+        return OS_OK;
+      }
+    } else {
+        fclose(f);
+        va_end(args);
+        return OS_ERR;
+    }
+  }
+}
+
+static int get_noof_context_switches(uint64_t* switches) {
+  return parse_stat("ctxt " UINT64_FORMAT "\n", switches);
+}
+
+/** returns boot time in _seconds_ since epoch */
+static int get_boot_time(uint64_t* time) {
+  return parse_stat("btime " UINT64_FORMAT "\n", time);
+}
+
+static int perf_context_switch_rate(double* rate) {
+  static pthread_mutex_t contextSwitchLock = PTHREAD_MUTEX_INITIALIZER;
+  static uint64_t      lastTime;
+  static uint64_t      lastSwitches;
+  static double        lastRate;
+
+  uint64_t lt = 0;
+  int res = 0;
+
+  if (lastTime == 0) {
+    uint64_t tmp;
+    if (get_boot_time(&tmp) < 0) {
+      return OS_ERR;
+    }
+    lt = tmp * 1000;
+  }
+
+  res = OS_OK;
+
+  pthread_mutex_lock(&contextSwitchLock);
+  {
+
+    uint64_t sw;
+    s8 t, d;
+
+    if (lastTime == 0) {
+      lastTime = lt;
+    }
+
+    t = os::javaTimeMillis();
+    d = t - lastTime;
+
+    if (d == 0) {
+      *rate = lastRate;
+    } else if (!get_noof_context_switches(&sw)) {
+      *rate      = ( (double)(sw - lastSwitches) / d ) * 1000;
+      lastRate     = *rate;
+      lastSwitches = sw;
+      lastTime     = t;
+    } else {
+      *rate = 0;
+      res   = OS_ERR;
+    }
+    if (*rate <= 0) {
+      *rate = 0;
+      lastRate = 0;
+    }
+  }
+  pthread_mutex_unlock(&contextSwitchLock);
+
+  return res;
+}
+
+class CPUPerformanceInterface::CPUPerformance : public CHeapObj<mtInternal> {
+  friend class CPUPerformanceInterface;
+ private:
+  CPUPerfCounters _counters;
+
+  int cpu_load(int which_logical_cpu, double* cpu_load);
+  int context_switch_rate(double* rate);
+  int cpu_load_total_process(double* cpu_load);
+  int cpu_loads_process(double* pjvmUserLoad, double* pjvmKernelLoad, double* psystemTotalLoad);
+
+ public:
+  CPUPerformance();
+  bool initialize();
+  ~CPUPerformance();
+};
+
+CPUPerformanceInterface::CPUPerformance::CPUPerformance() {
+  _counters.nProcs = os::active_processor_count();
+  _counters.cpus = NULL;
+}
+
+bool CPUPerformanceInterface::CPUPerformance::initialize() {
+  size_t tick_array_size = (_counters.nProcs +1) * sizeof(CPUPerfTicks);
+  _counters.cpus = (CPUPerfTicks*)NEW_C_HEAP_ARRAY(char, tick_array_size, mtInternal);
+  if (NULL == _counters.cpus) {
+    return false;
+  }
+  memset(_counters.cpus, 0, tick_array_size);
+
+  // For the CPU load total
+  get_total_ticks(-1, &_counters.cpus[_counters.nProcs]);
+
+  // For each CPU
+  for (int i = 0; i < _counters.nProcs; i++) {
+    get_total_ticks(i, &_counters.cpus[i]);
+  }
+  // For JVM load
+  get_jvm_ticks(&_counters.jvmTicks);
+
+  // initialize context switch system
+  // the double is only for init
+  double init_ctx_switch_rate;
+  perf_context_switch_rate(&init_ctx_switch_rate);
+
+  return true;
+}
+
+CPUPerformanceInterface::CPUPerformance::~CPUPerformance() {
+  if (_counters.cpus != NULL) {
+    FREE_C_HEAP_ARRAY(char, _counters.cpus);
+  }
+}
+
+int CPUPerformanceInterface::CPUPerformance::cpu_load(int which_logical_cpu, double* cpu_load) {
+  double u, s;
+  u = get_cpu_load(which_logical_cpu, &_counters, &s, CPU_LOAD_GLOBAL);
+  if (u < 0) {
+    *cpu_load = 0.0;
+    return OS_ERR;
+  }
+  // Cap total systemload to 1.0
+  *cpu_load = MIN2<double>((u + s), 1.0);
+  return OS_OK;
+}
+
+int CPUPerformanceInterface::CPUPerformance::cpu_load_total_process(double* cpu_load) {
+  double u, s;
+  u = get_cpu_load(-1, &_counters, &s, CPU_LOAD_VM_ONLY);
+  if (u < 0) {
+    *cpu_load = 0.0;
+    return OS_ERR;
+  }
+  *cpu_load = u + s;
+  return OS_OK;
+}
+
+int CPUPerformanceInterface::CPUPerformance::cpu_loads_process(double* pjvmUserLoad, double* pjvmKernelLoad, double* psystemTotalLoad) {
+  double u, s, t;
+
+  assert(pjvmUserLoad != NULL, "pjvmUserLoad not inited");
+  assert(pjvmKernelLoad != NULL, "pjvmKernelLoad not inited");
+  assert(psystemTotalLoad != NULL, "psystemTotalLoad not inited");
+
+  u = get_cpu_load(-1, &_counters, &s, CPU_LOAD_VM_ONLY);
+  if (u < 0) {
+    *pjvmUserLoad = 0.0;
+    *pjvmKernelLoad = 0.0;
+    *psystemTotalLoad = 0.0;
+    return OS_ERR;
+  }
+
+  cpu_load(-1, &t);
+  // clamp at user+system and 1.0
+  if (u + s > t) {
+    t = MIN2<double>(u + s, 1.0);
+  }
+
+  *pjvmUserLoad = u;
+  *pjvmKernelLoad = s;
+  *psystemTotalLoad = t;
+
+  return OS_OK;
+}
+
+int CPUPerformanceInterface::CPUPerformance::context_switch_rate(double* rate) {
+  return perf_context_switch_rate(rate);
+}
+
+CPUPerformanceInterface::CPUPerformanceInterface() {
+  _impl = NULL;
+}
+
+bool CPUPerformanceInterface::initialize() {
+  _impl = new CPUPerformanceInterface::CPUPerformance();
+  return NULL == _impl ? false : _impl->initialize();
+}
+
+CPUPerformanceInterface::~CPUPerformanceInterface() {
+  if (_impl != NULL) {
+    delete _impl;
+  }
+}
+
+int CPUPerformanceInterface::cpu_load(int which_logical_cpu, double* cpu_load) const {
+  return _impl->cpu_load(which_logical_cpu, cpu_load);
+}
+
+int CPUPerformanceInterface::cpu_load_total_process(double* cpu_load) const {
+  return _impl->cpu_load_total_process(cpu_load);
+}
+
+int CPUPerformanceInterface::cpu_loads_process(double* pjvmUserLoad, double* pjvmKernelLoad, double* psystemTotalLoad) const {
+  return _impl->cpu_loads_process(pjvmUserLoad, pjvmKernelLoad, psystemTotalLoad);
+}
+
+int CPUPerformanceInterface::context_switch_rate(double* rate) const {
+  return _impl->context_switch_rate(rate);
+}
+
+class SystemProcessInterface::SystemProcesses : public CHeapObj<mtInternal> {
+  friend class SystemProcessInterface;
+ private:
+  class ProcessIterator : public CHeapObj<mtInternal> {
+    friend class SystemProcessInterface::SystemProcesses;
+   private:
+    DIR*           _dir;
+    struct dirent* _entry;
+    bool           _valid;
+    char           _exeName[PATH_MAX];
+    char           _exePath[PATH_MAX];
+
+    ProcessIterator();
+    ~ProcessIterator();
+    bool initialize();
+
+    bool is_valid() const { return _valid; }
+    bool is_valid_entry(struct dirent* entry) const;
+    bool is_dir(const char* name) const;
+    int  fsize(const char* name, uint64_t& size) const;
+
+    char* allocate_string(const char* str) const;
+    void  get_exe_name();
+    char* get_exe_path();
+    char* get_cmdline();
+
+    int current(SystemProcess* process_info);
+    int next_process();
+  };
+
+  ProcessIterator* _iterator;
+  SystemProcesses();
+  bool initialize();
+  ~SystemProcesses();
+
+  //information about system processes
+  int system_processes(SystemProcess** system_processes, int* no_of_sys_processes) const;
+};
+
+bool SystemProcessInterface::SystemProcesses::ProcessIterator::is_dir(const char* name) const {
+  struct stat mystat;
+  int ret_val = 0;
+
+  ret_val = stat(name, &mystat);
+  if (ret_val < 0) {
+    return false;
+  }
+  ret_val = S_ISDIR(mystat.st_mode);
+  return ret_val > 0;
+}
+
+int SystemProcessInterface::SystemProcesses::ProcessIterator::fsize(const char* name, uint64_t& size) const {
+  assert(name != NULL, "name pointer is NULL!");
+  size = 0;
+  struct stat fbuf;
+
+  if (stat(name, &fbuf) < 0) {
+    return OS_ERR;
+  }
+  size = fbuf.st_size;
+  return OS_OK;
+}
+
+// if it has a numeric name, is a directory and has a 'stat' file in it
+bool SystemProcessInterface::SystemProcesses::ProcessIterator::is_valid_entry(struct dirent* entry) const {
+  char buffer[PATH_MAX];
+  uint64_t size = 0;
+
+  if (atoi(entry->d_name) != 0) {
+    jio_snprintf(buffer, PATH_MAX, "/proc/%s", entry->d_name);
+    buffer[PATH_MAX - 1] = '\0';
+
+    if (is_dir(buffer)) {
+      jio_snprintf(buffer, PATH_MAX, "/proc/%s/stat", entry->d_name);
+      buffer[PATH_MAX - 1] = '\0';
+      if (fsize(buffer, size) != OS_ERR) {
+        return true;
+      }
+    }
+  }
+  return false;
+}
+
+// get exe-name from /proc/<pid>/stat
+void SystemProcessInterface::SystemProcesses::ProcessIterator::get_exe_name() {
+  FILE* fp;
+  char  buffer[PATH_MAX];
+
+  jio_snprintf(buffer, PATH_MAX, "/proc/%s/stat", _entry->d_name);
+  buffer[PATH_MAX - 1] = '\0';
+  if ((fp = fopen(buffer, "r")) != NULL) {
+    if (fgets(buffer, PATH_MAX, fp) != NULL) {
+      char* start, *end;
+      // exe-name is between the first pair of ( and )
+      start = strchr(buffer, '(');
+      if (start != NULL && start[1] != '\0') {
+        start++;
+        end = strrchr(start, ')');
+        if (end != NULL) {
+          size_t len;
+          len = MIN2<size_t>(end - start, sizeof(_exeName) - 1);
+          memcpy(_exeName, start, len);
+          _exeName[len] = '\0';
+        }
+      }
+    }
+    fclose(fp);
+  }
+}
+
+// get command line from /proc/<pid>/cmdline
+char* SystemProcessInterface::SystemProcesses::ProcessIterator::get_cmdline() {
+  FILE* fp;
+  char  buffer[PATH_MAX];
+  char* cmdline = NULL;
+
+  jio_snprintf(buffer, PATH_MAX, "/proc/%s/cmdline", _entry->d_name);
+  buffer[PATH_MAX - 1] = '\0';
+  if ((fp = fopen(buffer, "r")) != NULL) {
+    size_t size = 0;
+    char   dummy;
+
+    // find out how long the file is (stat always returns 0)
+    while (fread(&dummy, 1, 1, fp) == 1) {
+      size++;
+    }
+    if (size > 0) {
+      cmdline = NEW_C_HEAP_ARRAY(char, size + 1, mtInternal);
+      if (cmdline != NULL) {
+        cmdline[0] = '\0';
+        if (fseek(fp, 0, SEEK_SET) == 0) {
+          if (fread(cmdline, 1, size, fp) == size) {
+            // the file has the arguments separated by '\0',
+            // so we translate '\0' to ' '
+            for (size_t i = 0; i < size; i++) {
+              if (cmdline[i] == '\0') {
+                cmdline[i] = ' ';
+              }
+            }
+            cmdline[size] = '\0';
+          }
+        }
+      }
+    }
+    fclose(fp);
+  }
+  return cmdline;
+}
+
+// get full path to exe from /proc/<pid>/exe symlink
+char* SystemProcessInterface::SystemProcesses::ProcessIterator::get_exe_path() {
+  char buffer[PATH_MAX];
+
+  jio_snprintf(buffer, PATH_MAX, "/proc/%s/exe", _entry->d_name);
+  buffer[PATH_MAX - 1] = '\0';
+  return realpath(buffer, _exePath);
+}
+
+char* SystemProcessInterface::SystemProcesses::ProcessIterator::allocate_string(const char* str) const {
+  if (str != NULL) {
+    size_t len = strlen(str);
+    char* tmp = NEW_C_HEAP_ARRAY(char, len+1, mtInternal);
+    strncpy(tmp, str, len);
+    tmp[len] = '\0';
+    return tmp;
+  }
+  return NULL;
+}
+
+int SystemProcessInterface::SystemProcesses::ProcessIterator::current(SystemProcess* process_info) {
+  if (!is_valid()) {
+    return OS_ERR;
+  }
+
+  process_info->set_pid(atoi(_entry->d_name));
+
+  get_exe_name();
+  process_info->set_name(allocate_string(_exeName));
+
+  if (get_exe_path() != NULL) {
+     process_info->set_path(allocate_string(_exePath));
+  }
+
+  char* cmdline = NULL;
+  cmdline = get_cmdline();
+  if (cmdline != NULL) {
+    process_info->set_command_line(allocate_string(cmdline));
+    FREE_C_HEAP_ARRAY(char, cmdline);
+  }
+
+  return OS_OK;
+}
+
+int SystemProcessInterface::SystemProcesses::ProcessIterator::next_process() {
+  struct dirent* entry;
+
+  if (!is_valid()) {
+    return OS_ERR;
+  }
+
+  do {
+      entry = os::readdir(_dir, _entry);
+    if (entry == NULL) {
+      // error
+      _valid = false;
+      return OS_ERR;
+    }
+    if (_entry == NULL) {
+      // reached end
+      _valid = false;
+      return OS_ERR;
+    }
+  } while(!is_valid_entry(_entry));
+
+  _valid = true;
+  return OS_OK;
+}
+
+SystemProcessInterface::SystemProcesses::ProcessIterator::ProcessIterator() {
+  _dir = NULL;
+  _entry = NULL;
+  _valid = false;
+}
+
+bool SystemProcessInterface::SystemProcesses::ProcessIterator::initialize() {
+  _dir = opendir("/proc");
+  _entry = (struct dirent*)NEW_C_HEAP_ARRAY(char, sizeof(struct dirent) + NAME_MAX + 1, mtInternal);
+  if (NULL == _entry) {
+    return false;
+  }
+  _valid = true;
+  next_process();
+
+  return true;
+}
+
+SystemProcessInterface::SystemProcesses::ProcessIterator::~ProcessIterator() {
+  if (_entry != NULL) {
+    FREE_C_HEAP_ARRAY(char, _entry);
+  }
+  if (_dir != NULL) {
+    closedir(_dir);
+  }
+}
+
+SystemProcessInterface::SystemProcesses::SystemProcesses() {
+  _iterator = NULL;
+}
+
+bool SystemProcessInterface::SystemProcesses::initialize() {
+  _iterator = new SystemProcessInterface::SystemProcesses::ProcessIterator();
+  return NULL == _iterator ? false : _iterator->initialize();
+}
+
+SystemProcessInterface::SystemProcesses::~SystemProcesses() {
+  if (_iterator != NULL) {
+    delete _iterator;
+  }
+}
+
+int SystemProcessInterface::SystemProcesses::system_processes(SystemProcess** system_processes, int* no_of_sys_processes) const {
+  assert(system_processes != NULL, "system_processes pointer is NULL!");
+  assert(no_of_sys_processes != NULL, "system_processes counter pointers is NULL!");
+  assert(_iterator != NULL, "iterator is NULL!");
+
+  // initialize pointers
+  *no_of_sys_processes = 0;
+  *system_processes = NULL;
+
+  while (_iterator->is_valid()) {
+    SystemProcess* tmp = new SystemProcess();
+    _iterator->current(tmp);
+
+    //if already existing head
+    if (*system_processes != NULL) {
+      //move "first to second"
+      tmp->set_next(*system_processes);
+    }
+    // new head
+    *system_processes = tmp;
+    // increment
+    (*no_of_sys_processes)++;
+    // step forward
+    _iterator->next_process();
+  }
+  return OS_OK;
+}
+
+int SystemProcessInterface::system_processes(SystemProcess** system_procs, int* no_of_sys_processes) const {
+  return _impl->system_processes(system_procs, no_of_sys_processes);
+}
+
+SystemProcessInterface::SystemProcessInterface() {
+  _impl = NULL;
+}
+
+bool SystemProcessInterface::initialize() {
+  _impl = new SystemProcessInterface::SystemProcesses();
+  return NULL == _impl ? false : _impl->initialize();
+}
+
+SystemProcessInterface::~SystemProcessInterface() {
+  if (_impl != NULL) {
+    delete _impl;
+  }
+}
+
+CPUInformationInterface::CPUInformationInterface() {
+  _cpu_info = NULL;
+}
+
+bool CPUInformationInterface::initialize() {
+  _cpu_info = new CPUInformation();
+  if (NULL == _cpu_info) {
+    return false;
+  }
+  _cpu_info->set_number_of_hardware_threads(VM_Version_Ext::number_of_threads());
+  _cpu_info->set_number_of_cores(VM_Version_Ext::number_of_cores());
+  _cpu_info->set_number_of_sockets(VM_Version_Ext::number_of_sockets());
+  _cpu_info->set_cpu_name(VM_Version_Ext::cpu_name());
+  _cpu_info->set_cpu_description(VM_Version_Ext::cpu_description());
+
+  return true;
+}
+
+CPUInformationInterface::~CPUInformationInterface() {
+  if (_cpu_info != NULL) {
+    if (_cpu_info->cpu_name() != NULL) {
+      const char* cpu_name = _cpu_info->cpu_name();
+      FREE_C_HEAP_ARRAY(char, cpu_name);
+      _cpu_info->set_cpu_name(NULL);
+    }
+    if (_cpu_info->cpu_description() != NULL) {
+       const char* cpu_desc = _cpu_info->cpu_description();
+       FREE_C_HEAP_ARRAY(char, cpu_desc);
+      _cpu_info->set_cpu_description(NULL);
+    }
+    delete _cpu_info;
+  }
+}
+
+int CPUInformationInterface::cpu_information(CPUInformation& cpu_info) {
+  if (_cpu_info == NULL) {
+    return OS_ERR;
+  }
+
+  cpu_info = *_cpu_info; // shallow copy assignment
+  return OS_OK;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/hotspot/os/solaris/os_perf_solaris.cpp	Tue May 15 20:24:34 2018 +0200
@@ -0,0 +1,756 @@
+/*
+ * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+#include "precompiled.hpp"
+#include "jvm.h"
+#include "memory/allocation.inline.hpp"
+#include "runtime/os.hpp"
+#include "runtime/os_perf.hpp"
+#include "os_solaris.inline.hpp"
+#include "utilities/macros.hpp"
+
+#include CPU_HEADER(vm_version_ext)
+
+#include <sys/types.h>
+#include <procfs.h>
+#include <dirent.h>
+#include <errno.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <strings.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <kstat.h>
+#include <unistd.h>
+#include <string.h>
+#include <sys/sysinfo.h>
+#include <sys/lwp.h>
+#include <pthread.h>
+#include <time.h>
+#include <utmpx.h>
+#include <dlfcn.h>
+#include <sys/loadavg.h>
+#include <limits.h>
+
+static const double NANOS_PER_SEC = 1000000000.0;
+
+struct CPUPerfTicks {
+  kstat_t* kstat;
+  uint64_t last_idle;
+  uint64_t last_total;
+  double   last_ratio;
+};
+
+struct CPUPerfCounters {
+  int           nProcs;
+  CPUPerfTicks* jvmTicks;
+  kstat_ctl_t*  kstat_ctrl;
+};
+
+static int get_info(const char* path, void* info, size_t s, off_t o) {
+  assert(path != NULL, "path is NULL!");
+  assert(info != NULL, "info is NULL!");
+
+  int fd = -1;
+
+  if ((fd = open(path, O_RDONLY)) < 0) {
+    return OS_ERR;
+  }
+  if (pread(fd, info, s, o) != s) {
+    close(fd);
+    return OS_ERR;
+  }
+  close(fd);
+  return OS_OK;
+}
+
+static int get_psinfo2(void* info, size_t s, off_t o) {
+  return get_info("/proc/self/psinfo", info, s, o);
+}
+
+static int get_psinfo(psinfo_t* info) {
+  return get_psinfo2(info, sizeof(*info), 0);
+}
+
+static int get_psinfo(char* file, psinfo_t* info) {
+  assert(file != NULL, "file is NULL!");
+  assert(info != NULL, "info is NULL!");
+  return get_info(file, info, sizeof(*info), 0);
+}
+
+
+static int get_usage(prusage_t* usage) {
+  assert(usage != NULL, "usage is NULL!");
+  return get_info("/proc/self/usage", usage, sizeof(*usage), 0);
+}
+
+static int read_cpustat(kstat_ctl_t* kstat_ctrl, CPUPerfTicks* load, cpu_stat_t* cpu_stat) {
+  assert(kstat_ctrl != NULL, "kstat_ctrl pointer is NULL!");
+  assert(load != NULL, "load pointer is NULL!");
+  assert(cpu_stat != NULL, "cpu_stat pointer is NULL!");
+
+  if (load->kstat == NULL) {
+    // no handle.
+    return OS_ERR;
+  }
+  if (kstat_read(kstat_ctrl, load->kstat, cpu_stat) == OS_ERR) {
+    // disable handle for this CPU
+     load->kstat = NULL;
+     return OS_ERR;
+  }
+  return OS_OK;
+}
+
+static double get_cpu_load(int which_logical_cpu, CPUPerfCounters* counters) {
+  assert(counters != NULL, "counters pointer is NULL!");
+
+  cpu_stat_t  cpu_stat = {0};
+
+  if (which_logical_cpu >= counters->nProcs) {
+    return .0;
+  }
+
+  CPUPerfTicks load = counters->jvmTicks[which_logical_cpu];
+  if (read_cpustat(counters->kstat_ctrl, &load, &cpu_stat) != OS_OK) {
+    return .0;
+  }
+
+  uint_t* usage = cpu_stat.cpu_sysinfo.cpu;
+  if (usage == NULL) {
+    return .0;
+  }
+
+  uint64_t c_idle  = usage[CPU_IDLE];
+  uint64_t c_total = 0;
+
+  for (int i = 0; i < CPU_STATES; i++) {
+    c_total += usage[i];
+  }
+
+  // Calculate diff against previous snapshot
+  uint64_t d_idle  = c_idle - load.last_idle;
+  uint64_t d_total = c_total - load.last_total;
+
+  /** update if weve moved */
+  if (d_total > 0) {
+    // Save current values for next time around
+    load.last_idle  = c_idle;
+    load.last_total = c_total;
+    load.last_ratio = (double) (d_total - d_idle) / d_total;
+  }
+
+  return load.last_ratio;
+}
+
+static int get_boot_time(uint64_t* time) {
+  assert(time != NULL, "time pointer is NULL!");
+  setutxent();
+  for(;;) {
+    struct utmpx* u;
+    if ((u = getutxent()) == NULL) {
+      break;
+    }
+    if (u->ut_type == BOOT_TIME) {
+      *time = u->ut_xtime;
+      endutxent();
+      return OS_OK;
+    }
+  }
+  endutxent();
+  return OS_ERR;
+}
+
+static int get_noof_context_switches(CPUPerfCounters* counters, uint64_t* switches) {
+  assert(switches != NULL, "switches pointer is NULL!");
+  assert(counters != NULL, "counter pointer is NULL!");
+  *switches = 0;
+  uint64_t s = 0;
+
+  // Collect data from all CPUs
+  for (int i = 0; i < counters->nProcs; i++) {
+    cpu_stat_t cpu_stat = {0};
+    CPUPerfTicks load = counters->jvmTicks[i];
+
+    if (read_cpustat(counters->kstat_ctrl, &load, &cpu_stat) == OS_OK) {
+      s += cpu_stat.cpu_sysinfo.pswitch;
+    } else {
+      //fail fast...
+      return OS_ERR;
+    }
+  }
+  *switches = s;
+  return OS_OK;
+}
+
+static int perf_context_switch_rate(CPUPerfCounters* counters, double* rate) {
+  assert(counters != NULL, "counters is NULL!");
+  assert(rate != NULL, "rate pointer is NULL!");
+  static pthread_mutex_t contextSwitchLock = PTHREAD_MUTEX_INITIALIZER;
+  static uint64_t lastTime = 0;
+  static uint64_t lastSwitches = 0;
+  static double   lastRate = 0.0;
+
+  uint64_t lt = 0;
+  int res = 0;
+
+  if (lastTime == 0) {
+    uint64_t tmp;
+    if (get_boot_time(&tmp) < 0) {
+      return OS_ERR;
+    }
+    lt = tmp * 1000;
+  }
+
+  res = OS_OK;
+
+  pthread_mutex_lock(&contextSwitchLock);
+  {
+
+    uint64_t sw = 0;
+    clock_t t, d;
+
+    if (lastTime == 0) {
+      lastTime = lt;
+    }
+
+    t = clock();
+    d = t - lastTime;
+
+    if (d == 0) {
+      *rate = lastRate;
+    } else if (get_noof_context_switches(counters, &sw)== OS_OK) {
+      *rate      = ((double)(sw - lastSwitches) / d) * 1000;
+      lastRate     = *rate;
+      lastSwitches = sw;
+      lastTime     = t;
+    } else {
+      *rate = 0.0;
+      res   = OS_ERR;
+    }
+    if (*rate < 0.0) {
+      *rate = 0.0;
+      lastRate = 0.0;
+    }
+  }
+  pthread_mutex_unlock(&contextSwitchLock);
+  return res;
+ }
+
+
+
+class CPUPerformanceInterface::CPUPerformance : public CHeapObj<mtInternal> {
+   friend class CPUPerformanceInterface;
+ private:
+  CPUPerfCounters _counters;
+  int cpu_load(int which_logical_cpu, double* cpu_load);
+  int context_switch_rate(double* rate);
+  int cpu_load_total_process(double* cpu_load);
+  int cpu_loads_process(double* pjvmUserLoad, double* pjvmKernelLoad, double* psystemTotalLoad);
+
+  CPUPerformance();
+  ~CPUPerformance();
+  bool initialize();
+};
+
+CPUPerformanceInterface::CPUPerformance::CPUPerformance() {
+  _counters.nProcs = 0;
+  _counters.jvmTicks = NULL;
+  _counters.kstat_ctrl = NULL;
+}
+
+bool CPUPerformanceInterface::CPUPerformance::initialize() {
+  // initialize kstat control structure,
+  _counters.kstat_ctrl = kstat_open();
+  assert(_counters.kstat_ctrl != NULL, "error initializing kstat control structure!");
+
+  if (NULL == _counters.kstat_ctrl) {
+    return false;
+  }
+
+  // Get number of CPU(s)
+  if ((_counters.nProcs = sysconf(_SC_NPROCESSORS_ONLN)) == OS_ERR) {
+    // ignore error?
+    _counters.nProcs = 1;
+  }
+
+  assert(_counters.nProcs > 0, "no CPUs detected in sysconf call!");
+  if (_counters.nProcs == 0) {
+    return false;
+  }
+
+  // Data structure(s) for saving CPU load (one per CPU)
+  size_t tick_array_size = _counters.nProcs * sizeof(CPUPerfTicks);
+  _counters.jvmTicks = (CPUPerfTicks*)NEW_C_HEAP_ARRAY(char, tick_array_size, mtInternal);
+  if (NULL == _counters.jvmTicks) {
+    return false;
+  }
+  memset(_counters.jvmTicks, 0, tick_array_size);
+
+  // Get kstat cpu_stat counters for every CPU
+  // loop over kstat to find our cpu_stat(s)
+  int i = 0;
+  for (kstat_t* kstat = _counters.kstat_ctrl->kc_chain; kstat != NULL; kstat = kstat->ks_next) {
+    if (strncmp(kstat->ks_module, "cpu_stat", 8) == 0) {
+      if (kstat_read(_counters.kstat_ctrl, kstat, NULL) == OS_ERR) {
+        continue;
+      }
+      if (i == _counters.nProcs) {
+        // more cpu_stats than reported CPUs
+        break;
+      }
+      _counters.jvmTicks[i++].kstat = kstat;
+    }
+  }
+  return true;
+}
+
+CPUPerformanceInterface::CPUPerformance::~CPUPerformance() {
+  if (_counters.jvmTicks != NULL) {
+    FREE_C_HEAP_ARRAY(char, _counters.jvmTicks);
+  }
+  if (_counters.kstat_ctrl != NULL) {
+    kstat_close(_counters.kstat_ctrl);
+  }
+}
+
+int CPUPerformanceInterface::CPUPerformance::cpu_load(int which_logical_cpu, double* cpu_load) {
+  assert(cpu_load != NULL, "cpu_load pointer is NULL!");
+  double t = .0;
+  if (-1 == which_logical_cpu) {
+    for (int i = 0; i < _counters.nProcs; i++) {
+      t += get_cpu_load(i, &_counters);
+    }
+    // Cap total systemload to 1.0
+    t = MIN2<double>((t / _counters.nProcs), 1.0);
+  } else {
+    t = MIN2<double>(get_cpu_load(which_logical_cpu, &_counters), 1.0);
+  }
+
+  *cpu_load = t;
+  return OS_OK;
+}
+
+int CPUPerformanceInterface::CPUPerformance::cpu_load_total_process(double* cpu_load) {
+  assert(cpu_load != NULL, "cpu_load pointer is NULL!");
+
+  psinfo_t info;
+
+  // Get the percentage of "recent cpu usage" from all the lwp:s in the JVM:s
+  // process. This is returned as a value between 0.0 and 1.0 multiplied by 0x8000.
+  if (get_psinfo2(&info.pr_pctcpu, sizeof(info.pr_pctcpu), offsetof(psinfo_t, pr_pctcpu)) != 0) {
+    *cpu_load = 0.0;
+    return OS_ERR;
+  }
+  *cpu_load = (double) info.pr_pctcpu / 0x8000;
+  return OS_OK;
+}
+
+int CPUPerformanceInterface::CPUPerformance::cpu_loads_process(double* pjvmUserLoad, double* pjvmKernelLoad, double* psystemTotalLoad) {
+  assert(pjvmUserLoad != NULL, "pjvmUserLoad not inited");
+  assert(pjvmKernelLoad != NULL, "pjvmKernelLoad not inited");
+  assert(psystemTotalLoad != NULL, "psystemTotalLoad not inited");
+
+  static uint64_t lastTime;
+  static uint64_t lastUser, lastKernel;
+  static double lastUserRes, lastKernelRes;
+
+  pstatus_t pss;
+  psinfo_t  info;
+
+  *pjvmKernelLoad = *pjvmUserLoad = *psystemTotalLoad = 0;
+  if (get_info("/proc/self/status", &pss.pr_utime, sizeof(timestruc_t)*2, offsetof(pstatus_t, pr_utime)) != 0) {
+    return OS_ERR;
+  }
+
+  if (get_psinfo(&info) != 0) {
+    return OS_ERR;
+  }
+
+  // get the total time in user, kernel and total time
+  // check ratios for 'lately' and multiply the 'recent load'.
+  uint64_t time   = (info.pr_time.tv_sec * NANOS_PER_SEC) + info.pr_time.tv_nsec;
+  uint64_t user   = (pss.pr_utime.tv_sec * NANOS_PER_SEC) + pss.pr_utime.tv_nsec;
+  uint64_t kernel = (pss.pr_stime.tv_sec * NANOS_PER_SEC) + pss.pr_stime.tv_nsec;
+  uint64_t diff   = time - lastTime;
+  double load     = (double) info.pr_pctcpu / 0x8000;
+
+  if (diff > 0) {
+    lastUserRes = (load * (user - lastUser)) / diff;
+    lastKernelRes = (load * (kernel - lastKernel)) / diff;
+
+    // BUG9182835 - patch for clamping these values to sane ones.
+    lastUserRes   = MIN2<double>(1, lastUserRes);
+    lastUserRes   = MAX2<double>(0, lastUserRes);
+    lastKernelRes = MIN2<double>(1, lastKernelRes);
+    lastKernelRes = MAX2<double>(0, lastKernelRes);
+  }
+
+  double t = .0;
+  cpu_load(-1, &t);
+  // clamp at user+system and 1.0
+  if (lastUserRes + lastKernelRes > t) {
+    t = MIN2<double>(lastUserRes + lastKernelRes, 1.0);
+  }
+
+  *pjvmUserLoad   = lastUserRes;
+  *pjvmKernelLoad = lastKernelRes;
+  *psystemTotalLoad = t;
+
+  lastTime   = time;
+  lastUser   = user;
+  lastKernel = kernel;
+
+  return OS_OK;
+}
+
+int CPUPerformanceInterface::CPUPerformance::context_switch_rate(double* rate) {
+  return perf_context_switch_rate(&_counters, rate);
+}
+
+CPUPerformanceInterface::CPUPerformanceInterface() {
+  _impl = NULL;
+}
+
+bool CPUPerformanceInterface::initialize() {
+  _impl = new CPUPerformanceInterface::CPUPerformance();
+  return _impl != NULL && _impl->initialize();
+}
+
+CPUPerformanceInterface::~CPUPerformanceInterface(void) {
+  if (_impl != NULL) {
+    delete _impl;
+  }
+}
+
+int CPUPerformanceInterface::cpu_load(int which_logical_cpu, double* cpu_load) const {
+  return _impl->cpu_load(which_logical_cpu, cpu_load);
+}
+
+int CPUPerformanceInterface::cpu_load_total_process(double* cpu_load) const {
+  return _impl->cpu_load_total_process(cpu_load);
+}
+
+int CPUPerformanceInterface::cpu_loads_process(double* pjvmUserLoad, double* pjvmKernelLoad, double* psystemTotalLoad) const {
+  return _impl->cpu_loads_process(pjvmUserLoad, pjvmKernelLoad, psystemTotalLoad);
+}
+
+int CPUPerformanceInterface::context_switch_rate(double* rate) const {
+  return _impl->context_switch_rate(rate);
+}
+
+class SystemProcessInterface::SystemProcesses : public CHeapObj<mtInternal> {
+  friend class SystemProcessInterface;
+ private:
+  class ProcessIterator : public CHeapObj<mtInternal> {
+    friend class SystemProcessInterface::SystemProcesses;
+   private:
+    DIR*           _dir;
+    struct dirent* _entry;
+    bool           _valid;
+
+    ProcessIterator();
+    ~ProcessIterator();
+    bool initialize();
+
+    bool is_valid() const { return _valid; }
+    bool is_valid_entry(struct dirent* const entry) const;
+    bool is_dir(const char* const name) const;
+    char* allocate_string(const char* const str) const;
+    int current(SystemProcess* const process_info);
+    int next_process();
+  };
+
+  ProcessIterator* _iterator;
+  SystemProcesses();
+  bool initialize();
+  ~SystemProcesses();
+
+  //information about system processes
+  int system_processes(SystemProcess** system_processes, int* no_of_sys_processes) const;
+};
+
+bool SystemProcessInterface::SystemProcesses::ProcessIterator::is_dir(const char* name) const {
+  struct stat64 mystat;
+  int ret_val = 0;
+
+  ret_val = ::stat64(name, &mystat);
+
+  if (ret_val < 0) {
+    return false;
+  }
+  ret_val = S_ISDIR(mystat.st_mode);
+  return ret_val > 0;
+}
+
+// if it has a numeric name, is a directory and has a 'psinfo' file in it
+bool SystemProcessInterface::SystemProcesses::ProcessIterator::is_valid_entry(struct dirent* entry) const {
+  // ignore the "." and ".." directories
+  if ((strcmp(entry->d_name, ".") == 0) ||
+      (strcmp(entry->d_name, "..") == 0)) {
+    return false;
+  }
+
+  char buffer[PATH_MAX] = {0};
+  uint64_t size = 0;
+  bool result = false;
+  FILE *fp = NULL;
+
+  if (atoi(entry->d_name) != 0) {
+    jio_snprintf(buffer, PATH_MAX, "/proc/%s", entry->d_name);
+
+    if (is_dir(buffer)) {
+      memset(buffer, 0, PATH_MAX);
+      jio_snprintf(buffer, PATH_MAX, "/proc/%s/psinfo", entry->d_name);
+      if ((fp = fopen(buffer, "r")) != NULL) {
+        int nread = 0;
+        psinfo_t psinfo_data;
+        if ((nread = fread(&psinfo_data, 1, sizeof(psinfo_t), fp)) != -1) {
+          // only considering system process owned by root
+          if (psinfo_data.pr_uid == 0) {
+            result = true;
+          }
+        }
+      }
+    }
+  }
+
+  if (fp != NULL) {
+    fclose(fp);
+  }
+
+  return result;
+}
+
+char* SystemProcessInterface::SystemProcesses::ProcessIterator::allocate_string(const char* str) const {
+  if (str != NULL) {
+    size_t len = strlen(str);
+    char* tmp = NEW_C_HEAP_ARRAY(char, len+1, mtInternal);
+    strncpy(tmp, str, len);
+    tmp[len] = '\0';
+    return tmp;
+  }
+  return NULL;
+}
+
+int SystemProcessInterface::SystemProcesses::ProcessIterator::current(SystemProcess* process_info) {
+  if (!is_valid()) {
+    return OS_ERR;
+  }
+
+  char psinfo_path[PATH_MAX] = {0};
+  jio_snprintf(psinfo_path, PATH_MAX, "/proc/%s/psinfo", _entry->d_name);
+
+  FILE *fp = NULL;
+  if ((fp = fopen(psinfo_path, "r")) == NULL) {
+    return OS_ERR;
+  }
+
+  int nread = 0;
+  psinfo_t psinfo_data;
+  if ((nread = fread(&psinfo_data, 1, sizeof(psinfo_t), fp)) == -1) {
+    fclose(fp);
+    return OS_ERR;
+  }
+
+  char *exe_path = NULL;
+  if ((psinfo_data.pr_fname != NULL) &&
+      (psinfo_data.pr_psargs != NULL)) {
+    char *path_substring = strstr(psinfo_data.pr_psargs, psinfo_data.pr_fname);
+    if (path_substring != NULL) {
+      int len = path_substring - psinfo_data.pr_psargs;
+      exe_path = NEW_C_HEAP_ARRAY(char, len+1, mtInternal);
+      if (exe_path != NULL) {
+        jio_snprintf(exe_path, len, "%s", psinfo_data.pr_psargs);
+        exe_path[len] = '\0';
+      }
+    }
+  }
+
+  process_info->set_pid(atoi(_entry->d_name));
+  process_info->set_name(allocate_string(psinfo_data.pr_fname));
+  process_info->set_path(allocate_string(exe_path));
+  process_info->set_command_line(allocate_string(psinfo_data.pr_psargs));
+
+  if (exe_path != NULL) {
+    FREE_C_HEAP_ARRAY(char, exe_path);
+  }
+
+  if (fp != NULL) {
+    fclose(fp);
+  }
+
+  return OS_OK;
+}
+
+int SystemProcessInterface::SystemProcesses::ProcessIterator::next_process() {
+  struct dirent* entry;
+
+  if (!is_valid()) {
+    return OS_ERR;
+  }
+
+  do {
+    if ((entry = os::readdir(_dir, _entry)) == NULL) {
+      // error
+      _valid = false;
+      return OS_ERR;
+    }
+  } while(!is_valid_entry(_entry));
+
+  _valid = true;
+  return OS_OK;
+}
+
+SystemProcessInterface::SystemProcesses::ProcessIterator::ProcessIterator() {
+  _dir = NULL;
+  _entry = NULL;
+  _valid = false;
+}
+
+bool SystemProcessInterface::SystemProcesses::ProcessIterator::initialize() {
+  _dir = opendir("/proc");
+  _entry = (struct dirent*)NEW_C_HEAP_ARRAY(char, sizeof(struct dirent) + _PC_NAME_MAX + 1, mtInternal);
+  if (NULL == _entry) {
+    return false;
+  }
+  _valid = true;
+  next_process();
+
+  return true;
+}
+
+SystemProcessInterface::SystemProcesses::ProcessIterator::~ProcessIterator() {
+  if (_entry != NULL) {
+    FREE_C_HEAP_ARRAY(char, _entry);
+  }
+
+  if (_dir != NULL) {
+    closedir(_dir);
+  }
+}
+
+SystemProcessInterface::SystemProcesses::SystemProcesses() {
+  _iterator = NULL;
+}
+
+bool SystemProcessInterface::SystemProcesses::initialize() {
+  _iterator = new SystemProcessInterface::SystemProcesses::ProcessIterator();
+  return _iterator != NULL && _iterator->initialize();
+}
+
+SystemProcessInterface::SystemProcesses::~SystemProcesses() {
+  if (_iterator != NULL) {
+    delete _iterator;
+  }
+}
+
+int SystemProcessInterface::SystemProcesses::system_processes(SystemProcess** system_processes, int* no_of_sys_processes) const {
+  assert(system_processes != NULL, "system_processes pointer is NULL!");
+  assert(no_of_sys_processes != NULL, "system_processes counter pointer is NULL!");
+  assert(_iterator != NULL, "iterator is NULL!");
+
+  // initialize pointers
+  *no_of_sys_processes = 0;
+  *system_processes = NULL;
+
+  while (_iterator->is_valid()) {
+    SystemProcess* tmp = new SystemProcess();
+    _iterator->current(tmp);
+
+    //if already existing head
+    if (*system_processes != NULL) {
+      //move "first to second"
+      tmp->set_next(*system_processes);
+    }
+    // new head
+    *system_processes = tmp;
+    // increment
+    (*no_of_sys_processes)++;
+    // step forward
+    _iterator->next_process();
+  }
+  return OS_OK;
+}
+
+int SystemProcessInterface::system_processes(SystemProcess** system_procs, int* no_of_sys_processes) const {
+  return _impl->system_processes(system_procs, no_of_sys_processes);
+}
+
+SystemProcessInterface::SystemProcessInterface() {
+  _impl = NULL;
+}
+
+bool SystemProcessInterface::initialize() {
+  _impl = new SystemProcessInterface::SystemProcesses();
+  return _impl != NULL && _impl->initialize();
+
+}
+
+SystemProcessInterface::~SystemProcessInterface() {
+  if (_impl != NULL) {
+    delete _impl;
+  }
+}
+
+CPUInformationInterface::CPUInformationInterface() {
+  _cpu_info = NULL;
+}
+
+bool CPUInformationInterface::initialize() {
+  _cpu_info = new CPUInformation();
+  if (_cpu_info == NULL) {
+    return false;
+  }
+  _cpu_info->set_number_of_hardware_threads(VM_Version_Ext::number_of_threads());
+  _cpu_info->set_number_of_cores(VM_Version_Ext::number_of_cores());
+  _cpu_info->set_number_of_sockets(VM_Version_Ext::number_of_sockets());
+  _cpu_info->set_cpu_name(VM_Version_Ext::cpu_name());
+  _cpu_info->set_cpu_description(VM_Version_Ext::cpu_description());
+  return true;
+}
+
+CPUInformationInterface::~CPUInformationInterface() {
+  if (_cpu_info != NULL) {
+    if (_cpu_info->cpu_name() != NULL) {
+      const char* cpu_name = _cpu_info->cpu_name();
+      FREE_C_HEAP_ARRAY(char, cpu_name);
+      _cpu_info->set_cpu_name(NULL);
+    }
+    if (_cpu_info->cpu_description() != NULL) {
+      const char* cpu_desc = _cpu_info->cpu_description();
+      FREE_C_HEAP_ARRAY(char, cpu_desc);
+      _cpu_info->set_cpu_description(NULL);
+    }
+    delete _cpu_info;
+  }
+}
+
+int CPUInformationInterface::cpu_information(CPUInformation& cpu_info) {
+  if (_cpu_info == NULL) {
+    return OS_ERR;
+  }
+
+  cpu_info = *_cpu_info; // shallow copy assignment
+  return OS_OK;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/hotspot/os/windows/os_perf_windows.cpp	Tue May 15 20:24:34 2018 +0200
@@ -0,0 +1,1332 @@
+/*
+ * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+#include "precompiled.hpp"
+#include "logging/log.hpp"
+#include "memory/allocation.inline.hpp"
+#include "memory/resourceArea.hpp"
+#include "pdh_interface.hpp"
+#include "runtime/os_perf.hpp"
+#include "runtime/os.hpp"
+#include "vm_version_ext_x86.hpp"
+#include "utilities/macros.hpp"
+#include <math.h>
+#include <psapi.h>
+#include <TlHelp32.h>
+
+/*
+ * Windows provides a vast plethora of performance objects and counters,
+ * consumption of which is assisted using the Performance Data Helper (PDH) interface.
+ * We import a selected few api entry points from PDH, see pdh_interface.hpp.
+ *
+ * The code located in this file is to a large extent an abstraction over much of the
+ * plumbing needed to start consuming an object and/or counter of choice.
+ *
+ */
+
+ /*
+ * How to use:
+ * 1. Create query
+ * 2. Add counters to the query
+ * 3. Collect the performance data using the query
+ * 4. Display the performance data using the counters associated with the query
+ * 5. Destroy query (counter destruction implied)
+ */
+
+/*
+ * Every PDH artifact, like processor, process, thread, memory, and so forth are
+ * identified with an index that is always the same irrespective
+ * of the localized version of the operating system or service pack installed.
+ * INFO: Using PDH APIs Correctly in a Localized Language (Q287159)
+ *   http://support.microsoft.com/default.aspx?scid=kb;EN-US;q287159
+ *
+ * To find the correct index for an object or counter, inspect the registry key / value:
+ * [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Perflib\009\Counter]
+ *
+ * some common PDH indexes
+ */
+static const DWORD PDH_PROCESSOR_IDX = 238;
+static const DWORD PDH_PROCESSOR_TIME_IDX = 6;
+static const DWORD PDH_PRIV_PROCESSOR_TIME_IDX = 144;
+static const DWORD PDH_PROCESS_IDX = 230;
+static const DWORD PDH_ID_PROCESS_IDX = 784;
+static const DWORD PDH_CONTEXT_SWITCH_RATE_IDX = 146;
+static const DWORD PDH_SYSTEM_IDX = 2;
+
+/* useful pdh fmt's */
+static const char* const OBJECT_COUNTER_FMT = "\\%s\\%s";
+static const size_t OBJECT_COUNTER_FMT_LEN = 2;
+static const char* const OBJECT_WITH_INSTANCES_COUNTER_FMT = "\\%s(%s)\\%s";
+static const size_t OBJECT_WITH_INSTANCES_COUNTER_FMT_LEN = 4;
+static const char* const PROCESS_OBJECT_INSTANCE_COUNTER_FMT = "\\%s(%s#%s)\\%s";
+static const size_t PROCESS_OBJECT_INSTANCE_COUNTER_FMT_LEN = 5;
+
+static const char* process_image_name = NULL; // for example, "java" but could have another image name
+static char* pdh_IDProcess_counter_fmt = NULL;   // "\Process(java#%d)\ID Process" */
+
+// Need to limit how often we update a query to minimize the heisenberg effect.
+// (PDH behaves erratically if the counters are queried too often, especially counters that
+// store and use values from two consecutive updates, like cpu load.)
+static const int min_update_interval_millis = 500;
+
+/*
+* Structs for PDH queries.
+*/
+typedef struct {
+  HQUERY query;
+  s8     lastUpdate; // Last time query was updated (current millis).
+} UpdateQueryS, *UpdateQueryP;
+
+
+typedef struct {
+  UpdateQueryS query;
+  HCOUNTER     counter;
+  bool         initialized;
+} CounterQueryS, *CounterQueryP;
+
+typedef struct {
+  UpdateQueryS query;
+  HCOUNTER*    counters;
+  int          noOfCounters;
+  bool         initialized;
+} MultiCounterQueryS, *MultiCounterQueryP;
+
+typedef struct {
+  MultiCounterQueryP queries;
+  int                size;
+  bool               initialized;
+} MultiCounterQuerySetS, *MultiCounterQuerySetP;
+
+static void pdh_cleanup(HQUERY* const query, HCOUNTER* const counter) {
+  if (counter != NULL && *counter != NULL) {
+    PdhDll::PdhRemoveCounter(*counter);
+    *counter = NULL;
+  }
+  if (query != NULL && *query != NULL) {
+    PdhDll::PdhCloseQuery(*query);
+    *query = NULL;
+  }
+}
+
+static CounterQueryP create_counter_query() {
+  CounterQueryP const query = NEW_C_HEAP_ARRAY(CounterQueryS, 1, mtInternal);
+  memset(query, 0, sizeof(CounterQueryS));
+  return query;
+}
+
+static void destroy_counter_query(CounterQueryP query) {
+  assert(query != NULL, "invariant");
+  pdh_cleanup(&query->query.query, &query->counter);
+  FREE_C_HEAP_ARRAY(CounterQueryS, query);
+}
+
+static MultiCounterQueryP create_multi_counter_query() {
+  MultiCounterQueryP const query = NEW_C_HEAP_ARRAY(MultiCounterQueryS, 1, mtInternal);
+  memset(query, 0, sizeof(MultiCounterQueryS));
+  return query;
+}
+
+static void destroy_counter_query(MultiCounterQueryP counter_query) {
+  if (counter_query != NULL) {
+    for (int i = 0; i < counter_query->noOfCounters; ++i) {
+      pdh_cleanup(NULL, &counter_query->counters[i]);
+    }
+    FREE_C_HEAP_ARRAY(char, counter_query->counters);
+    pdh_cleanup(&counter_query->query.query, NULL);
+    FREE_C_HEAP_ARRAY(MultiCounterQueryS, counter_query);
+  }
+}
+
+static void destroy_counter_query(MultiCounterQuerySetP counter_query_set) {
+  for (int i = 0; i < counter_query_set->size; i++) {
+    for (int j = 0; j < counter_query_set->queries[i].noOfCounters; ++j) {
+      pdh_cleanup(NULL, &counter_query_set->queries[i].counters[j]);
+    }
+    FREE_C_HEAP_ARRAY(char, counter_query_set->queries[i].counters);
+    pdh_cleanup(&counter_query_set->queries[i].query.query, NULL);
+  }
+  FREE_C_HEAP_ARRAY(MultiCounterQueryS, counter_query_set->queries);
+  FREE_C_HEAP_ARRAY(MultiCounterQuerySetS, counter_query_set);
+}
+
+static int open_query(HQUERY* query) {
+  return PdhDll::PdhOpenQuery(NULL, 0, query);
+}
+
+template <typename QueryP>
+static int open_query(QueryP query) {
+  return open_query(&query->query);
+}
+
+static int allocate_counters(MultiCounterQueryP query, size_t nofCounters) {
+  assert(query != NULL, "invariant");
+  assert(!query->initialized, "invariant");
+  assert(0 == query->noOfCounters, "invariant");
+  assert(query->counters == NULL, "invariant");
+  query->counters = (HCOUNTER*)NEW_C_HEAP_ARRAY(char, nofCounters * sizeof(HCOUNTER), mtInternal);
+  if (query->counters == NULL) {
+    return OS_ERR;
+  }
+  memset(query->counters, 0, nofCounters * sizeof(HCOUNTER));
+  query->noOfCounters = (int)nofCounters;
+  return OS_OK;
+}
+
+static int allocate_counters(MultiCounterQuerySetP query_set, size_t nofCounters) {
+  assert(query_set != NULL, "invariant");
+  assert(!query_set->initialized, "invariant");
+  for (int i = 0; i < query_set->size; ++i) {
+    if (allocate_counters(&query_set->queries[i], nofCounters) != OS_OK) {
+      return OS_ERR;
+    }
+  }
+  return OS_OK;
+}
+
+static void deallocate_counters(MultiCounterQueryP query) {
+  if (query->counters != NULL) {
+    FREE_C_HEAP_ARRAY(char, query->counters);
+    query->counters = NULL;
+    query->noOfCounters = 0;
+  }
+}
+
+static OSReturn add_counter(UpdateQueryP query, HCOUNTER* counter, const char* path, bool first_sample_on_init) {
+  assert(query != NULL, "invariant");
+  assert(counter != NULL, "invariant");
+  assert(path != NULL, "invariant");
+  if (query->query == NULL) {
+    if (open_query(query) != ERROR_SUCCESS) {
+      return OS_ERR;
+    }
+  }
+  assert(query->query != NULL, "invariant");
+  PDH_STATUS status = PdhDll::PdhAddCounter(query->query, path, 0, counter);
+  if (PDH_CSTATUS_NO_OBJECT == status || PDH_CSTATUS_NO_COUNTER == status) {
+    return OS_ERR;
+  }
+  /*
+  * According to the MSDN documentation, rate counters must be read twice:
+  *
+  * "Obtaining the value of rate counters such as Page faults/sec requires that
+  *  PdhCollectQueryData be called twice, with a specific time interval between
+  *  the two calls, before calling PdhGetFormattedCounterValue. Call Sleep to
+  *  implement the waiting period between the two calls to PdhCollectQueryData."
+  *
+  *  Take the first sample here already to allow for the next "real" sample
+  *  to succeed.
+  */
+  if (first_sample_on_init) {
+    PdhDll::PdhCollectQueryData(query->query);
+  }
+  return OS_OK;
+}
+
+template <typename QueryP>
+static OSReturn add_counter(QueryP counter_query, HCOUNTER* counter, const char* path, bool first_sample_on_init) {
+  assert(counter_query != NULL, "invariant");
+  assert(counter != NULL, "invariant");
+  assert(path != NULL, "invariant");
+  return add_counter(&counter_query->query, counter, path, first_sample_on_init);
+}
+
+static OSReturn add_counter(CounterQueryP counter_query, const char* path, bool first_sample_on_init) {
+  if (add_counter(counter_query, &counter_query->counter, path, first_sample_on_init) != OS_OK) {
+    // performance counter might be disabled in the registry
+    return OS_ERR;
+  }
+  counter_query->initialized = true;
+  return OS_OK;
+}
+
+static OSReturn add_process_counter(MultiCounterQueryP query, int slot_index, const char* path, bool first_sample_on_init) {
+  assert(query != NULL, "invariant");
+  assert(query != NULL, "invariant");
+  assert(slot_index < query->noOfCounters, "invariant");
+  assert(query->counters[slot_index] == NULL, "invariant");
+  const OSReturn ret = add_counter(query, &query->counters[slot_index], path, first_sample_on_init);
+  if (OS_OK == ret) {
+    if (slot_index + 1 == query->noOfCounters) {
+      query->initialized = true;
+    }
+  }
+  return ret;
+}
+
+static int collect_query_data(UpdateQueryP update_query) {
+  assert(update_query != NULL, "invariant");
+  const s8 now = os::javaTimeMillis();
+  if (now - update_query->lastUpdate > min_update_interval_millis) {
+    if (PdhDll::PdhCollectQueryData(update_query->query) != ERROR_SUCCESS) {
+      return OS_ERR;
+    }
+    update_query->lastUpdate = now;
+  }
+  return OS_OK;
+}
+
+template <typename Query>
+static int collect_query_data(Query* counter_query) {
+  assert(counter_query != NULL, "invariant");
+  return collect_query_data(&counter_query->query);
+}
+
+static int formatted_counter_value(HCOUNTER counter, DWORD format, PDH_FMT_COUNTERVALUE* const value) {
+  assert(value != NULL, "invariant");
+  if (PdhDll::PdhGetFormattedCounterValue(counter, format, NULL, value) != ERROR_SUCCESS) {
+    return OS_ERR;
+  }
+  return OS_OK;
+}
+
+/*
+* Working against the Process object and it's related counters is inherently problematic
+* when using the PDH API:
+*
+* Using PDH, a process is not primarily identified by the process id,
+* but with a sequential number, for example \Process(java#0), \Process(java#1), ...
+* The really bad part is that this list is reset as soon as a process exits:
+* If \Process(java#1) exits, \Process(java#3) now becomes \Process(java#2) etc.
+*
+* The PDH api requires a process identifier to be submitted when registering
+* a query, but as soon as the list resets, the query is invalidated (since the name changed).
+*
+* Solution:
+* The #number identifier for a Process query can only decrease after process creation.
+*
+* We therefore create an array of counter queries for all process object instances
+* up to and inc