| Modifier and Type | Field and Description |
|---|---|
| public static final Object | |
| private static final JVM | |
| private static volatile boolean | |
| pack-priv static final long |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public static native void | |
| public static native boolean | Returns: true, if the string was successfully added.identifier associated with the string, not negative id, String string constant to be added, not null s)Adds a string to the string constant pool. |
| public static native void | beginRecording()
Begin recording events
Requires that JFR has been started with |
| public static native long | Returns: the next startPositionCommits an event to the underlying buffer by setting the nextPosition. |
| public static native long | |
| pack-priv static native boolean | createJFR(boolean
simulate a initialization failure and rollback in
native, used for testing purposes simulateFailure)Set up native resources, data structures, threads etc. for JFR |
| pack-priv static native boolean | |
| public static native long[] | Returns: the unloaded IDs, or null if no unloading has occurred.Returns IDs for method-traced classes that have been unloaded. |
| public static native void | emitDataLoss(long
number of bytes that were lost bytes)Emit a jdk.DataLoss event for the specified amount of bytes. |
| public static native boolean | Returns: true if the event was committedtype id eventTypeId, long commit time for event timestamp, long when it is being done periodicType)PeriodicType.Emits native periodic event. |
| public static native void | emitOldObjectSamples(long
the cutoff in ticks cutoff, boolean emit all samples in old object queue emitAll, boolean don't use BFS when searching for path to GC root skipBFS)Emit old object sample events. |
| public static native void | endRecording()
End recording events, which includes flushing data in thread buffers
Requires that JFR has been started with |
| public static native void | |
| public static native void | flush(EventWriter writer, int uncommittedSize, int requestedSize)
Flushes the EventWriter for this thread. |
| public static native void | |
| public static native List | Returns: list of event classes.Return a list of all classes deriving from |
| public static native boolean | Returns: if transform is allowedIf the JVM supports JVM TI and retransformation has not been disabled this method will return true. |
| public static native long | Returns: start time of the recording in nanos, -1 in case of in-memoryGet the start time in nanos from the header of the current chunk |
| public static native long | Returns: a unique class identifierclazz clazz)Return a unique identifier for a class. |
| public static native Object | Returns: the configuration, may benullthe class, not eventClass)nullRetrieves the EventConfiguration for an event class. |
| public static native String | |
| public static native EventWriter | Returns: thread local EventWriterFast path fetching the EventWriter using VM intrinsics |
| public static native String | |
| public static native long | Returns: a unique stack trace identifiernumber of frames to skip, or 0 if no frames should be
skipped skipCount, long stackFilerId)Return unique identifier for stack trace. |
| public static native long | |
| public static native long | |
| public static native double | |
| public static native long | |
| public static native long | |
| public static native long | Returns: number of unloaded event classes.Return a count of the number of unloaded classes deriving from |
| public static native long | hostMemoryUsage()
Returns the amount of memory used in the host system whether or not this JVM runs in a container. |
| public static native long | hostTotalMemory()
Returns the total amount of memory of the host system whether or not this JVM runs in a container. |
| public static native long | hostTotalSwapMemory()
Returns the total amount of swap memory of the host system whether or not this JVM runs in a container. |
| public static native void | |
| public static native boolean | |
| public static native boolean | |
| public static native boolean | Returns: is thread currently excludedTest if a thread is currently excluded from the jfr system. |
| public static native boolean | Returns: is class excludedthe class, not eventClass)nullTest if a class is excluded from the jfr system. |
| public static native boolean | Returns: is class instrumentedthe class, not eventClass)nullTest if a class is instrumented. |
| public static native boolean | Returns: true if this is a product build, false otherwise.Returns whether the current build is a product build. |
| public static native boolean | |
| public static native void | |
| public static native void | |
| public static native void | markChunkFinal()
Marks current chunk as final This allows streaming clients to read the chunk header and close the stream when no more data will be written into the current repository. |
| public static native long | |
| public static native EventWriter | |
| private static native void | |
| public static native long | Returns: an ID that can be used to unregister the start frames, or -1 if it could not be registeredRegisters stack filters that should be used with getStackTrace(int, long) Method name at an array index is for class at the same array index. |
| public static synchronized native void | retransformClasses(Class<?>[] classes)
Call to invoke event tagging and retransformation of the passed classes |
| public static native void | setCompressedIntegers(boolean
true if compressed integers should be used, false
otherwise. compressed)Turn on/off compressed integers. |
| public static native boolean | Returns: if the field could be setthe class, not eventClass, EventConfiguration nullthe configuration, may be configuration)nullStores an EventConfiguration to the configuration field of an event class. |
| public static native void | setCPUPeriod(long
the new fixed period in nanoseconds periodNanos)Set the fixed CPU time sampler period. |
| public static native void | setCPURate(double
the new rate in events per second rate)Set the maximum event emission rate for the CPU time sampler
Use |
| public static native boolean | Returns: true, if it could be setthe id of the event type eventTypeId, long cutoff in ticks, cutoffTicks)Sets cutoff for event. |
| public static native void | |
| public static native void | |
| public static native void | setFileNotification(long
number of bytes, reset after file rotation delta)Interval at which the JVM should notify on |
| public static native void | setForceInstrumentation(boolean force)
Controls if a class deriving from jdk.jfr.Event should always be instrumented on class load. |
| public static native void | |
| public static native void | |
| public static native void | |
| public static native void | setMethodSamplingPeriod(long type, long
the sampling period periodMillis)Set period for method samples, in milliseconds. |
| public static native long[] | Returns: the published IDs, or null if no classes has been published.Sets method tracing filters. |
| public static native void | setMiscellaneous(long
the id of the event type eventTypeId, long value)Sets bits used for event settings, like cutoff(ticks) and level |
| public static native void | |
| public static native void | |
| public static native void | |
| public static native void | setStackTraceEnabled(long
the event id eventTypeId, boolean if stack traces should be enabled enabled)Turn on stack trace for an event |
| public static native void | |
| public static native boolean | Returns: true, if it could be setthe id of the event type eventTypeId, long threshold in ticks, ticks)Set threshold for event, Long.MAXIMUM_VALUE = no limit |
| public static native boolean | Returns: true, if it could be setthe id of the event type eventTypeId, long event sample size eventSampleSize, long time period in milliseconds period_ms)Sets the event emission rate in event sample size per time unit. |
| public static native boolean | Returns: if it is time to perform a chunk rotationTest if a chunk rotation is warranted. |
| public static native void | storeMetadataDescriptor(byte[]
binary representation of metadata descriptor bytes)Store the metadata descriptor that is to be written at the end of a
chunk, data should be written after GMT offset and size of metadata event
should be adjusted
Requires that JFR has been started with |
| public static native void | subscribeLogLevel(LogTag
the log tag to subscribe lt, int the tagset id tagSetId)Subscribe to LogLevel updates for LogTag |
| public static native boolean | Returns: true if the epoch was updated by the current thread.A root)java. instance root, not nullThe tryUpdateEpoch() method(s) takes a state object as an argument and returns true if the epoch was exclusively updated by the current thread. |
| public static native void | |
| public static native void | unregisterStackFilter(long
the stack filter ID to unregister stackFilterId)Unregisters a set of stack filters. |
| CHUNK_ROTATION_MONITOR | back to summary |
|---|---|
| public static final Object CHUNK_ROTATION_MONITOR | |
| jvm | back to summary |
|---|---|
| private static final JVM jvm | |
| nativeOK | back to summary |
|---|---|
| private static volatile boolean nativeOK | |
| RESERVED_CLASS_ID_LIMIT | back to summary |
|---|---|
| pack-priv static final long RESERVED_CLASS_ID_LIMIT | |
| JVM | back to summary |
|---|---|
| public JVM() | |
| abort | back to summary |
|---|---|
| public static native void abort(String errorMsg) Access to VM termination support.
| |
| addStringConstant | back to summary |
|---|---|
| public static native boolean addStringConstant(long id, String s) Adds a string to the string constant pool. If the same string is added twice, two entries will be created.
| |
| beginRecording | back to summary |
|---|---|
| public static native void beginRecording() Begin recording events
Requires that JFR has been started with | |
| commit | back to summary |
|---|---|
| public static native long commit(long nextPosition) Commits an event to the underlying buffer by setting the nextPosition.
| |
| counterTime | back to summary |
|---|---|
| public static native long counterTime() Return ticks
| |
| createJFR | back to summary |
|---|---|
| pack-priv static native boolean createJFR(boolean simulateFailure) throws IllegalStateException Set up native resources, data structures, threads etc. for JFR
| |
| destroyJFR | back to summary |
|---|---|
| pack-priv static native boolean destroyJFR() Destroys native part of JFR. If already destroy, call is ignored.
Requires that JFR has been started with
| |
| drainStaleMethodTracerIds | back to summary |
|---|---|
| public static native long[] drainStaleMethodTracerIds() Returns IDs for method-traced classes that have been unloaded.
| |
| emitDataLoss | back to summary |
|---|---|
| public static native void emitDataLoss(long bytes) Emit a jdk.DataLoss event for the specified amount of bytes.
| |
| emitEvent | back to summary |
|---|---|
| public static native boolean emitEvent(long eventTypeId, long timestamp, long periodicType) Emits native periodic event.
| |
| emitOldObjectSamples | back to summary |
|---|---|
| public static native void emitOldObjectSamples(long cutoff, boolean emitAll, boolean skipBFS) Emit old object sample events.
| |
| endRecording | back to summary |
|---|---|
| public static native void endRecording() End recording events, which includes flushing data in thread buffers
Requires that JFR has been started with | |
| exclude | back to summary |
|---|---|
| public static native void exclude(Thread thread) Exclude a thread from the jfr system | |
| flush | back to summary |
|---|---|
| public static native void flush(EventWriter writer, int uncommittedSize, int requestedSize) Flushes the EventWriter for this thread. | |
| flush | back to summary |
|---|---|
| public static native void flush() Flushes all thread buffers to disk and the constant pool data needed to read them. When the method returns, the chunk header should be updated with valid pointers to the metadata event, last check point event, correct file size and the generation id. | |
| getAllEventClasses | back to summary |
|---|---|
| public static native List Return a list of all classes deriving from | |
| getAllowedToDoEventRetransforms | back to summary |
|---|---|
| public static native boolean getAllowedToDoEventRetransforms() If the JVM supports JVM TI and retransformation has not been disabled this method will return true. This flag can not change during the lifetime of the JVM.
| |
| getChunkStartNanos | back to summary |
|---|---|
| public static native long getChunkStartNanos() Get the start time in nanos from the header of the current chunk
| |
| getClassId | back to summary |
|---|---|
| public static native long getClassId(Class<?> clazz) Return a unique identifier for a class. The class is marked as being "in use" in JFR.
| |
| getConfiguration | back to summary |
|---|---|
| public static native Object getConfiguration(Class<? extends Event> eventClass) Retrieves the EventConfiguration for an event class. | |
| getDumpPath | back to summary |
|---|---|
| public static native String getDumpPath() Gets the path to emergency dump.
| |
| getEventWriter | back to summary |
|---|---|
| public static native EventWriter getEventWriter() Fast path fetching the EventWriter using VM intrinsics
| |
| getPid | back to summary |
|---|---|
| public static native String getPid() Return process identifier.
| |
| getStackTraceId | back to summary |
|---|---|
| public static native long getStackTraceId(int skipCount, long stackFilerId) Return unique identifier for stack trace.
Requires that JFR has been started with
| |
| getThreadId | back to summary |
|---|---|
| public static native long getThreadId(Thread t) Return identifier for thread
| |
| getTicksFrequency | back to summary |
|---|---|
| public static native long getTicksFrequency() Frequency, ticks per second
| |
| getTimeConversionFactor | back to summary |
|---|---|
| public static native double getTimeConversionFactor() To convert ticks to wall clock time. | |
| getTypeId | back to summary |
|---|---|
| public static native long getTypeId(Class<?> clazz) Return a unique identifier for a class. Compared to
| |
| getTypeId | back to summary |
|---|---|
| public static native long getTypeId(String name) Returns the id for the Java types defined in metadata.xml.
| |
| getUnloadedEventClassCount | back to summary |
|---|---|
| public static native long getUnloadedEventClassCount() Return a count of the number of unloaded classes deriving from
| |
| hostMemoryUsage | back to summary |
|---|---|
| public static native long hostMemoryUsage() Returns the amount of memory used in the host system whether or not this JVM runs in a container. | |
| hostTotalMemory | back to summary |
|---|---|
| public static native long hostTotalMemory() Returns the total amount of memory of the host system whether or not this JVM runs in a container. | |
| hostTotalSwapMemory | back to summary |
|---|---|
| public static native long hostTotalSwapMemory() Returns the total amount of swap memory of the host system whether or not this JVM runs in a container. | |
| include | back to summary |
|---|---|
| public static native void include(Thread thread) Include a thread back into the jfr system | |
| isAvailable | back to summary |
|---|---|
| public static native boolean isAvailable() Cheap test to check if JFR functionality is available. | |
| isContainerized | back to summary |
|---|---|
| public static native boolean isContainerized() Returns
If -XX:-UseContainerSupport has been specified, this method returns | |
| isExcluded | back to summary |
|---|---|
| public static native boolean isExcluded(Thread thread) Test if a thread is currently excluded from the jfr system.
| |
| isExcluded | back to summary |
|---|---|
| public static native boolean isExcluded(Class<? extends Event> eventClass) Test if a class is excluded from the jfr system. | |
| isInstrumented | back to summary |
|---|---|
| public static native boolean isInstrumented(Class<? extends Event> eventClass) Test if a class is instrumented. | |
| isProduct | back to summary |
|---|---|
| public static native boolean isProduct() Returns whether the current build is a product build.
| |
| isRecording | back to summary |
|---|---|
| public static native boolean isRecording() Return true if the JVM is recording | |
| log | back to summary |
|---|---|
| public static native void log(int tagSetId, int level, String message) Write message to log. Should swallow null or empty message, and be able to handle any Java character and not crash with very large message
| |
| logEvent | back to summary |
|---|---|
| public static native void logEvent(int level, String[] lines, boolean system) Log an event to jfr+event or jfr+event+system. Caller should ensure that message is not null or too large to handle.
| |
| markChunkFinal | back to summary |
|---|---|
| public static native void markChunkFinal() Marks current chunk as final This allows streaming clients to read the chunk header and close the stream when no more data will be written into the current repository. | |
| nanosNow | back to summary |
|---|---|
| public static native long nanosNow() Returns the same clock that sets the start time of a chunk (in nanos). | |
| newEventWriter | back to summary |
|---|---|
| public static native EventWriter newEventWriter() Create a new EventWriter
| |
| registerNatives | back to summary |
|---|---|
| private static native void registerNatives() | |
| registerStackFilter | back to summary |
|---|---|
| public static native long registerStackFilter(String[] classes, String[] methods) Registers stack filters that should be used with getStackTrace(int, long) Method name at an array index is for class at the same array index. This method should be called holding the MetadataRepository lock and before bytecode for the associated event class has been added.
| |
| retransformClasses | back to summary |
|---|---|
| public static synchronized native void retransformClasses(Class<?>[] classes) Call to invoke event tagging and retransformation of the passed classes
| |
| setCompressedIntegers | back to summary |
|---|---|
| public static native void setCompressedIntegers(boolean compressed) throws IllegalStateException Turn on/off compressed integers.
| |
| setConfiguration | back to summary |
|---|---|
| public static native boolean setConfiguration(Class<? extends Event> eventClass, EventConfiguration configuration) Stores an EventConfiguration to the configuration field of an event class.
| |
| setCPUPeriod | back to summary |
|---|---|
| public static native void setCPUPeriod(long periodNanos) Set the fixed CPU time sampler period.
Use
| |
| setCPURate | back to summary |
|---|---|
| public static native void setCPURate(double rate) Set the maximum event emission rate for the CPU time sampler
Use
| |
| setCutoff | back to summary |
|---|---|
| public static native boolean setCutoff(long eventTypeId, long cutoffTicks) Sets cutoff for event. Determines how long the event should be allowed to run. Long.MAXIMUM_VALUE = no limit
| |
| setDumpPath | back to summary |
|---|---|
| public static native void setDumpPath(String dumpPathText) Sets the path to emergency dump. | |
| setEnabled | back to summary |
|---|---|
| public static native void setEnabled(long eventTypeId, boolean enabled) Enable event
| |
| setFileNotification | back to summary |
|---|---|
| public static native void setFileNotification(long delta) Interval at which the JVM should notify on
| |
| setForceInstrumentation | back to summary |
|---|---|
| public static native void setForceInstrumentation(boolean force) Controls if a class deriving from jdk.jfr.Event should always be instrumented on class load. | |
| setGlobalBufferCount | back to summary |
|---|---|
| public static native void setGlobalBufferCount(long count) throws IllegalArgumentException, IllegalStateException Set the number of global buffers to use
| |
| setGlobalBufferSize | back to summary |
|---|---|
| public static native void setGlobalBufferSize(long size) throws IllegalArgumentException Set size of a global buffer
| |
| setMemorySize | back to summary |
|---|---|
| public static native void setMemorySize(long size) throws IllegalArgumentException Set overall memory size
| |
| setMethodSamplingPeriod | back to summary |
|---|---|
| public static native void setMethodSamplingPeriod(long type, long periodMillis) Set period for method samples, in milliseconds. Setting period to 0 turns off the method sampler.
| |
| setMethodTraceFilters | back to summary |
|---|---|
| public static native long[] setMethodTraceFilters(String[] classes, String[] methods, String[] annotations, int[] modification) Sets method tracing filters. A filter can be a class, a method, or an annotation. For example, the following three filters:
String[] classes = new String[3]; classes[0] = "com/foo/Bar"; classes[1] = "com/foo/Bar"; classes[2] = null; String[] methods = new String[3]; methods[0] = null; methods[1] = "baz"; methods[2] = null; String[] annotations = new String[3]; annotations[0] = null; annotations[1] = null; annotations[2] = "com/foo/Foo"; int[] modifications = new int[3]; modifications[0] = 1; // filter should apply to timing modifications[1] = 2; // filter should apply to tracing modifications[2] = 1 | 2; // filter should apply to both timing and tracing JVM.setMethodTraceFilters(classes, methods, annotations, modifications);The filter will be applied to currently and future loaded classes. If a method is overloaded, the filter matches against all methods. It's not possible to match specific method parameters or annotation values. Only one type of a filter - class, method, or annotation - can be used per array index. If the filter is matched, JVMUpcalls::onMethodTrace will be invoked with the bytecode. If a filter is replaced, and method no longer requires instrumentation, the method will also be called with modification = 0;
| |
| setMiscellaneous | back to summary |
|---|---|
| public static native void setMiscellaneous(long eventTypeId, long value) Sets bits used for event settings, like cutoff(ticks) and level
| |
| setOutput | back to summary |
|---|---|
| public static native void setOutput(String file) Sets the file where data should be written.
Requires that JFR has been started with Recording Previous Current Action ============================================== true null null Ignore, keep recording in-memory true null file1 Start disk recording true file null Copy out metadata to disk and continue in-memory recording true file1 file2 Copy out metadata and start with new File (file2) false * null Ignore, but start recording to memory withrecording can be set to true/false with beginRecording()
endRecording()
| |
| setRepositoryLocation | back to summary |
|---|---|
| public static native void setRepositoryLocation(String dirText) Sets the location of the disk repository. | |
| setStackDepth | back to summary |
|---|---|
| public static native void setStackDepth(int depth) throws IllegalArgumentException, IllegalStateException Set stack depth.
| |
| setStackTraceEnabled | back to summary |
|---|---|
| public static native void setStackTraceEnabled(long eventTypeId, boolean enabled) Turn on stack trace for an event
| |
| setThreadBufferSize | back to summary |
|---|---|
| public static native void setThreadBufferSize(long size) throws IllegalArgumentException, IllegalStateException Set thread buffer size.
| |
| setThreshold | back to summary |
|---|---|
| public static native boolean setThreshold(long eventTypeId, long ticks) Set threshold for event, Long.MAXIMUM_VALUE = no limit
| |
| setThrottle | back to summary |
|---|---|
| public static native boolean setThrottle(long eventTypeId, long eventSampleSize, long period_ms) Sets the event emission rate in event sample size per time unit. Determines how events are throttled.
| |
| shouldRotateDisk | back to summary |
|---|---|
| public static native boolean shouldRotateDisk() Test if a chunk rotation is warranted.
| |
| storeMetadataDescriptor | back to summary |
|---|---|
| public static native void storeMetadataDescriptor(byte[] bytes) Store the metadata descriptor that is to be written at the end of a
chunk, data should be written after GMT offset and size of metadata event
should be adjusted
Requires that JFR has been started with
| |
| subscribeLogLevel | back to summary |
|---|---|
| public static native void subscribeLogLevel(LogTag lt, int tagSetId) Subscribe to LogLevel updates for LogTag
| |
| tryUpdateEpoch | back to summary |
|---|---|
| public static native boolean tryUpdateEpoch(Field root) The tryUpdateEpoch() method(s) takes a state object as an argument and returns true if the epoch was exclusively updated by the current thread.
| |
| uncaughtException | back to summary |
|---|---|
| public static native void uncaughtException(Thread thread, Throwable t) | |
| unregisterStackFilter | back to summary |
|---|---|
| public static native void unregisterStackFilter(long stackFilterId) Unregisters a set of stack filters. This method should be called holding the MetadataRepository lock and after the associated event class has been unloaded.
| |