src/hotspot/share/jfr/recorder/repository/jfrChunkWriter.cpp
branchJEP-349-branch
changeset 57983 a57907813a83
parent 57887 a9cc3698a55c
child 58068 22dab580786c
equal deleted inserted replaced
57971:aa7b1ea52413 57983:a57907813a83
   170   }
   170   }
   171 };
   171 };
   172 
   172 
   173 static void write_checkpoint_header(JfrChunkWriter& cw, int64_t event_offset, bool flushpoint) {
   173 static void write_checkpoint_header(JfrChunkWriter& cw, int64_t event_offset, bool flushpoint) {
   174   const int64_t delta = cw.last_checkpoint_offset() == 0 ? 0 : cw.last_checkpoint_offset() - event_offset;
   174   const int64_t delta = cw.last_checkpoint_offset() == 0 ? 0 : cw.last_checkpoint_offset() - event_offset;
   175   const u1 checkpoint_type = flushpoint ? FLUSH | HEADER : HEADER;
   175   const u4 checkpoint_type = flushpoint ? (u4)(FLUSH | HEADER) : (u4)HEADER;
   176   cw.reserve(sizeof(u4));
   176   cw.reserve(sizeof(u4));
   177   cw.write<u8>(EVENT_CHECKPOINT);
   177   cw.write<u8>(EVENT_CHECKPOINT);
   178   cw.write<u8>(JfrTicks::now().value());
   178   cw.write<u8>(JfrTicks::now().value());
   179   cw.write<u8>(0); // duration
   179   cw.write<u8>(0); // duration
   180   cw.write<u8>(delta); // to previous checkpoint
   180   cw.write<u8>(delta); // to previous checkpoint
   181   cw.write<u1>(checkpoint_type);
   181   cw.write<u4>(checkpoint_type);
   182   cw.write<u4>(1); // pool count
   182   cw.write<u4>(1); // pool count
   183   cw.write<u8>(TYPE_CHUNKHEADER);
   183   cw.write<u8>(TYPE_CHUNKHEADER);
   184   cw.write<u4>(1); // count
   184   cw.write<u4>(1); // count
   185   cw.write<u8>(1); // key
   185   cw.write<u8>(1); // key
   186   cw.write<u4>(HEADER_SIZE); // length of byte array
   186   cw.write<u4>(HEADER_SIZE); // length of byte array