src/hotspot/share/jfr/recorder/checkpoint/jfrCheckpointManager.cpp
branchJEP-349-branch
changeset 57886 87f8a814310d
parent 57882 562f598d303c
child 57934 9c150f2b1fea
equal deleted inserted replaced
57883:90e867ac8c37 57886:87f8a814310d
   223 }
   223 }
   224 
   224 
   225 // offsets into the JfrCheckpointEntry
   225 // offsets into the JfrCheckpointEntry
   226 static const juint starttime_offset = sizeof(jlong);
   226 static const juint starttime_offset = sizeof(jlong);
   227 static const juint duration_offset = starttime_offset + sizeof(jlong);
   227 static const juint duration_offset = starttime_offset + sizeof(jlong);
   228 static const juint mode_offset = duration_offset + sizeof(jlong);
   228 static const juint checkpoint_type_offset = duration_offset + sizeof(jlong);
   229 static const juint types_offset = mode_offset + sizeof(juint);
   229 static const juint types_offset = checkpoint_type_offset + sizeof(juint);
   230 static const juint payload_offset = types_offset + sizeof(juint);
   230 static const juint payload_offset = types_offset + sizeof(juint);
   231 
   231 
   232 template <typename Return>
   232 template <typename Return>
   233 static Return read_data(const u1* data) {
   233 static Return read_data(const u1* data) {
   234   return JfrBigEndian::read<Return>(data);
   234   return JfrBigEndian::read<Return>(data);
   244 
   244 
   245 static jlong duration(const u1* data) {
   245 static jlong duration(const u1* data) {
   246   return read_data<jlong>(data + duration_offset);
   246   return read_data<jlong>(data + duration_offset);
   247 }
   247 }
   248 
   248 
   249 static u1 mode(const u1* data) {
   249 static u1 checkpoint_type(const u1* data) {
   250   return read_data<u1>(data + mode_offset);
   250   return read_data<u1>(data + checkpoint_type_offset);
   251 }
   251 }
   252 
   252 
   253 static juint number_of_types(const u1* data) {
   253 static juint number_of_types(const u1* data) {
   254   return read_data<juint>(data + types_offset);
   254   return read_data<juint>(data + types_offset);
   255 }
   255 }
   258   cw.reserve(sizeof(u4));
   258   cw.reserve(sizeof(u4));
   259   cw.write<u8>(EVENT_CHECKPOINT);
   259   cw.write<u8>(EVENT_CHECKPOINT);
   260   cw.write(starttime(data));
   260   cw.write(starttime(data));
   261   cw.write(duration(data));
   261   cw.write(duration(data));
   262   cw.write(offset_prev_cp_event);
   262   cw.write(offset_prev_cp_event);
   263   cw.write(mode(data));
   263   cw.write(checkpoint_type(data));
   264   cw.write(number_of_types(data));
   264   cw.write(number_of_types(data));
   265 }
   265 }
   266 
   266 
   267 static void write_checkpoint_content(JfrChunkWriter& cw, const u1* data, size_t size) {
   267 static void write_checkpoint_content(JfrChunkWriter& cw, const u1* data, size_t size) {
   268   assert(data != NULL, "invariant");
   268   assert(data != NULL, "invariant");