src/jdk.jfr/share/classes/jdk/jfr/internal/JVM.java
changeset 58863 c16ac7a2eba4
parent 53014 339d2fbe8675
child 59226 a0f39cc47387
equal deleted inserted replaced
58861:2c3cc4b01880 58863:c16ac7a2eba4
     1 /*
     1 /*
     2  * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.  Oracle designates this
     7  * published by the Free Software Foundation.  Oracle designates this
   268      * recording can be set to true/false with {@link #beginRecording()}
   268      * recording can be set to true/false with {@link #beginRecording()}
   269      * {@link #endRecording()}
   269      * {@link #endRecording()}
   270      *
   270      *
   271      * @param file the file where data should be written, or null if it should
   271      * @param file the file where data should be written, or null if it should
   272      *        not be copied out (in memory).
   272      *        not be copied out (in memory).
   273      *
       
   274      * @throws IOException
   273      * @throws IOException
   275      */
   274      */
   276     public native void setOutput(String file);
   275     public native void setOutput(String file);
   277 
   276 
   278     /**
   277     /**
   457     /**
   456     /**
   458      * Flushes the EventWriter for this thread.
   457      * Flushes the EventWriter for this thread.
   459      */
   458      */
   460     public static native boolean flush(EventWriter writer, int uncommittedSize, int requestedSize);
   459     public static native boolean flush(EventWriter writer, int uncommittedSize, int requestedSize);
   461 
   460 
       
   461     /**
       
   462      * Flushes all thread buffers to disk and the constant pool data needed to read
       
   463      * them.
       
   464      * <p>
       
   465      * When the method returns, the chunk header should be updated with valid
       
   466      * pointers to the metadata event, last check point event, correct file size and
       
   467      * the generation id.
       
   468      *
       
   469      */
       
   470     public native void flush();
   462     /**
   471     /**
   463      * Sets the location of the disk repository, to be used at an emergency
   472      * Sets the location of the disk repository, to be used at an emergency
   464      * dump.
   473      * dump.
   465      *
   474      *
   466      * @param dirText
   475      * @param dirText
   521      * Test if a chunk rotation is warranted.
   530      * Test if a chunk rotation is warranted.
   522      *
   531      *
   523      * @return if it is time to perform a chunk rotation
   532      * @return if it is time to perform a chunk rotation
   524      */
   533      */
   525     public native boolean shouldRotateDisk();
   534     public native boolean shouldRotateDisk();
       
   535 
       
   536     /**
       
   537      * Exclude a thread from the jfr system
       
   538      *
       
   539      */
       
   540     public native void exclude(Thread thread);
       
   541 
       
   542     /**
       
   543      * Include a thread back into the jfr system
       
   544      *
       
   545      */
       
   546     public native void include(Thread thread);
       
   547 
       
   548     /**
       
   549      * Test if a thread ius currently excluded from the jfr system.
       
   550      *
       
   551      * @return is thread currently excluded
       
   552      */
       
   553     public native boolean isExcluded(Thread thread);
       
   554 
       
   555     /**
       
   556      * Get the start time in nanos from the header of the current chunk
       
   557      *
       
   558      *@return start time of the recording in nanos, -1 in case of in-memory
       
   559      */
       
   560     public native long getChunkStartNanos();
   526 }
   561 }