author | mgronlun |
Sun, 15 Sep 2019 13:41:19 +0200 | |
branch | JEP-349-branch |
changeset 58157 | 9dca61a7df19 |
parent 58154 | 060d9d139109 |
parent 58132 | caa25ab47aca |
child 58158 | 369ebc2a11c2 |
permissions | -rw-r--r-- |
50113 | 1 |
/* |
57644
446dcfc2a925
8228834: Regression caused by JDK-8214542 not installing complete checkpoint data to candidates
mgronlun
parents:
55571
diff
changeset
|
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 |
||
58 |
// Requires a ResourceMark for get_thread_name/as_utf8 |
|
59 |
class JfrCheckpointThreadClosure : public ThreadClosure { |
|
60 |
private: |
|
61 |
JfrCheckpointWriter& _writer; |
|
51004
162867fa0f8d
8203943: eventThreadGroup was null in TestJavaBlockedEvent.java
mgronlun
parents:
50749
diff
changeset
|
62 |
JfrCheckpointContext _ctx; |
53897
0abec72a3ac2
8217647: JFR: recordings on 32-bit systems unreadable
bulasevich
parents:
52877
diff
changeset
|
63 |
const int64_t _count_position; |
51004
162867fa0f8d
8203943: eventThreadGroup was null in TestJavaBlockedEvent.java
mgronlun
parents:
50749
diff
changeset
|
64 |
Thread* const _curthread; |
162867fa0f8d
8203943: eventThreadGroup was null in TestJavaBlockedEvent.java
mgronlun
parents:
50749
diff
changeset
|
65 |
u4 _count; |
162867fa0f8d
8203943: eventThreadGroup was null in TestJavaBlockedEvent.java
mgronlun
parents:
50749
diff
changeset
|
66 |
|
50113 | 67 |
public: |
51004
162867fa0f8d
8203943: eventThreadGroup was null in TestJavaBlockedEvent.java
mgronlun
parents:
50749
diff
changeset
|
68 |
JfrCheckpointThreadClosure(JfrCheckpointWriter& writer) : _writer(writer), |
162867fa0f8d
8203943: eventThreadGroup was null in TestJavaBlockedEvent.java
mgronlun
parents:
50749
diff
changeset
|
69 |
_ctx(writer.context()), |
162867fa0f8d
8203943: eventThreadGroup was null in TestJavaBlockedEvent.java
mgronlun
parents:
50749
diff
changeset
|
70 |
_count_position(writer.reserve(sizeof(u4))), |
162867fa0f8d
8203943: eventThreadGroup was null in TestJavaBlockedEvent.java
mgronlun
parents:
50749
diff
changeset
|
71 |
_curthread(Thread::current()), |
162867fa0f8d
8203943: eventThreadGroup was null in TestJavaBlockedEvent.java
mgronlun
parents:
50749
diff
changeset
|
72 |
_count(0) { |
162867fa0f8d
8203943: eventThreadGroup was null in TestJavaBlockedEvent.java
mgronlun
parents:
50749
diff
changeset
|
73 |
} |
162867fa0f8d
8203943: eventThreadGroup was null in TestJavaBlockedEvent.java
mgronlun
parents:
50749
diff
changeset
|
74 |
|
162867fa0f8d
8203943: eventThreadGroup was null in TestJavaBlockedEvent.java
mgronlun
parents:
50749
diff
changeset
|
75 |
~JfrCheckpointThreadClosure() { |
162867fa0f8d
8203943: eventThreadGroup was null in TestJavaBlockedEvent.java
mgronlun
parents:
50749
diff
changeset
|
76 |
if (_count == 0) { |
162867fa0f8d
8203943: eventThreadGroup was null in TestJavaBlockedEvent.java
mgronlun
parents:
50749
diff
changeset
|
77 |
// restore |
162867fa0f8d
8203943: eventThreadGroup was null in TestJavaBlockedEvent.java
mgronlun
parents:
50749
diff
changeset
|
78 |
_writer.set_context(_ctx); |
162867fa0f8d
8203943: eventThreadGroup was null in TestJavaBlockedEvent.java
mgronlun
parents:
50749
diff
changeset
|
79 |
return; |
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 |
_writer.write_count(_count, _count_position); |
162867fa0f8d
8203943: eventThreadGroup was null in TestJavaBlockedEvent.java
mgronlun
parents:
50749
diff
changeset
|
82 |
} |
162867fa0f8d
8203943: eventThreadGroup was null in TestJavaBlockedEvent.java
mgronlun
parents:
50749
diff
changeset
|
83 |
|
50113 | 84 |
void do_thread(Thread* t); |
85 |
}; |
|
86 |
||
87 |
void JfrCheckpointThreadClosure::do_thread(Thread* t) { |
|
88 |
assert(t != NULL, "invariant"); |
|
51004
162867fa0f8d
8203943: eventThreadGroup was null in TestJavaBlockedEvent.java
mgronlun
parents:
50749
diff
changeset
|
89 |
++_count; |
57878
bffba8d6611a
Thread metadata to include excluded threads, thread sampler to exclude excluded threads, thread name friend
mgronlun
parents:
57870
diff
changeset
|
90 |
_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
|
91 |
const char* const name = JfrThreadName::name(t); |
58049 | 92 |
assert(name != NULL, "invariant"); |
57878
bffba8d6611a
Thread metadata to include excluded threads, thread sampler to exclude excluded threads, thread name friend
mgronlun
parents:
57870
diff
changeset
|
93 |
_writer.write(name); |
bffba8d6611a
Thread metadata to include excluded threads, thread sampler to exclude excluded threads, thread name friend
mgronlun
parents:
57870
diff
changeset
|
94 |
_writer.write<traceid>(JfrThreadId::os_id(t)); |
50113 | 95 |
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
|
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(JfrThreadId::id(t)); |
58049 | 98 |
_writer.write(JfrThreadGroup::thread_group_id((JavaThread*)t, _curthread)); |
50113 | 99 |
return; |
100 |
} |
|
101 |
_writer.write((const char*)NULL); // java name |
|
51004
162867fa0f8d
8203943: eventThreadGroup was null in TestJavaBlockedEvent.java
mgronlun
parents:
50749
diff
changeset
|
102 |
_writer.write((traceid)0); // java thread id |
162867fa0f8d
8203943: eventThreadGroup was null in TestJavaBlockedEvent.java
mgronlun
parents:
50749
diff
changeset
|
103 |
_writer.write((traceid)0); // java thread group |
50113 | 104 |
} |
105 |
||
106 |
void JfrThreadConstantSet::serialize(JfrCheckpointWriter& writer) { |
|
107 |
JfrCheckpointThreadClosure tc(writer); |
|
57360 | 108 |
JfrJavaThreadIterator javathreads; |
109 |
while (javathreads.has_next()) { |
|
110 |
tc.do_thread(javathreads.next()); |
|
111 |
} |
|
112 |
JfrNonJavaThreadIterator nonjavathreads; |
|
113 |
while (nonjavathreads.has_next()) { |
|
114 |
tc.do_thread(nonjavathreads.next()); |
|
115 |
} |
|
50113 | 116 |
} |
117 |
||
118 |
void JfrThreadGroupConstant::serialize(JfrCheckpointWriter& writer) { |
|
119 |
JfrThreadGroup::serialize(writer); |
|
120 |
} |
|
121 |
||
122 |
static const char* flag_value_origin_to_string(JVMFlag::Flags origin) { |
|
123 |
switch (origin) { |
|
124 |
case JVMFlag::DEFAULT: return "Default"; |
|
125 |
case JVMFlag::COMMAND_LINE: return "Command line"; |
|
126 |
case JVMFlag::ENVIRON_VAR: return "Environment variable"; |
|
127 |
case JVMFlag::CONFIG_FILE: return "Config file"; |
|
128 |
case JVMFlag::MANAGEMENT: return "Management"; |
|
129 |
case JVMFlag::ERGONOMIC: return "Ergonomic"; |
|
130 |
case JVMFlag::ATTACH_ON_DEMAND: return "Attach on demand"; |
|
131 |
case JVMFlag::INTERNAL: return "Internal"; |
|
132 |
default: ShouldNotReachHere(); return ""; |
|
133 |
} |
|
134 |
} |
|
135 |
||
136 |
void FlagValueOriginConstant::serialize(JfrCheckpointWriter& writer) { |
|
137 |
static const u4 nof_entries = JVMFlag::LAST_VALUE_ORIGIN + 1; |
|
138 |
writer.write_count(nof_entries); |
|
139 |
for (u4 i = 0; i < nof_entries; ++i) { |
|
140 |
writer.write_key(i); |
|
141 |
writer.write(flag_value_origin_to_string((JVMFlag::Flags)i)); |
|
142 |
} |
|
143 |
} |
|
144 |
||
145 |
void MonitorInflateCauseConstant::serialize(JfrCheckpointWriter& writer) { |
|
146 |
static const u4 nof_entries = ObjectSynchronizer::inflate_cause_nof; |
|
147 |
writer.write_count(nof_entries); |
|
148 |
for (u4 i = 0; i < nof_entries; ++i) { |
|
149 |
writer.write_key(i); |
|
150 |
writer.write(ObjectSynchronizer::inflate_cause_name((ObjectSynchronizer::InflateCause)i)); |
|
151 |
} |
|
152 |
} |
|
153 |
||
154 |
void GCCauseConstant::serialize(JfrCheckpointWriter& writer) { |
|
155 |
static const u4 nof_entries = GCCause::_last_gc_cause; |
|
156 |
writer.write_count(nof_entries); |
|
157 |
for (u4 i = 0; i < nof_entries; ++i) { |
|
158 |
writer.write_key(i); |
|
159 |
writer.write(GCCause::to_string((GCCause::Cause)i)); |
|
160 |
} |
|
161 |
} |
|
162 |
||
163 |
void GCNameConstant::serialize(JfrCheckpointWriter& writer) { |
|
164 |
static const u4 nof_entries = GCNameEndSentinel; |
|
165 |
writer.write_count(nof_entries); |
|
166 |
for (u4 i = 0; i < nof_entries; ++i) { |
|
167 |
writer.write_key(i); |
|
168 |
writer.write(GCNameHelper::to_string((GCName)i)); |
|
169 |
} |
|
170 |
} |
|
171 |
||
172 |
void GCWhenConstant::serialize(JfrCheckpointWriter& writer) { |
|
173 |
static const u4 nof_entries = GCWhen::GCWhenEndSentinel; |
|
174 |
writer.write_count(nof_entries); |
|
175 |
for (u4 i = 0; i < nof_entries; ++i) { |
|
176 |
writer.write_key(i); |
|
177 |
writer.write(GCWhen::to_string((GCWhen::Type)i)); |
|
178 |
} |
|
179 |
} |
|
180 |
||
181 |
void GCThresholdUpdaterConstant::serialize(JfrCheckpointWriter& writer) { |
|
182 |
static const u4 nof_entries = MetaspaceGCThresholdUpdater::Last; |
|
183 |
writer.write_count(nof_entries); |
|
184 |
for (u4 i = 0; i < nof_entries; ++i) { |
|
185 |
writer.write_key(i); |
|
186 |
writer.write(MetaspaceGCThresholdUpdater::to_string((MetaspaceGCThresholdUpdater::Type)i)); |
|
187 |
} |
|
188 |
} |
|
189 |
||
190 |
void MetadataTypeConstant::serialize(JfrCheckpointWriter& writer) { |
|
191 |
static const u4 nof_entries = Metaspace::MetadataTypeCount; |
|
192 |
writer.write_count(nof_entries); |
|
193 |
for (u4 i = 0; i < nof_entries; ++i) { |
|
194 |
writer.write_key(i); |
|
195 |
writer.write(Metaspace::metadata_type_name((Metaspace::MetadataType)i)); |
|
196 |
} |
|
197 |
} |
|
198 |
||
199 |
void MetaspaceObjectTypeConstant::serialize(JfrCheckpointWriter& writer) { |
|
200 |
static const u4 nof_entries = MetaspaceObj::_number_of_types; |
|
201 |
writer.write_count(nof_entries); |
|
202 |
for (u4 i = 0; i < nof_entries; ++i) { |
|
203 |
writer.write_key(i); |
|
204 |
writer.write(MetaspaceObj::type_name((MetaspaceObj::Type)i)); |
|
205 |
} |
|
206 |
} |
|
207 |
||
208 |
static const char* reference_type_to_string(ReferenceType rt) { |
|
209 |
switch (rt) { |
|
210 |
case REF_NONE: return "None reference"; |
|
211 |
case REF_OTHER: return "Other reference"; |
|
212 |
case REF_SOFT: return "Soft reference"; |
|
213 |
case REF_WEAK: return "Weak reference"; |
|
214 |
case REF_FINAL: return "Final reference"; |
|
215 |
case REF_PHANTOM: return "Phantom reference"; |
|
216 |
default: |
|
217 |
ShouldNotReachHere(); |
|
218 |
return NULL; |
|
219 |
} |
|
220 |
} |
|
221 |
||
222 |
void ReferenceTypeConstant::serialize(JfrCheckpointWriter& writer) { |
|
223 |
static const u4 nof_entries = REF_PHANTOM + 1; |
|
224 |
writer.write_count(nof_entries); |
|
225 |
for (u4 i = 0; i < nof_entries; ++i) { |
|
226 |
writer.write_key(i); |
|
227 |
writer.write(reference_type_to_string((ReferenceType)i)); |
|
228 |
} |
|
229 |
} |
|
230 |
||
231 |
void NarrowOopModeConstant::serialize(JfrCheckpointWriter& writer) { |
|
54780
f8d182aedc92
8223136: Move compressed oops functions to CompressedOops class
stefank
parents:
53897
diff
changeset
|
232 |
static const u4 nof_entries = CompressedOops::HeapBasedNarrowOop + 1; |
50113 | 233 |
writer.write_count(nof_entries); |
234 |
for (u4 i = 0; i < nof_entries; ++i) { |
|
235 |
writer.write_key(i); |
|
54780
f8d182aedc92
8223136: Move compressed oops functions to CompressedOops class
stefank
parents:
53897
diff
changeset
|
236 |
writer.write(CompressedOops::mode_to_string((CompressedOops::Mode)i)); |
50113 | 237 |
} |
238 |
} |
|
239 |
||
240 |
void CompilerPhaseTypeConstant::serialize(JfrCheckpointWriter& writer) { |
|
241 |
#ifdef COMPILER2 |
|
242 |
static const u4 nof_entries = PHASE_NUM_TYPES; |
|
243 |
writer.write_count(nof_entries); |
|
244 |
for (u4 i = 0; i < nof_entries; ++i) { |
|
245 |
writer.write_key(i); |
|
246 |
writer.write(CompilerPhaseTypeHelper::to_string((CompilerPhaseType)i)); |
|
247 |
} |
|
248 |
#endif |
|
249 |
} |
|
250 |
||
251 |
void CodeBlobTypeConstant::serialize(JfrCheckpointWriter& writer) { |
|
252 |
static const u4 nof_entries = CodeBlobType::NumTypes; |
|
253 |
writer.write_count(nof_entries); |
|
254 |
for (u4 i = 0; i < nof_entries; ++i) { |
|
255 |
writer.write_key(i); |
|
256 |
writer.write(CodeCache::get_code_heap_name(i)); |
|
257 |
} |
|
258 |
}; |
|
259 |
||
260 |
void VMOperationTypeConstant::serialize(JfrCheckpointWriter& writer) { |
|
261 |
static const u4 nof_entries = VM_Operation::VMOp_Terminating; |
|
262 |
writer.write_count(nof_entries); |
|
263 |
for (u4 i = 0; i < nof_entries; ++i) { |
|
264 |
writer.write_key(i); |
|
265 |
writer.write(VM_Operation::name(VM_Operation::VMOp_Type(i))); |
|
266 |
} |
|
267 |
} |
|
268 |
||
269 |
class TypeSetSerialization { |
|
270 |
private: |
|
58132
caa25ab47aca
8225797: OldObjectSample event creates unexpected amount of checkpoint data
mgronlun
parents:
58003
diff
changeset
|
271 |
JfrCheckpointWriter* _leakp_writer; |
57360 | 272 |
size_t _elements; |
50113 | 273 |
bool _class_unload; |
57360 | 274 |
bool _flushpoint; |
50113 | 275 |
public: |
57983
a57907813a83
old object sample blob:ification and serialization support
mgronlun
parents:
57878
diff
changeset
|
276 |
TypeSetSerialization(bool class_unload, bool flushpoint, JfrCheckpointWriter* leakp_writer = NULL) : |
a57907813a83
old object sample blob:ification and serialization support
mgronlun
parents:
57878
diff
changeset
|
277 |
_leakp_writer(leakp_writer), _elements(0), _class_unload(class_unload), _flushpoint(flushpoint) {} |
58132
caa25ab47aca
8225797: OldObjectSample event creates unexpected amount of checkpoint data
mgronlun
parents:
58003
diff
changeset
|
278 |
void write(JfrCheckpointWriter& writer) { |
57983
a57907813a83
old object sample blob:ification and serialization support
mgronlun
parents:
57878
diff
changeset
|
279 |
_elements = JfrTypeSet::serialize(&writer, _leakp_writer, _class_unload, _flushpoint); |
57360 | 280 |
} |
281 |
size_t elements() const { |
|
282 |
return _elements; |
|
50113 | 283 |
} |
284 |
}; |
|
285 |
||
286 |
void ClassUnloadTypeSet::serialize(JfrCheckpointWriter& writer) { |
|
57360 | 287 |
TypeSetSerialization type_set(true, false); |
58132
caa25ab47aca
8225797: OldObjectSample event creates unexpected amount of checkpoint data
mgronlun
parents:
58003
diff
changeset
|
288 |
type_set.write(writer); |
50113 | 289 |
}; |
290 |
||
58132
caa25ab47aca
8225797: OldObjectSample event creates unexpected amount of checkpoint data
mgronlun
parents:
58003
diff
changeset
|
291 |
TypeSet::TypeSet(JfrCheckpointWriter* leakp_writer) : _leakp_writer(leakp_writer) {} |
caa25ab47aca
8225797: OldObjectSample event creates unexpected amount of checkpoint data
mgronlun
parents:
58003
diff
changeset
|
292 |
|
57360 | 293 |
void FlushTypeSet::serialize(JfrCheckpointWriter& writer) { |
294 |
assert(!SafepointSynchronize::is_at_safepoint(), "invariant"); |
|
58157 | 295 |
TypeSetSerialization type_set(false); |
296 |
type_set.write(writer, &leakp_writer); |
|
57360 | 297 |
_elements = type_set.elements(); |
298 |
} |
|
299 |
||
300 |
size_t FlushTypeSet::elements() const { |
|
58157 | 301 |
return; |
57360 | 302 |
|
57983
a57907813a83
old object sample blob:ification and serialization support
mgronlun
parents:
57878
diff
changeset
|
303 |
TypeSet::TypeSet(JfrCheckpointWriter* leakp_writer) : _leakp_writer(leakp_writer) {} |
a57907813a83
old object sample blob:ification and serialization support
mgronlun
parents:
57878
diff
changeset
|
304 |
|
50113 | 305 |
void TypeSet::serialize(JfrCheckpointWriter& writer) { |
57983
a57907813a83
old object sample blob:ification and serialization support
mgronlun
parents:
57878
diff
changeset
|
306 |
TypeSetSerialization type_set(false, false, _leakp_writer); |
58132
caa25ab47aca
8225797: OldObjectSample event creates unexpected amount of checkpoint data
mgronlun
parents:
58003
diff
changeset
|
307 |
type_set.write(writer); |
50113 | 308 |
}; |
309 |
||
310 |
void ThreadStateConstant::serialize(JfrCheckpointWriter& writer) { |
|
311 |
JfrThreadState::serialize(writer); |
|
312 |
} |
|
313 |
||
314 |
void JfrThreadConstant::serialize(JfrCheckpointWriter& writer) { |
|
315 |
assert(_thread != NULL, "invariant"); |
|
316 |
assert(_thread == Thread::current(), "invariant"); |
|
317 |
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
|
318 |
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
|
319 |
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
|
320 |
writer.write(name); |
bffba8d6611a
Thread metadata to include excluded threads, thread sampler to exclude excluded threads, thread name friend
mgronlun
parents:
57870
diff
changeset
|
321 |
writer.write(JfrThreadId::os_id(_thread)); |
57360 | 322 |
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
|
323 |
writer.write(name); |
bffba8d6611a
Thread metadata to include excluded threads, thread sampler to exclude excluded threads, thread name friend
mgronlun
parents:
57870
diff
changeset
|
324 |
writer.write(JfrThreadId::id(_thread)); |
57360 | 325 |
JavaThread* const jt = (JavaThread*)_thread; |
326 |
const traceid thread_group_id = JfrThreadGroup::thread_group_id(jt, jt); |
|
327 |
writer.write(thread_group_id); |
|
328 |
JfrThreadGroup::serialize(&writer, thread_group_id); |
|
329 |
return; |
|
330 |
} |
|
331 |
writer.write((const char*)NULL); // java name |
|
332 |
writer.write((traceid)0); // java thread id |
|
333 |
writer.write((traceid)0); // java thread group |
|
50113 | 334 |
} |