author | mgronlun |
Sat, 24 Aug 2019 14:30:27 +0200 | |
branch | JEP-349-branch |
changeset 57870 | 00860d9caf4d |
parent 57360 | 5d043a159d5c |
child 57878 | bffba8d6611a |
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/checkpoint/objectSampleCheckpoint.hpp" |
|
34 |
#include "jfr/leakprofiler/leakProfiler.hpp" |
|
35 |
#include "jfr/recorder/checkpoint/jfrCheckpointManager.hpp" |
|
36 |
#include "jfr/recorder/checkpoint/types/jfrType.hpp" |
|
37 |
#include "jfr/recorder/jfrRecorder.hpp" |
|
38 |
#include "jfr/recorder/checkpoint/types/jfrThreadGroup.hpp" |
|
39 |
#include "jfr/recorder/checkpoint/types/jfrThreadState.hpp" |
|
40 |
#include "jfr/recorder/checkpoint/types/jfrTypeSet.hpp" |
|
41 |
#include "jfr/support/jfrThreadLocal.hpp" |
|
57360 | 42 |
#include "jfr/utilities/jfrThreadIterator.hpp" |
50113 | 43 |
#include "memory/metaspaceGCThresholdUpdater.hpp" |
44 |
#include "memory/referenceType.hpp" |
|
45 |
#include "memory/universe.hpp" |
|
54780
f8d182aedc92
8223136: Move compressed oops functions to CompressedOops class
stefank
parents:
53897
diff
changeset
|
46 |
#include "oops/compressedOops.hpp" |
50113 | 47 |
#include "runtime/flags/jvmFlag.hpp" |
48 |
#include "runtime/mutexLocker.hpp" |
|
49 |
#include "runtime/osThread.hpp" |
|
50 |
#include "runtime/safepoint.hpp" |
|
51 |
#include "runtime/synchronizer.hpp" |
|
52 |
#include "runtime/thread.inline.hpp" |
|
52877
9e041366c764
8214850: Rename vm_operations.?pp files to vmOperations.?pp files
tschatzl
parents:
51004
diff
changeset
|
53 |
#include "runtime/vmOperations.hpp" |
50113 | 54 |
|
55 |
#ifdef COMPILER2 |
|
56 |
#include "opto/compile.hpp" |
|
57 |
#include "opto/node.hpp" |
|
58 |
#endif |
|
59 |
#if INCLUDE_G1GC |
|
60 |
#include "gc/g1/g1HeapRegionTraceType.hpp" |
|
61 |
#include "gc/g1/g1YCTypes.hpp" |
|
62 |
#endif |
|
63 |
||
64 |
// Requires a ResourceMark for get_thread_name/as_utf8 |
|
65 |
class JfrCheckpointThreadClosure : public ThreadClosure { |
|
66 |
private: |
|
67 |
JfrCheckpointWriter& _writer; |
|
51004
162867fa0f8d
8203943: eventThreadGroup was null in TestJavaBlockedEvent.java
mgronlun
parents:
50749
diff
changeset
|
68 |
JfrCheckpointContext _ctx; |
53897
0abec72a3ac2
8217647: JFR: recordings on 32-bit systems unreadable
bulasevich
parents:
52877
diff
changeset
|
69 |
const int64_t _count_position; |
51004
162867fa0f8d
8203943: eventThreadGroup was null in TestJavaBlockedEvent.java
mgronlun
parents:
50749
diff
changeset
|
70 |
Thread* const _curthread; |
162867fa0f8d
8203943: eventThreadGroup was null in TestJavaBlockedEvent.java
mgronlun
parents:
50749
diff
changeset
|
71 |
u4 _count; |
162867fa0f8d
8203943: eventThreadGroup was null in TestJavaBlockedEvent.java
mgronlun
parents:
50749
diff
changeset
|
72 |
|
50113 | 73 |
public: |
51004
162867fa0f8d
8203943: eventThreadGroup was null in TestJavaBlockedEvent.java
mgronlun
parents:
50749
diff
changeset
|
74 |
JfrCheckpointThreadClosure(JfrCheckpointWriter& writer) : _writer(writer), |
162867fa0f8d
8203943: eventThreadGroup was null in TestJavaBlockedEvent.java
mgronlun
parents:
50749
diff
changeset
|
75 |
_ctx(writer.context()), |
162867fa0f8d
8203943: eventThreadGroup was null in TestJavaBlockedEvent.java
mgronlun
parents:
50749
diff
changeset
|
76 |
_count_position(writer.reserve(sizeof(u4))), |
162867fa0f8d
8203943: eventThreadGroup was null in TestJavaBlockedEvent.java
mgronlun
parents:
50749
diff
changeset
|
77 |
_curthread(Thread::current()), |
162867fa0f8d
8203943: eventThreadGroup was null in TestJavaBlockedEvent.java
mgronlun
parents:
50749
diff
changeset
|
78 |
_count(0) { |
162867fa0f8d
8203943: eventThreadGroup was null in TestJavaBlockedEvent.java
mgronlun
parents:
50749
diff
changeset
|
79 |
} |
162867fa0f8d
8203943: eventThreadGroup was null in TestJavaBlockedEvent.java
mgronlun
parents:
50749
diff
changeset
|
80 |
|
162867fa0f8d
8203943: eventThreadGroup was null in TestJavaBlockedEvent.java
mgronlun
parents:
50749
diff
changeset
|
81 |
~JfrCheckpointThreadClosure() { |
162867fa0f8d
8203943: eventThreadGroup was null in TestJavaBlockedEvent.java
mgronlun
parents:
50749
diff
changeset
|
82 |
if (_count == 0) { |
162867fa0f8d
8203943: eventThreadGroup was null in TestJavaBlockedEvent.java
mgronlun
parents:
50749
diff
changeset
|
83 |
// restore |
162867fa0f8d
8203943: eventThreadGroup was null in TestJavaBlockedEvent.java
mgronlun
parents:
50749
diff
changeset
|
84 |
_writer.set_context(_ctx); |
162867fa0f8d
8203943: eventThreadGroup was null in TestJavaBlockedEvent.java
mgronlun
parents:
50749
diff
changeset
|
85 |
return; |
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 |
_writer.write_count(_count, _count_position); |
162867fa0f8d
8203943: eventThreadGroup was null in TestJavaBlockedEvent.java
mgronlun
parents:
50749
diff
changeset
|
88 |
} |
162867fa0f8d
8203943: eventThreadGroup was null in TestJavaBlockedEvent.java
mgronlun
parents:
50749
diff
changeset
|
89 |
|
50113 | 90 |
void do_thread(Thread* t); |
91 |
}; |
|
92 |
||
93 |
// Requires a ResourceMark for get_thread_name/as_utf8 |
|
94 |
void JfrCheckpointThreadClosure::do_thread(Thread* t) { |
|
95 |
assert(t != NULL, "invariant"); |
|
51004
162867fa0f8d
8203943: eventThreadGroup was null in TestJavaBlockedEvent.java
mgronlun
parents:
50749
diff
changeset
|
96 |
const JfrThreadLocal* const tl = t->jfr_thread_local(); |
162867fa0f8d
8203943: eventThreadGroup was null in TestJavaBlockedEvent.java
mgronlun
parents:
50749
diff
changeset
|
97 |
assert(tl != NULL, "invariant"); |
57360 | 98 |
assert(!tl->is_dead(), "invariant"); |
99 |
assert(!tl->is_excluded(), "invariant"); |
|
51004
162867fa0f8d
8203943: eventThreadGroup was null in TestJavaBlockedEvent.java
mgronlun
parents:
50749
diff
changeset
|
100 |
++_count; |
162867fa0f8d
8203943: eventThreadGroup was null in TestJavaBlockedEvent.java
mgronlun
parents:
50749
diff
changeset
|
101 |
_writer.write_key(tl->thread_id()); |
50113 | 102 |
_writer.write(t->name()); |
103 |
const OSThread* const os_thread = t->osthread(); |
|
51004
162867fa0f8d
8203943: eventThreadGroup was null in TestJavaBlockedEvent.java
mgronlun
parents:
50749
diff
changeset
|
104 |
_writer.write<traceid>(os_thread != NULL ? os_thread->thread_id() : 0); |
50113 | 105 |
if (t->is_Java_thread()) { |
106 |
JavaThread* const jt = (JavaThread*)t; |
|
107 |
_writer.write(jt->name()); |
|
108 |
_writer.write(java_lang_Thread::thread_id(jt->threadObj())); |
|
109 |
_writer.write(JfrThreadGroup::thread_group_id(jt, _curthread)); |
|
110 |
// since we are iterating threads during a safepoint, also issue notification |
|
111 |
return; |
|
112 |
} |
|
113 |
_writer.write((const char*)NULL); // java name |
|
51004
162867fa0f8d
8203943: eventThreadGroup was null in TestJavaBlockedEvent.java
mgronlun
parents:
50749
diff
changeset
|
114 |
_writer.write((traceid)0); // java thread id |
162867fa0f8d
8203943: eventThreadGroup was null in TestJavaBlockedEvent.java
mgronlun
parents:
50749
diff
changeset
|
115 |
_writer.write((traceid)0); // java thread group |
50113 | 116 |
} |
117 |
||
118 |
void JfrThreadConstantSet::serialize(JfrCheckpointWriter& writer) { |
|
119 |
JfrCheckpointThreadClosure tc(writer); |
|
57360 | 120 |
JfrJavaThreadIterator javathreads; |
121 |
while (javathreads.has_next()) { |
|
122 |
tc.do_thread(javathreads.next()); |
|
123 |
} |
|
124 |
JfrNonJavaThreadIterator nonjavathreads; |
|
125 |
while (nonjavathreads.has_next()) { |
|
126 |
tc.do_thread(nonjavathreads.next()); |
|
127 |
} |
|
50113 | 128 |
} |
129 |
||
130 |
void JfrThreadGroupConstant::serialize(JfrCheckpointWriter& writer) { |
|
131 |
JfrThreadGroup::serialize(writer); |
|
132 |
} |
|
133 |
||
134 |
static const char* flag_value_origin_to_string(JVMFlag::Flags origin) { |
|
135 |
switch (origin) { |
|
136 |
case JVMFlag::DEFAULT: return "Default"; |
|
137 |
case JVMFlag::COMMAND_LINE: return "Command line"; |
|
138 |
case JVMFlag::ENVIRON_VAR: return "Environment variable"; |
|
139 |
case JVMFlag::CONFIG_FILE: return "Config file"; |
|
140 |
case JVMFlag::MANAGEMENT: return "Management"; |
|
141 |
case JVMFlag::ERGONOMIC: return "Ergonomic"; |
|
142 |
case JVMFlag::ATTACH_ON_DEMAND: return "Attach on demand"; |
|
143 |
case JVMFlag::INTERNAL: return "Internal"; |
|
144 |
default: ShouldNotReachHere(); return ""; |
|
145 |
} |
|
146 |
} |
|
147 |
||
148 |
void FlagValueOriginConstant::serialize(JfrCheckpointWriter& writer) { |
|
149 |
static const u4 nof_entries = JVMFlag::LAST_VALUE_ORIGIN + 1; |
|
150 |
writer.write_count(nof_entries); |
|
151 |
for (u4 i = 0; i < nof_entries; ++i) { |
|
152 |
writer.write_key(i); |
|
153 |
writer.write(flag_value_origin_to_string((JVMFlag::Flags)i)); |
|
154 |
} |
|
155 |
} |
|
156 |
||
157 |
void MonitorInflateCauseConstant::serialize(JfrCheckpointWriter& writer) { |
|
158 |
static const u4 nof_entries = ObjectSynchronizer::inflate_cause_nof; |
|
159 |
writer.write_count(nof_entries); |
|
160 |
for (u4 i = 0; i < nof_entries; ++i) { |
|
161 |
writer.write_key(i); |
|
162 |
writer.write(ObjectSynchronizer::inflate_cause_name((ObjectSynchronizer::InflateCause)i)); |
|
163 |
} |
|
164 |
} |
|
165 |
||
166 |
void GCCauseConstant::serialize(JfrCheckpointWriter& writer) { |
|
167 |
static const u4 nof_entries = GCCause::_last_gc_cause; |
|
168 |
writer.write_count(nof_entries); |
|
169 |
for (u4 i = 0; i < nof_entries; ++i) { |
|
170 |
writer.write_key(i); |
|
171 |
writer.write(GCCause::to_string((GCCause::Cause)i)); |
|
172 |
} |
|
173 |
} |
|
174 |
||
175 |
void GCNameConstant::serialize(JfrCheckpointWriter& writer) { |
|
176 |
static const u4 nof_entries = GCNameEndSentinel; |
|
177 |
writer.write_count(nof_entries); |
|
178 |
for (u4 i = 0; i < nof_entries; ++i) { |
|
179 |
writer.write_key(i); |
|
180 |
writer.write(GCNameHelper::to_string((GCName)i)); |
|
181 |
} |
|
182 |
} |
|
183 |
||
184 |
void GCWhenConstant::serialize(JfrCheckpointWriter& writer) { |
|
185 |
static const u4 nof_entries = GCWhen::GCWhenEndSentinel; |
|
186 |
writer.write_count(nof_entries); |
|
187 |
for (u4 i = 0; i < nof_entries; ++i) { |
|
188 |
writer.write_key(i); |
|
189 |
writer.write(GCWhen::to_string((GCWhen::Type)i)); |
|
190 |
} |
|
191 |
} |
|
192 |
||
193 |
void G1HeapRegionTypeConstant::serialize(JfrCheckpointWriter& writer) { |
|
194 |
static const u4 nof_entries = G1HeapRegionTraceType::G1HeapRegionTypeEndSentinel; |
|
195 |
writer.write_count(nof_entries); |
|
196 |
for (u4 i = 0; i < nof_entries; ++i) { |
|
197 |
writer.write_key(i); |
|
198 |
writer.write(G1HeapRegionTraceType::to_string((G1HeapRegionTraceType::Type)i)); |
|
199 |
} |
|
200 |
} |
|
201 |
||
202 |
void GCThresholdUpdaterConstant::serialize(JfrCheckpointWriter& writer) { |
|
203 |
static const u4 nof_entries = MetaspaceGCThresholdUpdater::Last; |
|
204 |
writer.write_count(nof_entries); |
|
205 |
for (u4 i = 0; i < nof_entries; ++i) { |
|
206 |
writer.write_key(i); |
|
207 |
writer.write(MetaspaceGCThresholdUpdater::to_string((MetaspaceGCThresholdUpdater::Type)i)); |
|
208 |
} |
|
209 |
} |
|
210 |
||
211 |
void MetadataTypeConstant::serialize(JfrCheckpointWriter& writer) { |
|
212 |
static const u4 nof_entries = Metaspace::MetadataTypeCount; |
|
213 |
writer.write_count(nof_entries); |
|
214 |
for (u4 i = 0; i < nof_entries; ++i) { |
|
215 |
writer.write_key(i); |
|
216 |
writer.write(Metaspace::metadata_type_name((Metaspace::MetadataType)i)); |
|
217 |
} |
|
218 |
} |
|
219 |
||
220 |
void MetaspaceObjectTypeConstant::serialize(JfrCheckpointWriter& writer) { |
|
221 |
static const u4 nof_entries = MetaspaceObj::_number_of_types; |
|
222 |
writer.write_count(nof_entries); |
|
223 |
for (u4 i = 0; i < nof_entries; ++i) { |
|
224 |
writer.write_key(i); |
|
225 |
writer.write(MetaspaceObj::type_name((MetaspaceObj::Type)i)); |
|
226 |
} |
|
227 |
} |
|
228 |
||
229 |
void G1YCTypeConstant::serialize(JfrCheckpointWriter& writer) { |
|
230 |
#if INCLUDE_G1GC |
|
231 |
static const u4 nof_entries = G1YCTypeEndSentinel; |
|
232 |
writer.write_count(nof_entries); |
|
233 |
for (u4 i = 0; i < nof_entries; ++i) { |
|
234 |
writer.write_key(i); |
|
235 |
writer.write(G1YCTypeHelper::to_string((G1YCType)i)); |
|
236 |
} |
|
237 |
#endif |
|
238 |
} |
|
239 |
||
240 |
static const char* reference_type_to_string(ReferenceType rt) { |
|
241 |
switch (rt) { |
|
242 |
case REF_NONE: return "None reference"; |
|
243 |
case REF_OTHER: return "Other reference"; |
|
244 |
case REF_SOFT: return "Soft reference"; |
|
245 |
case REF_WEAK: return "Weak reference"; |
|
246 |
case REF_FINAL: return "Final reference"; |
|
247 |
case REF_PHANTOM: return "Phantom reference"; |
|
248 |
default: |
|
249 |
ShouldNotReachHere(); |
|
250 |
return NULL; |
|
251 |
} |
|
252 |
} |
|
253 |
||
254 |
void ReferenceTypeConstant::serialize(JfrCheckpointWriter& writer) { |
|
255 |
static const u4 nof_entries = REF_PHANTOM + 1; |
|
256 |
writer.write_count(nof_entries); |
|
257 |
for (u4 i = 0; i < nof_entries; ++i) { |
|
258 |
writer.write_key(i); |
|
259 |
writer.write(reference_type_to_string((ReferenceType)i)); |
|
260 |
} |
|
261 |
} |
|
262 |
||
263 |
void NarrowOopModeConstant::serialize(JfrCheckpointWriter& writer) { |
|
54780
f8d182aedc92
8223136: Move compressed oops functions to CompressedOops class
stefank
parents:
53897
diff
changeset
|
264 |
static const u4 nof_entries = CompressedOops::HeapBasedNarrowOop + 1; |
50113 | 265 |
writer.write_count(nof_entries); |
266 |
for (u4 i = 0; i < nof_entries; ++i) { |
|
267 |
writer.write_key(i); |
|
54780
f8d182aedc92
8223136: Move compressed oops functions to CompressedOops class
stefank
parents:
53897
diff
changeset
|
268 |
writer.write(CompressedOops::mode_to_string((CompressedOops::Mode)i)); |
50113 | 269 |
} |
270 |
} |
|
271 |
||
272 |
void CompilerPhaseTypeConstant::serialize(JfrCheckpointWriter& writer) { |
|
273 |
#ifdef COMPILER2 |
|
274 |
static const u4 nof_entries = PHASE_NUM_TYPES; |
|
275 |
writer.write_count(nof_entries); |
|
276 |
for (u4 i = 0; i < nof_entries; ++i) { |
|
277 |
writer.write_key(i); |
|
278 |
writer.write(CompilerPhaseTypeHelper::to_string((CompilerPhaseType)i)); |
|
279 |
} |
|
280 |
#endif |
|
281 |
} |
|
282 |
||
283 |
void CodeBlobTypeConstant::serialize(JfrCheckpointWriter& writer) { |
|
284 |
static const u4 nof_entries = CodeBlobType::NumTypes; |
|
285 |
writer.write_count(nof_entries); |
|
286 |
for (u4 i = 0; i < nof_entries; ++i) { |
|
287 |
writer.write_key(i); |
|
288 |
writer.write(CodeCache::get_code_heap_name(i)); |
|
289 |
} |
|
290 |
}; |
|
291 |
||
292 |
void VMOperationTypeConstant::serialize(JfrCheckpointWriter& writer) { |
|
293 |
static const u4 nof_entries = VM_Operation::VMOp_Terminating; |
|
294 |
writer.write_count(nof_entries); |
|
295 |
for (u4 i = 0; i < nof_entries; ++i) { |
|
296 |
writer.write_key(i); |
|
297 |
writer.write(VM_Operation::name(VM_Operation::VMOp_Type(i))); |
|
298 |
} |
|
299 |
} |
|
300 |
||
301 |
class TypeSetSerialization { |
|
302 |
private: |
|
57360 | 303 |
size_t _elements; |
50113 | 304 |
bool _class_unload; |
57360 | 305 |
bool _flushpoint; |
50113 | 306 |
public: |
57360 | 307 |
explicit TypeSetSerialization(bool class_unload, bool flushpoint) : _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
|
308 |
void write(JfrCheckpointWriter& writer) { |
57360 | 309 |
MutexLocker cld_lock(SafepointSynchronize::is_at_safepoint() ? NULL : ClassLoaderDataGraph_lock); |
310 |
MutexLocker lock(SafepointSynchronize::is_at_safepoint() ? NULL : Module_lock); |
|
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
|
311 |
_elements = JfrTypeSet::serialize(&writer, _class_unload, _flushpoint); |
57360 | 312 |
} |
313 |
size_t elements() const { |
|
314 |
return _elements; |
|
50113 | 315 |
} |
316 |
}; |
|
317 |
||
318 |
void ClassUnloadTypeSet::serialize(JfrCheckpointWriter& writer) { |
|
57360 | 319 |
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
|
320 |
type_set.write(writer); |
50113 | 321 |
if (LeakProfiler::is_running()) { |
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
|
322 |
ObjectSampleCheckpoint::on_type_set_unload(writer); |
50113 | 323 |
return; |
324 |
} |
|
325 |
}; |
|
326 |
||
57360 | 327 |
void FlushTypeSet::serialize(JfrCheckpointWriter& writer) { |
328 |
assert(!SafepointSynchronize::is_at_safepoint(), "invariant"); |
|
329 |
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
|
330 |
type_set.write(writer); |
57360 | 331 |
_elements = type_set.elements(); |
332 |
} |
|
333 |
||
334 |
size_t FlushTypeSet::elements() const { |
|
335 |
return _elements; |
|
336 |
} |
|
337 |
||
50113 | 338 |
void TypeSet::serialize(JfrCheckpointWriter& writer) { |
57360 | 339 |
TypeSetSerialization type_set(false, 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
|
340 |
type_set.write(writer); |
50113 | 341 |
}; |
342 |
||
343 |
void ThreadStateConstant::serialize(JfrCheckpointWriter& writer) { |
|
344 |
JfrThreadState::serialize(writer); |
|
345 |
} |
|
346 |
||
347 |
void JfrThreadConstant::serialize(JfrCheckpointWriter& writer) { |
|
348 |
assert(_thread != NULL, "invariant"); |
|
349 |
assert(_thread == Thread::current(), "invariant"); |
|
350 |
ResourceMark rm(_thread); |
|
57360 | 351 |
HandleMark hm(_thread); |
50113 | 352 |
const char* const thread_name = _thread->name(); |
353 |
writer.write_count(1); |
|
354 |
writer.write_key(_thread->jfr_thread_local()->thread_id()); |
|
355 |
writer.write(thread_name); |
|
51004
162867fa0f8d
8203943: eventThreadGroup was null in TestJavaBlockedEvent.java
mgronlun
parents:
50749
diff
changeset
|
356 |
writer.write((traceid)_thread->osthread()->thread_id()); |
57360 | 357 |
if (_thread->is_Java_thread()) { |
358 |
JavaThread* const jt = (JavaThread*)_thread; |
|
359 |
writer.write(jt->name()); |
|
360 |
writer.write(java_lang_Thread::thread_id(jt->threadObj())); |
|
361 |
const traceid thread_group_id = JfrThreadGroup::thread_group_id(jt, jt); |
|
362 |
writer.write(thread_group_id); |
|
363 |
JfrThreadGroup::serialize(&writer, thread_group_id); |
|
364 |
return; |
|
365 |
} |
|
366 |
writer.write((const char*)NULL); // java name |
|
367 |
writer.write((traceid)0); // java thread id |
|
368 |
writer.write((traceid)0); // java thread group |
|
50113 | 369 |
} |