equal
deleted
inserted
replaced
29 #include "jfr/recorder/repository/jfrChunkWriter.hpp" |
29 #include "jfr/recorder/repository/jfrChunkWriter.hpp" |
30 #include "jfr/utilities/jfrTimeConverter.hpp" |
30 #include "jfr/utilities/jfrTimeConverter.hpp" |
31 #include "logging/log.hpp" |
31 #include "logging/log.hpp" |
32 #include "runtime/os.inline.hpp" |
32 #include "runtime/os.inline.hpp" |
33 #include "runtime/thread.inline.hpp" |
33 #include "runtime/thread.inline.hpp" |
|
34 |
|
35 static const char* const MAGIC = "FLR"; |
|
36 static const u2 JFR_VERSION_MAJOR = 2; |
|
37 static const u2 JFR_VERSION_MINOR = 0; |
34 |
38 |
35 static const u1 GUARD = 0xff; |
39 static const u1 GUARD = 0xff; |
36 |
40 |
37 static jlong nanos_now() { |
41 static jlong nanos_now() { |
38 return os::javaTimeMillis() * JfrTimeConverter::NANOS_PER_MILLISEC; |
42 return os::javaTimeMillis() * JfrTimeConverter::NANOS_PER_MILLISEC; |
64 } |
68 } |
65 _last_checkpoint_offset = _last_metadata_offset = 0; |
69 _last_checkpoint_offset = _last_metadata_offset = 0; |
66 _generation = 1; |
70 _generation = 1; |
67 } |
71 } |
68 |
72 |
|
73 const char* JfrChunk::magic() const { |
|
74 return MAGIC; |
|
75 } |
|
76 |
|
77 u2 JfrChunk::major_version() const { |
|
78 return JFR_VERSION_MAJOR; |
|
79 } |
|
80 |
|
81 u2 JfrChunk::minor_version() const { |
|
82 return JFR_VERSION_MINOR; |
|
83 } |
|
84 |
|
85 u2 JfrChunk::capabilities() const { |
|
86 // chunk capabilities, CompressedIntegers etc |
|
87 static bool compressed_integers = JfrOptionSet::compressed_integers(); |
|
88 return compressed_integers; |
|
89 } |
|
90 |
|
91 int64_t JfrChunk::cpu_frequency() const { |
|
92 static const jlong frequency = JfrTime::frequency(); |
|
93 return frequency; |
|
94 } |
|
95 |
69 void JfrChunk::set_last_checkpoint_offset(int64_t offset) { |
96 void JfrChunk::set_last_checkpoint_offset(int64_t offset) { |
70 _last_checkpoint_offset = offset; |
97 _last_checkpoint_offset = offset; |
71 } |
98 } |
72 |
99 |
73 int64_t JfrChunk::last_checkpoint_offset() const { |
100 int64_t JfrChunk::last_checkpoint_offset() const { |
188 _generation = 1; |
215 _generation = 1; |
189 } |
216 } |
190 return this_generation; |
217 return this_generation; |
191 } |
218 } |
192 |
219 |
|
220 u1 JfrChunk::next_generation() const { |
|
221 assert(_generation > 0, "invariant"); |
|
222 const u1 next_gen = _generation; |
|
223 return GUARD == next_gen ? 1 : next_gen; |
|
224 } |