remove flushCounter JEP-349-branch
authormgronlun
Mon, 16 Sep 2019 12:47:53 +0200
branchJEP-349-branch
changeset 58165 8584c5b96cb6
parent 58164 1343c01b29d5
child 58166 105d32b27809
remove flushCounter
src/hotspot/share/jfr/jni/jfrJniMethod.cpp
src/hotspot/share/jfr/jni/jfrJniMethod.hpp
src/hotspot/share/jfr/jni/jfrJniMethodRegistration.cpp
src/jdk.jfr/share/classes/jdk/jfr/internal/JVM.java
src/jdk.jfr/share/classes/jdk/jfr/internal/MetadataRepository.java
--- a/src/hotspot/share/jfr/jni/jfrJniMethod.cpp	Mon Sep 16 11:18:50 2019 +0200
+++ b/src/hotspot/share/jfr/jni/jfrJniMethod.cpp	Mon Sep 16 12:47:53 2019 +0200
@@ -284,7 +284,7 @@
   return JfrJavaEventWriter::flush(writer, used_size, requested_size, thread);
 JVM_END
 
-JVM_ENTRY_NO_ENV(void, jfr_flush(JNIEnv* env, jobject jvm, jboolean include_metadata, jshort flush_counter))
+JVM_ENTRY_NO_ENV(void, jfr_flush(JNIEnv* env, jobject jvm, jboolean include_metadata))
   JfrRepository::flush(include_metadata == JNI_TRUE, thread);
 JVM_END
 
--- a/src/hotspot/share/jfr/jni/jfrJniMethod.hpp	Mon Sep 16 11:18:50 2019 +0200
+++ b/src/hotspot/share/jfr/jni/jfrJniMethod.hpp	Mon Sep 16 12:47:53 2019 +0200
@@ -113,7 +113,7 @@
 
 jboolean JNICALL jfr_event_writer_flush(JNIEnv* env, jclass cls, jobject writer, jint used_size, jint requested_size);
 
-void JNICALL jfr_flush(JNIEnv* env, jobject jvm, jboolean include_metadata, jshort flush_counter);
+void JNICALL jfr_flush(JNIEnv* env, jobject jvm, jboolean include_metadata);
 void JNICALL jfr_abort(JNIEnv* env, jobject jvm, jstring errorMsg);
 
 jlong JNICALL jfr_get_epoch_address(JNIEnv* env, jobject jvm);
--- a/src/hotspot/share/jfr/jni/jfrJniMethodRegistration.cpp	Mon Sep 16 11:18:50 2019 +0200
+++ b/src/hotspot/share/jfr/jni/jfrJniMethodRegistration.cpp	Mon Sep 16 12:47:53 2019 +0200
@@ -70,7 +70,7 @@
       (char*)"getEventWriter", (char*)"()Ljava/lang/Object;", (void*)jfr_get_event_writer,
       (char*)"newEventWriter", (char*)"()Ljdk/jfr/internal/EventWriter;", (void*)jfr_new_event_writer,
       (char*)"flush", (char*)"(Ljdk/jfr/internal/EventWriter;II)Z", (void*)jfr_event_writer_flush,
-      (char*)"flush", (char*)"(ZS)V", (void*)jfr_flush,
+      (char*)"flush", (char*)"(Z)V", (void*)jfr_flush,
       (char*)"setRepositoryLocation", (char*)"(Ljava/lang/String;)V", (void*)jfr_set_repository_location,
       (char*)"abort", (char*)"(Ljava/lang/String;)V", (void*)jfr_abort,
       (char*)"getEpochAddress", (char*)"()J",(void*)jfr_get_epoch_address,
--- a/src/jdk.jfr/share/classes/jdk/jfr/internal/JVM.java	Mon Sep 16 11:18:50 2019 +0200
+++ b/src/jdk.jfr/share/classes/jdk/jfr/internal/JVM.java	Mon Sep 16 12:47:53 2019 +0200
@@ -468,10 +468,8 @@
      *
      * @param includeMetadata {@code true} if metadata event should be written, {@code false}
      *        otherwise
-     * @param flushCounter the (flushCounter + 1= should be written to the chunk header, by default the
-     *        value in the chunk header should be {@code 1} and set {@code 0} once the chunk is complete.
      */
-    public native void flush(boolean includeMetadata, short flushCounter);
+    public native void flush(boolean includeMetadata);
     /**
      * Sets the location of the disk repository, to be used at an emergency
      * dump.
--- a/src/jdk.jfr/share/classes/jdk/jfr/internal/MetadataRepository.java	Mon Sep 16 11:18:50 2019 +0200
+++ b/src/jdk.jfr/share/classes/jdk/jfr/internal/MetadataRepository.java	Mon Sep 16 12:47:53 2019 +0200
@@ -62,8 +62,7 @@
     private boolean staleMetadata = true;
     private boolean unregistered;
     private long lastUnloaded = -1;
-    private boolean flushMetadata;
-    private short flushCounter = 0;
+    private boolean flushMetadata;
 
     public MetadataRepository() {
         initializeJVMEventTypes();
@@ -280,7 +279,6 @@
         if (staleMetadata) {
             storeDescriptorInJVM();
         }
-        flushCounter = 0;
     }
 
     private void unregisterUnloaded() {
@@ -320,10 +318,7 @@
     }
 
     public synchronized void flush() {
-        jvm.flush(flushMetadata || flushCounter == 0, ++flushCounter);
-        if (flushCounter == Short.MAX_VALUE) {
-            flushCounter = 0;
-        }
+        jvm.flush(flushMetadata);
         this.flushMetadata = false;
     }