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