Add parser support for checkpoint cetagorization bits JEP-349-branch
authoregahlin
Mon, 26 Aug 2019 18:10:34 +0200
branchJEP-349-branch
changeset 57883 90e867ac8c37
parent 57882 562f598d303c
child 57886 87f8a814310d
Add parser support for checkpoint cetagorization bits
src/jdk.jfr/share/classes/jdk/jfr/consumer/ChunkParser.java
--- a/src/jdk.jfr/share/classes/jdk/jfr/consumer/ChunkParser.java	Mon Aug 26 17:59:32 2019 +0200
+++ b/src/jdk.jfr/share/classes/jdk/jfr/consumer/ChunkParser.java	Mon Aug 26 18:10:34 2019 +0200
@@ -48,6 +48,15 @@
  *
  */
 final class ChunkParser {
+    // Checkpoint that finishes a flush segment
+    static final byte CHECKPOINT_FLUSH_MASK = 1;
+    // Checkpoint contains chunk header information in the first pool
+    static final byte CHECKPOINT_CHUNK_HEADER_MASK = 2;
+    // Checkpoint contains only statics that will not change from chunk to chunk
+    static final byte CHECKPOINT_STATICS_MASK = 4;
+    // Checkpoint contains thread realted information
+    static final byte CHECKPOINT_THREADS_MASK = 8;
+
     private static final long CONSTANT_POOL_TYPE_ID = 1;
     private static final String CHUNKHEADER = "jdk.types.ChunkHeader";
     private final RecordingInput input;
@@ -204,8 +213,8 @@
         input.readLong(); // timestamp
         input.readLong(); // duration
         input.readLong(); // delta
-        boolean flush = input.readBoolean();
-        if (flush) {
+        byte c = input.readByte();
+        if ((c & CHECKPOINT_FLUSH_MASK)== 1) {
             flushOperation.run();
         }
     }