52 int64_t offset; |
52 int64_t offset; |
53 u4 count; |
53 u4 count; |
54 }; |
54 }; |
55 |
55 |
56 class JfrCheckpointWriter : public JfrCheckpointWriterBase { |
56 class JfrCheckpointWriter : public JfrCheckpointWriterBase { |
|
57 friend class JfrCheckpointManager; |
57 friend class JfrSerializerRegistration; |
58 friend class JfrSerializerRegistration; |
58 private: |
59 private: |
59 JfrTicks _time; |
60 JfrTicks _time; |
60 int64_t _offset; |
61 int64_t _offset; |
61 u4 _count; |
62 u4 _count; |
62 bool _flushpoint; |
|
63 bool _header; |
63 bool _header; |
64 |
64 |
65 u4 count() const; |
65 u4 count() const; |
66 void set_count(u4 count); |
66 void set_count(u4 count); |
67 void increment(); |
67 void increment(); |
68 void set_flushpoint(bool flushpoint); |
68 const u1* session_data(size_t* size, bool move = false, const JfrCheckpointContext* ctx = NULL); |
69 bool is_flushpoint() const; |
|
70 const u1* session_data(size_t* size, const JfrCheckpointContext* ctx = NULL); |
|
71 void release(); |
69 void release(); |
72 |
70 JfrCheckpointWriter(Thread* t, JfrBuffer* buffer); |
73 public: |
71 public: |
74 JfrCheckpointWriter(bool flushpoint, bool header, Thread* thread); |
72 JfrCheckpointWriter(); |
|
73 JfrCheckpointWriter(Thread* t, bool header = true); |
75 ~JfrCheckpointWriter(); |
74 ~JfrCheckpointWriter(); |
76 void write_type(JfrTypeId type_id); |
75 void write_type(JfrTypeId type_id); |
77 void write_count(u4 nof_entries); |
76 void write_count(u4 nof_entries); |
78 void write_count(u4 nof_entries, int64_t offset); |
77 void write_count(u4 nof_entries, int64_t offset); |
79 void write_key(u8 key); |
78 void write_key(u8 key); |
80 const JfrCheckpointContext context() const; |
79 const JfrCheckpointContext context() const; |
81 void set_context(const JfrCheckpointContext ctx); |
80 void set_context(const JfrCheckpointContext ctx); |
82 bool has_data() const; |
81 bool has_data() const; |
83 JfrCheckpointBlobHandle checkpoint_blob(); |
|
84 JfrCheckpointBlobHandle copy(const JfrCheckpointContext* ctx = NULL); |
82 JfrCheckpointBlobHandle copy(const JfrCheckpointContext* ctx = NULL); |
85 JfrCheckpointBlobHandle move(const JfrCheckpointContext* ctx = NULL); |
83 JfrCheckpointBlobHandle move(const JfrCheckpointContext* ctx = NULL); |
86 }; |
84 }; |
87 |
85 |
88 #endif // SHARE_JFR_RECORDER_CHECKPOINT_JFRCHECKPOINTWRITER_HPP |
86 #endif // SHARE_JFR_RECORDER_CHECKPOINT_JFRCHECKPOINTWRITER_HPP |