author | mgronlun |
Mon, 02 Sep 2019 19:42:46 +0200 | |
branch | JEP-349-branch |
changeset 57983 | a57907813a83 |
parent 57878 | bffba8d6611a |
child 58049 | 10ecdb5d3574 |
permissions | -rw-r--r-- |
50113 | 1 |
/* |
57360 | 2 |
* Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved. |
50113 | 3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 |
* |
|
5 |
* This code is free software; you can redistribute it and/or modify it |
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
|
7 |
* published by the Free Software Foundation. |
|
8 |
* |
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
|
13 |
* accompanied this code). |
|
14 |
* |
|
15 |
* You should have received a copy of the GNU General Public License version |
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
18 |
* |
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
|
20 |
* or visit www.oracle.com if you need additional information or have any |
|
21 |
* questions. |
|
22 |
* |
|
23 |
*/ |
|
24 |
||
25 |
#include "precompiled.hpp" |
|
26 |
#include "classfile/javaClasses.inline.hpp" |
|
27 |
#include "code/codeBlob.hpp" |
|
28 |
#include "code/codeCache.hpp" |
|
29 |
#include "gc/shared/gcCause.hpp" |
|
30 |
#include "gc/shared/gcName.hpp" |
|
31 |
#include "gc/shared/gcTrace.hpp" |
|
32 |
#include "gc/shared/gcWhen.hpp" |
|
33 |
#include "jfr/leakprofiler/leakProfiler.hpp" |
|
34 |
#include "jfr/recorder/checkpoint/jfrCheckpointManager.hpp" |
|
35 |
#include "jfr/recorder/checkpoint/types/jfrType.hpp" |
|
36 |
#include "jfr/recorder/jfrRecorder.hpp" |
|
37 |
#include "jfr/recorder/checkpoint/types/jfrThreadGroup.hpp" |
|
38 |
#include "jfr/recorder/checkpoint/types/jfrThreadState.hpp" |
|
39 |
#include "jfr/recorder/checkpoint/types/jfrTypeSet.hpp" |
|
57360 | 40 |
#include "jfr/utilities/jfrThreadIterator.hpp" |
50113 | 41 |
#include "memory/metaspaceGCThresholdUpdater.hpp" |
42 |
#include "memory/referenceType.hpp" |
|
43 |
#include "memory/universe.hpp" |
|
54780
f8d182aedc92
8223136: Move compressed oops functions to CompressedOops class
stefank
parents:
53897
diff
changeset
|
44 |
#include "oops/compressedOops.hpp" |
50113 | 45 |
#include "runtime/flags/jvmFlag.hpp" |
46 |
#include "runtime/mutexLocker.hpp" |
|
47 |
#include "runtime/osThread.hpp" |
|
48 |
#include "runtime/safepoint.hpp" |
|
49 |
#include "runtime/synchronizer.hpp" |
|
50 |
#include "runtime/thread.inline.hpp" |
|
52877
9e041366c764
8214850: Rename vm_operations.?pp files to vmOperations.?pp files
tschatzl
parents:
51004
diff
changeset
|
51 |
#include "runtime/vmOperations.hpp" |
50113 | 52 |
|
53 |
#ifdef COMPILER2 |
|
54 |
#include "opto/compile.hpp" |
|
55 |
#include "opto/node.hpp" |
|
56 |
#endif |
|
57 |
#if INCLUDE_G1GC |
|
58 |
#include "gc/g1/g1HeapRegionTraceType.hpp" |
|
59 |
#include "gc/g1/g1YCTypes.hpp" |
|
60 |
#endif |
|
61 |
||
62 |
// Requires a ResourceMark for get_thread_name/as_utf8 |
|
63 |
class JfrCheckpointThreadClosure : public ThreadClosure { |
|
64 |
private: |
|
65 |
JfrCheckpointWriter& _writer; |
|
51004
162867fa0f8d
8203943: eventThreadGroup was null in TestJavaBlockedEvent.java
mgronlun
parents:
50749
diff
changeset
|
66 |
JfrCheckpointContext _ctx; |
53897
0abec72a3ac2
8217647: JFR: recordings on 32-bit systems unreadable
bulasevich
parents:
52877
diff
changeset
|
67 |
const int64_t _count_position; |
51004
162867fa0f8d
8203943: eventThreadGroup was null in TestJavaBlockedEvent.java
mgronlun
parents:
50749
diff
changeset
|
68 |
Thread* const _curthread; |
162867fa0f8d
8203943: eventThreadGroup was null in TestJavaBlockedEvent.java
mgronlun
parents:
50749
diff
changeset
|
69 |
u4 _count; |
162867fa0f8d
8203943: eventThreadGroup was null in TestJavaBlockedEvent.java
mgronlun
parents:
50749
diff
changeset
|
70 |
|
50113 | 71 |
public: |
51004
162867fa0f8d
8203943: eventThreadGroup was null in TestJavaBlockedEvent.java
mgronlun
parents:
50749
diff
changeset
|
72 |
JfrCheckpointThreadClosure(JfrCheckpointWriter& writer) : _writer(writer), |
162867fa0f8d
8203943: eventThreadGroup was null in TestJavaBlockedEvent.java
mgronlun
parents:
50749
diff
changeset
|
73 |
_ctx(writer.context()), |
162867fa0f8d
8203943: eventThreadGroup was null in TestJavaBlockedEvent.java
mgronlun
parents:
50749
diff
changeset
|
74 |
_count_position(writer.reserve(sizeof(u4))), |
162867fa0f8d
8203943: eventThreadGroup was null in TestJavaBlockedEvent.java
mgronlun
parents:
50749
diff
changeset
|
75 |
_curthread(Thread::current()), |
162867fa0f8d
8203943: eventThreadGroup was null in TestJavaBlockedEvent.java
mgronlun
parents:
50749
diff
changeset
|
76 |
_count(0) { |
162867fa0f8d
8203943: eventThreadGroup was null in TestJavaBlockedEvent.java
mgronlun
parents:
50749
diff
changeset
|
77 |
} |
162867fa0f8d
8203943: eventThreadGroup was null in TestJavaBlockedEvent.java
mgronlun
parents:
50749
diff
changeset
|
78 |
|
162867fa0f8d
8203943: eventThreadGroup was null in TestJavaBlockedEvent.java
mgronlun
parents:
50749
diff
changeset
|
79 |
~JfrCheckpointThreadClosure() { |
162867fa0f8d
8203943: eventThreadGroup was null in TestJavaBlockedEvent.java
mgronlun
parents:
50749
diff
changeset
|
80 |
if (_count == 0) { |
162867fa0f8d
8203943: eventThreadGroup was null in TestJavaBlockedEvent.java
mgronlun
parents:
50749
diff
changeset
|
81 |
// restore |
162867fa0f8d
8203943: eventThreadGroup was null in TestJavaBlockedEvent.java
mgronlun
parents:
50749
diff
changeset
|
82 |
_writer.set_context(_ctx); |
162867fa0f8d
8203943: eventThreadGroup was null in TestJavaBlockedEvent.java
mgronlun
parents:
50749
diff
changeset
|
83 |
return; |
162867fa0f8d
8203943: eventThreadGroup was null in TestJavaBlockedEvent.java
mgronlun
parents:
50749
diff
changeset
|
84 |
} |
162867fa0f8d
8203943: eventThreadGroup was null in TestJavaBlockedEvent.java
mgronlun
parents:
50749
diff
changeset
|
85 |
_writer.write_count(_count, _count_position); |
162867fa0f8d
8203943: eventThreadGroup was null in TestJavaBlockedEvent.java
mgronlun
parents:
50749
diff
changeset
|
86 |
} |
162867fa0f8d
8203943: eventThreadGroup was null in TestJavaBlockedEvent.java
mgronlun
parents:
50749
diff
changeset
|
87 |
|
50113 | 88 |
void do_thread(Thread* t); |
89 |
}; |
|
90 |
||
91 |
void JfrCheckpointThreadClosure::do_thread(Thread* t) { |
|
92 |
assert(t != NULL, "invariant"); |
|
51004
162867fa0f8d
8203943: eventThreadGroup was null in TestJavaBlockedEvent.java
mgronlun
parents:
50749
diff
changeset
|
93 |
++_count; |
57878
bffba8d6611a
Thread metadata to include excluded threads, thread sampler to exclude excluded threads, thread name friend
mgronlun
parents:
57870
diff
changeset
|
94 |
_writer.write_key(JfrThreadId::jfr_id(t)); |
bffba8d6611a
Thread metadata to include excluded threads, thread sampler to exclude excluded threads, thread name friend
mgronlun
parents:
57870
diff
changeset
|
95 |
const char* const name = JfrThreadName::name(t); |
bffba8d6611a
Thread metadata to include excluded threads, thread sampler to exclude excluded threads, thread name friend
mgronlun
parents:
57870
diff
changeset
|
96 |
_writer.write(name); |
bffba8d6611a
Thread metadata to include excluded threads, thread sampler to exclude excluded threads, thread name friend
mgronlun
parents:
57870
diff
changeset
|
97 |
_writer.write<traceid>(JfrThreadId::os_id(t)); |
50113 | 98 |
if (t->is_Java_thread()) { |
57878
bffba8d6611a
Thread metadata to include excluded threads, thread sampler to exclude excluded threads, thread name friend
mgronlun
parents:
57870
diff
changeset
|
99 |
_writer.write(name); |
bffba8d6611a
Thread metadata to include excluded threads, thread sampler to exclude excluded threads, thread name friend
mgronlun
parents:
57870
diff
changeset
|
100 |
_writer.write(JfrThreadId::id(t)); |
50113 | 101 |
JavaThread* const jt = (JavaThread*)t; |
102 |
_writer.write(JfrThreadGroup::thread_group_id(jt, _curthread)); |
|
103 |
return; |
|
104 |
} |
|
105 |
_writer.write((const char*)NULL); // java name |
|
51004
162867fa0f8d
8203943: eventThreadGroup was null in TestJavaBlockedEvent.java
mgronlun
parents:
50749
diff
changeset
|
106 |
_writer.write((traceid)0); // java thread id |
162867fa0f8d
8203943: eventThreadGroup was null in TestJavaBlockedEvent.java
mgronlun
parents:
50749
diff
changeset
|
107 |
_writer.write((traceid)0); // java thread group |
50113 | 108 |
} |
109 |
||
110 |
void JfrThreadConstantSet::serialize(JfrCheckpointWriter& writer) { |
|
111 |
JfrCheckpointThreadClosure tc(writer); |
|
57360 | 112 |
JfrJavaThreadIterator javathreads; |
113 |
while (javathreads.has_next()) { |
|
114 |
tc.do_thread(javathreads.next()); |
|
115 |
} |
|
116 |
JfrNonJavaThreadIterator nonjavathreads; |
|
117 |
while (nonjavathreads.has_next()) { |
|
118 |
tc.do_thread(nonjavathreads.next()); |
|
119 |
} |
|
50113 | 120 |
} |
121 |
||
122 |
void JfrThreadGroupConstant::serialize(JfrCheckpointWriter& writer) { |
|
123 |
JfrThreadGroup::serialize(writer); |
|
124 |
} |
|
125 |
||
126 |
static const char* flag_value_origin_to_string(JVMFlag::Flags origin) { |
|
127 |
switch (origin) { |
|
128 |
case JVMFlag::DEFAULT: return "Default"; |
|
129 |
case JVMFlag::COMMAND_LINE: return "Command line"; |
|
130 |
case JVMFlag::ENVIRON_VAR: return "Environment variable"; |
|
131 |
case JVMFlag::CONFIG_FILE: return "Config file"; |
|
132 |
case JVMFlag::MANAGEMENT: return "Management"; |
|
133 |
case JVMFlag::ERGONOMIC: return "Ergonomic"; |
|
134 |
case JVMFlag::ATTACH_ON_DEMAND: return "Attach on demand"; |
|
135 |
case JVMFlag::INTERNAL: return "Internal"; |
|
136 |
default: ShouldNotReachHere(); return ""; |
|
137 |
} |
|
138 |
} |
|
139 |
||
140 |
void FlagValueOriginConstant::serialize(JfrCheckpointWriter& writer) { |
|
141 |
static const u4 nof_entries = JVMFlag::LAST_VALUE_ORIGIN + 1; |
|
142 |
writer.write_count(nof_entries); |
|
143 |
for (u4 i = 0; i < nof_entries; ++i) { |
|
144 |
writer.write_key(i); |
|
145 |
writer.write(flag_value_origin_to_string((JVMFlag::Flags)i)); |
|
146 |
} |
|
147 |
} |
|
148 |
||
149 |
void MonitorInflateCauseConstant::serialize(JfrCheckpointWriter& writer) { |
|
150 |
static const u4 nof_entries = ObjectSynchronizer::inflate_cause_nof; |
|
151 |
writer.write_count(nof_entries); |
|
152 |
for (u4 i = 0; i < nof_entries; ++i) { |
|
153 |
writer.write_key(i); |
|
154 |
writer.write(ObjectSynchronizer::inflate_cause_name((ObjectSynchronizer::InflateCause)i)); |
|
155 |
} |
|
156 |
} |
|
157 |
||
158 |
void GCCauseConstant::serialize(JfrCheckpointWriter& writer) { |
|
159 |
static const u4 nof_entries = GCCause::_last_gc_cause; |
|
160 |
writer.write_count(nof_entries); |
|
161 |
for (u4 i = 0; i < nof_entries; ++i) { |
|
162 |
writer.write_key(i); |
|
163 |
writer.write(GCCause::to_string((GCCause::Cause)i)); |
|
164 |
} |
|
165 |
} |
|
166 |
||
167 |
void GCNameConstant::serialize(JfrCheckpointWriter& writer) { |
|
168 |
static const u4 nof_entries = GCNameEndSentinel; |
|
169 |
writer.write_count(nof_entries); |
|
170 |
for (u4 i = 0; i < nof_entries; ++i) { |
|
171 |
writer.write_key(i); |
|
172 |
writer.write(GCNameHelper::to_string((GCName)i)); |
|
173 |
} |
|
174 |
} |
|
175 |
||
176 |
void GCWhenConstant::serialize(JfrCheckpointWriter& writer) { |
|
177 |
static const u4 nof_entries = GCWhen::GCWhenEndSentinel; |
|
178 |
writer.write_count(nof_entries); |
|
179 |
for (u4 i = 0; i < nof_entries; ++i) { |
|
180 |
writer.write_key(i); |
|
181 |
writer.write(GCWhen::to_string((GCWhen::Type)i)); |
|
182 |
} |
|
183 |
} |
|
184 |
||
185 |
void G1HeapRegionTypeConstant::serialize(JfrCheckpointWriter& writer) { |
|
186 |
static const u4 nof_entries = G1HeapRegionTraceType::G1HeapRegionTypeEndSentinel; |
|
187 |
writer.write_count(nof_entries); |
|
188 |
for (u4 i = 0; i < nof_entries; ++i) { |
|
189 |
writer.write_key(i); |
|
190 |
writer.write(G1HeapRegionTraceType::to_string((G1HeapRegionTraceType::Type)i)); |
|
191 |
} |
|
192 |
} |
|
193 |
||
194 |
void GCThresholdUpdaterConstant::serialize(JfrCheckpointWriter& writer) { |
|
195 |
static const u4 nof_entries = MetaspaceGCThresholdUpdater::Last; |
|
196 |
writer.write_count(nof_entries); |
|
197 |
for (u4 i = 0; i < nof_entries; ++i) { |
|
198 |
writer.write_key(i); |
|
199 |
writer.write(MetaspaceGCThresholdUpdater::to_string((MetaspaceGCThresholdUpdater::Type)i)); |
|
200 |
} |
|
201 |
} |
|
202 |
||
203 |
void MetadataTypeConstant::serialize(JfrCheckpointWriter& writer) { |
|
204 |
static const u4 nof_entries = Metaspace::MetadataTypeCount; |
|
205 |
writer.write_count(nof_entries); |
|
206 |
for (u4 i = 0; i < nof_entries; ++i) { |
|
207 |
writer.write_key(i); |
|
208 |
writer.write(Metaspace::metadata_type_name((Metaspace::MetadataType)i)); |
|
209 |
} |
|
210 |
} |
|
211 |
||
212 |
void MetaspaceObjectTypeConstant::serialize(JfrCheckpointWriter& writer) { |
|
213 |
static const u4 nof_entries = MetaspaceObj::_number_of_types; |
|
214 |
writer.write_count(nof_entries); |
|
215 |
for (u4 i = 0; i < nof_entries; ++i) { |
|
216 |
writer.write_key(i); |
|
217 |
writer.write(MetaspaceObj::type_name((MetaspaceObj::Type)i)); |
|
218 |
} |
|
219 |
} |
|
220 |
||
221 |
void G1YCTypeConstant::serialize(JfrCheckpointWriter& writer) { |
|
222 |
#if INCLUDE_G1GC |
|
223 |
static const u4 nof_entries = G1YCTypeEndSentinel; |
|
224 |
writer.write_count(nof_entries); |
|
225 |
for (u4 i = 0; i < nof_entries; ++i) { |
|
226 |
writer.write_key(i); |
|
227 |
writer.write(G1YCTypeHelper::to_string((G1YCType)i)); |
|
228 |
} |
|
229 |
#endif |
|
230 |
} |
|
231 |
||
232 |
static const char* reference_type_to_string(ReferenceType rt) { |
|
233 |
switch (rt) { |
|
234 |
case REF_NONE: return "None reference"; |
|
235 |
case REF_OTHER: return "Other reference"; |
|
236 |
case REF_SOFT: return "Soft reference"; |
|
237 |
case REF_WEAK: return "Weak reference"; |
|
238 |
case REF_FINAL: return "Final reference"; |
|
239 |
case REF_PHANTOM: return "Phantom reference"; |
|
240 |
default: |
|
241 |
ShouldNotReachHere(); |
|
242 |
return NULL; |
|
243 |
} |
|
244 |
} |
|
245 |
||
246 |
void ReferenceTypeConstant::serialize(JfrCheckpointWriter& writer) { |
|
247 |
static const u4 nof_entries = REF_PHANTOM + 1; |
|
248 |
writer.write_count(nof_entries); |
|
249 |
for (u4 i = 0; i < nof_entries; ++i) { |
|
250 |
writer.write_key(i); |
|
251 |
writer.write(reference_type_to_string((ReferenceType)i)); |
|
252 |
} |
|
253 |
} |
|
254 |
||
255 |
void NarrowOopModeConstant::serialize(JfrCheckpointWriter& writer) { |
|
54780
f8d182aedc92
8223136: Move compressed oops functions to CompressedOops class
stefank
parents:
53897
diff
changeset
|
256 |
static const u4 nof_entries = CompressedOops::HeapBasedNarrowOop + 1; |
50113 | 257 |
writer.write_count(nof_entries); |
258 |
for (u4 i = 0; i < nof_entries; ++i) { |
|
259 |
writer.write_key(i); |
|
54780
f8d182aedc92
8223136: Move compressed oops functions to CompressedOops class
stefank
parents:
53897
diff
changeset
|
260 |
writer.write(CompressedOops::mode_to_string((CompressedOops::Mode)i)); |
50113 | 261 |
} |
262 |
} |
|
263 |
||
264 |
void CompilerPhaseTypeConstant::serialize(JfrCheckpointWriter& writer) { |
|
265 |
#ifdef COMPILER2 |
|
266 |
static const u4 nof_entries = PHASE_NUM_TYPES; |
|
267 |
writer.write_count(nof_entries); |
|
268 |
for (u4 i = 0; i < nof_entries; ++i) { |
|
269 |
writer.write_key(i); |
|
270 |
writer.write(CompilerPhaseTypeHelper::to_string((CompilerPhaseType)i)); |
|
271 |
} |
|
272 |
#endif |
|
273 |
} |
|
274 |
||
275 |
void CodeBlobTypeConstant::serialize(JfrCheckpointWriter& writer) { |
|
276 |
static const u4 nof_entries = CodeBlobType::NumTypes; |
|
277 |
writer.write_count(nof_entries); |
|
278 |
for (u4 i = 0; i < nof_entries; ++i) { |
|
279 |
writer.write_key(i); |
|
280 |
writer.write(CodeCache::get_code_heap_name(i)); |
|
281 |
} |
|
282 |
}; |
|
283 |
||
284 |
void VMOperationTypeConstant::serialize(JfrCheckpointWriter& writer) { |
|
285 |
static const u4 nof_entries = VM_Operation::VMOp_Terminating; |
|
286 |
writer.write_count(nof_entries); |
|
287 |
for (u4 i = 0; i < nof_entries; ++i) { |
|
288 |
writer.write_key(i); |
|
289 |
writer.write(VM_Operation::name(VM_Operation::VMOp_Type(i))); |
|
290 |
} |
|
291 |
} |
|
292 |
||
293 |
class TypeSetSerialization { |
|
294 |
private: |
|
57983
a57907813a83
old object sample blob:ification and serialization support
mgronlun
parents:
57878
diff
changeset
|
295 |
JfrCheckpointWriter* _leakp_writer; |
57360 | 296 |
size_t _elements; |
50113 | 297 |
bool _class_unload; |
57360 | 298 |
bool _flushpoint; |
50113 | 299 |
public: |
57983
a57907813a83
old object sample blob:ification and serialization support
mgronlun
parents:
57878
diff
changeset
|
300 |
TypeSetSerialization(bool class_unload, bool flushpoint, JfrCheckpointWriter* leakp_writer = NULL) : |
a57907813a83
old object sample blob:ification and serialization support
mgronlun
parents:
57878
diff
changeset
|
301 |
_leakp_writer(leakp_writer), _elements(0), _class_unload(class_unload), _flushpoint(flushpoint) {} |
57870
00860d9caf4d
New metadata system for oldobjects built on top of simplified tagging model. Caching and serialization improvements. Flushpoint checkpoint with chunkheader contents.
mgronlun
parents:
57360
diff
changeset
|
302 |
void write(JfrCheckpointWriter& writer) { |
57360 | 303 |
MutexLocker cld_lock(SafepointSynchronize::is_at_safepoint() ? NULL : ClassLoaderDataGraph_lock); |
304 |
MutexLocker lock(SafepointSynchronize::is_at_safepoint() ? NULL : Module_lock); |
|
57983
a57907813a83
old object sample blob:ification and serialization support
mgronlun
parents:
57878
diff
changeset
|
305 |
_elements = JfrTypeSet::serialize(&writer, _leakp_writer, _class_unload, _flushpoint); |
57360 | 306 |
} |
307 |
size_t elements() const { |
|
308 |
return _elements; |
|
50113 | 309 |
} |
310 |
}; |
|
311 |
||
312 |
void ClassUnloadTypeSet::serialize(JfrCheckpointWriter& writer) { |
|
57360 | 313 |
TypeSetSerialization type_set(true, false); |
57870
00860d9caf4d
New metadata system for oldobjects built on top of simplified tagging model. Caching and serialization improvements. Flushpoint checkpoint with chunkheader contents.
mgronlun
parents:
57360
diff
changeset
|
314 |
type_set.write(writer); |
50113 | 315 |
}; |
316 |
||
57360 | 317 |
void FlushTypeSet::serialize(JfrCheckpointWriter& writer) { |
318 |
assert(!SafepointSynchronize::is_at_safepoint(), "invariant"); |
|
319 |
TypeSetSerialization type_set(false, true); |
|
57870
00860d9caf4d
New metadata system for oldobjects built on top of simplified tagging model. Caching and serialization improvements. Flushpoint checkpoint with chunkheader contents.
mgronlun
parents:
57360
diff
changeset
|
320 |
type_set.write(writer); |
57360 | 321 |
_elements = type_set.elements(); |
322 |
} |
|
323 |
||
324 |
size_t FlushTypeSet::elements() const { |
|
325 |
return _elements; |
|
326 |
} |
|
327 |
||
57983
a57907813a83
old object sample blob:ification and serialization support
mgronlun
parents:
57878
diff
changeset
|
328 |
TypeSet::TypeSet(JfrCheckpointWriter* leakp_writer) : _leakp_writer(leakp_writer) {} |
a57907813a83
old object sample blob:ification and serialization support
mgronlun
parents:
57878
diff
changeset
|
329 |
|
50113 | 330 |
void TypeSet::serialize(JfrCheckpointWriter& writer) { |
57983
a57907813a83
old object sample blob:ification and serialization support
mgronlun
parents:
57878
diff
changeset
|
331 |
TypeSetSerialization type_set(false, false, _leakp_writer); |
57870
00860d9caf4d
New metadata system for oldobjects built on top of simplified tagging model. Caching and serialization improvements. Flushpoint checkpoint with chunkheader contents.
mgronlun
parents:
57360
diff
changeset
|
332 |
type_set.write(writer); |
50113 | 333 |
}; |
334 |
||
335 |
void ThreadStateConstant::serialize(JfrCheckpointWriter& writer) { |
|
336 |
JfrThreadState::serialize(writer); |
|
337 |
} |
|
338 |
||
339 |
void JfrThreadConstant::serialize(JfrCheckpointWriter& writer) { |
|
340 |
assert(_thread != NULL, "invariant"); |
|
341 |
assert(_thread == Thread::current(), "invariant"); |
|
342 |
writer.write_count(1); |
|
57878
bffba8d6611a
Thread metadata to include excluded threads, thread sampler to exclude excluded threads, thread name friend
mgronlun
parents:
57870
diff
changeset
|
343 |
writer.write_key(JfrThreadId::jfr_id(_thread)); |
bffba8d6611a
Thread metadata to include excluded threads, thread sampler to exclude excluded threads, thread name friend
mgronlun
parents:
57870
diff
changeset
|
344 |
const char* const name = JfrThreadName::name(_thread); |
bffba8d6611a
Thread metadata to include excluded threads, thread sampler to exclude excluded threads, thread name friend
mgronlun
parents:
57870
diff
changeset
|
345 |
writer.write(name); |
bffba8d6611a
Thread metadata to include excluded threads, thread sampler to exclude excluded threads, thread name friend
mgronlun
parents:
57870
diff
changeset
|
346 |
writer.write(JfrThreadId::os_id(_thread)); |
57360 | 347 |
if (_thread->is_Java_thread()) { |
57878
bffba8d6611a
Thread metadata to include excluded threads, thread sampler to exclude excluded threads, thread name friend
mgronlun
parents:
57870
diff
changeset
|
348 |
writer.write(name); |
bffba8d6611a
Thread metadata to include excluded threads, thread sampler to exclude excluded threads, thread name friend
mgronlun
parents:
57870
diff
changeset
|
349 |
writer.write(JfrThreadId::id(_thread)); |
57360 | 350 |
JavaThread* const jt = (JavaThread*)_thread; |
351 |
const traceid thread_group_id = JfrThreadGroup::thread_group_id(jt, jt); |
|
352 |
writer.write(thread_group_id); |
|
353 |
JfrThreadGroup::serialize(&writer, thread_group_id); |
|
354 |
return; |
|
355 |
} |
|
356 |
writer.write((const char*)NULL); // java name |
|
357 |
writer.write((traceid)0); // java thread id |
|
358 |
writer.write((traceid)0); // java thread group |
|
50113 | 359 |
} |