author | mgronlun |
Mon, 26 Aug 2019 13:09:14 +0200 | |
branch | JEP-349-branch |
changeset 57878 | bffba8d6611a |
parent 57870 | 00860d9caf4d |
child 57882 | 562f598d303c |
permissions | -rw-r--r-- |
50113 | 1 |
/* |
54623
1126f0607c70
8222811: Consolidate MutexLockerEx and MutexLocker
coleenp
parents:
52212
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" |
|
57360 | 26 |
#include "jfr/jfr.hpp" |
50703
0486d7749b8d
8205053: Decouple type registration from framework lifecycle
egahlin
parents:
50525
diff
changeset
|
27 |
#include "jfr/metadata/jfrSerializer.hpp" |
50113 | 28 |
#include "jfr/recorder/checkpoint/jfrCheckpointWriter.hpp" |
29 |
#include "jfr/recorder/checkpoint/types/jfrType.hpp" |
|
30 |
#include "jfr/recorder/checkpoint/types/jfrTypeManager.hpp" |
|
50703
0486d7749b8d
8205053: Decouple type registration from framework lifecycle
egahlin
parents:
50525
diff
changeset
|
31 |
#include "jfr/utilities/jfrDoublyLinkedList.hpp" |
50113 | 32 |
#include "jfr/utilities/jfrIterator.hpp" |
57878
bffba8d6611a
Thread metadata to include excluded threads, thread sampler to exclude excluded threads, thread name friend
mgronlun
parents:
57870
diff
changeset
|
33 |
#include "memory/resourceArea.hpp" |
bffba8d6611a
Thread metadata to include excluded threads, thread sampler to exclude excluded threads, thread name friend
mgronlun
parents:
57870
diff
changeset
|
34 |
#include "runtime/handles.inline.hpp" |
50113 | 35 |
#include "runtime/safepoint.hpp" |
36 |
#include "runtime/thread.inline.hpp" |
|
37 |
#include "utilities/exceptions.hpp" |
|
50703
0486d7749b8d
8205053: Decouple type registration from framework lifecycle
egahlin
parents:
50525
diff
changeset
|
38 |
#include "runtime/semaphore.hpp" |
50113 | 39 |
|
50703
0486d7749b8d
8205053: Decouple type registration from framework lifecycle
egahlin
parents:
50525
diff
changeset
|
40 |
class JfrSerializerRegistration : public JfrCHeapObj { |
0486d7749b8d
8205053: Decouple type registration from framework lifecycle
egahlin
parents:
50525
diff
changeset
|
41 |
private: |
0486d7749b8d
8205053: Decouple type registration from framework lifecycle
egahlin
parents:
50525
diff
changeset
|
42 |
JfrSerializerRegistration* _next; |
0486d7749b8d
8205053: Decouple type registration from framework lifecycle
egahlin
parents:
50525
diff
changeset
|
43 |
JfrSerializerRegistration* _prev; |
0486d7749b8d
8205053: Decouple type registration from framework lifecycle
egahlin
parents:
50525
diff
changeset
|
44 |
JfrSerializer* _serializer; |
0486d7749b8d
8205053: Decouple type registration from framework lifecycle
egahlin
parents:
50525
diff
changeset
|
45 |
mutable JfrCheckpointBlobHandle _cache; |
0486d7749b8d
8205053: Decouple type registration from framework lifecycle
egahlin
parents:
50525
diff
changeset
|
46 |
JfrTypeId _id; |
0486d7749b8d
8205053: Decouple type registration from framework lifecycle
egahlin
parents:
50525
diff
changeset
|
47 |
bool _permit_cache; |
50113 | 48 |
|
50703
0486d7749b8d
8205053: Decouple type registration from framework lifecycle
egahlin
parents:
50525
diff
changeset
|
49 |
public: |
0486d7749b8d
8205053: Decouple type registration from framework lifecycle
egahlin
parents:
50525
diff
changeset
|
50 |
JfrSerializerRegistration(JfrTypeId id, bool permit_cache, JfrSerializer* serializer) : |
0486d7749b8d
8205053: Decouple type registration from framework lifecycle
egahlin
parents:
50525
diff
changeset
|
51 |
_next(NULL), _prev(NULL), _serializer(serializer), _cache(), _id(id), _permit_cache(permit_cache) {} |
50113 | 52 |
|
50703
0486d7749b8d
8205053: Decouple type registration from framework lifecycle
egahlin
parents:
50525
diff
changeset
|
53 |
~JfrSerializerRegistration() { |
0486d7749b8d
8205053: Decouple type registration from framework lifecycle
egahlin
parents:
50525
diff
changeset
|
54 |
delete _serializer; |
0486d7749b8d
8205053: Decouple type registration from framework lifecycle
egahlin
parents:
50525
diff
changeset
|
55 |
} |
50113 | 56 |
|
50703
0486d7749b8d
8205053: Decouple type registration from framework lifecycle
egahlin
parents:
50525
diff
changeset
|
57 |
JfrSerializerRegistration* next() const { |
0486d7749b8d
8205053: Decouple type registration from framework lifecycle
egahlin
parents:
50525
diff
changeset
|
58 |
return _next; |
0486d7749b8d
8205053: Decouple type registration from framework lifecycle
egahlin
parents:
50525
diff
changeset
|
59 |
} |
50113 | 60 |
|
50703
0486d7749b8d
8205053: Decouple type registration from framework lifecycle
egahlin
parents:
50525
diff
changeset
|
61 |
void set_next(JfrSerializerRegistration* next) { |
0486d7749b8d
8205053: Decouple type registration from framework lifecycle
egahlin
parents:
50525
diff
changeset
|
62 |
_next = next; |
0486d7749b8d
8205053: Decouple type registration from framework lifecycle
egahlin
parents:
50525
diff
changeset
|
63 |
} |
0486d7749b8d
8205053: Decouple type registration from framework lifecycle
egahlin
parents:
50525
diff
changeset
|
64 |
|
0486d7749b8d
8205053: Decouple type registration from framework lifecycle
egahlin
parents:
50525
diff
changeset
|
65 |
JfrSerializerRegistration* prev() const { |
0486d7749b8d
8205053: Decouple type registration from framework lifecycle
egahlin
parents:
50525
diff
changeset
|
66 |
return _prev; |
0486d7749b8d
8205053: Decouple type registration from framework lifecycle
egahlin
parents:
50525
diff
changeset
|
67 |
} |
50113 | 68 |
|
50703
0486d7749b8d
8205053: Decouple type registration from framework lifecycle
egahlin
parents:
50525
diff
changeset
|
69 |
void set_prev(JfrSerializerRegistration* prev) { |
0486d7749b8d
8205053: Decouple type registration from framework lifecycle
egahlin
parents:
50525
diff
changeset
|
70 |
_prev = prev; |
0486d7749b8d
8205053: Decouple type registration from framework lifecycle
egahlin
parents:
50525
diff
changeset
|
71 |
} |
50113 | 72 |
|
50703
0486d7749b8d
8205053: Decouple type registration from framework lifecycle
egahlin
parents:
50525
diff
changeset
|
73 |
JfrTypeId id() const { |
0486d7749b8d
8205053: Decouple type registration from framework lifecycle
egahlin
parents:
50525
diff
changeset
|
74 |
return _id; |
0486d7749b8d
8205053: Decouple type registration from framework lifecycle
egahlin
parents:
50525
diff
changeset
|
75 |
} |
50113 | 76 |
|
50703
0486d7749b8d
8205053: Decouple type registration from framework lifecycle
egahlin
parents:
50525
diff
changeset
|
77 |
void invoke(JfrCheckpointWriter& writer) const; |
57360 | 78 |
|
79 |
void on_rotation() const; |
|
50703
0486d7749b8d
8205053: Decouple type registration from framework lifecycle
egahlin
parents:
50525
diff
changeset
|
80 |
}; |
0486d7749b8d
8205053: Decouple type registration from framework lifecycle
egahlin
parents:
50525
diff
changeset
|
81 |
|
0486d7749b8d
8205053: Decouple type registration from framework lifecycle
egahlin
parents:
50525
diff
changeset
|
82 |
void JfrSerializerRegistration::invoke(JfrCheckpointWriter& writer) const { |
50113 | 83 |
if (_cache.valid()) { |
84 |
writer.increment(); |
|
85 |
_cache->write(writer); |
|
86 |
return; |
|
87 |
} |
|
88 |
const JfrCheckpointContext ctx = writer.context(); |
|
50703
0486d7749b8d
8205053: Decouple type registration from framework lifecycle
egahlin
parents:
50525
diff
changeset
|
89 |
// serialize the type id before invoking callback |
50113 | 90 |
writer.write_type(_id); |
50703
0486d7749b8d
8205053: Decouple type registration from framework lifecycle
egahlin
parents:
50525
diff
changeset
|
91 |
const intptr_t start = writer.current_offset(); |
0486d7749b8d
8205053: Decouple type registration from framework lifecycle
egahlin
parents:
50525
diff
changeset
|
92 |
// invoke the serializer routine |
50113 | 93 |
_serializer->serialize(writer); |
50703
0486d7749b8d
8205053: Decouple type registration from framework lifecycle
egahlin
parents:
50525
diff
changeset
|
94 |
if (start == writer.current_offset() ) { |
0486d7749b8d
8205053: Decouple type registration from framework lifecycle
egahlin
parents:
50525
diff
changeset
|
95 |
// the serializer implementation did nothing, rewind to restore |
0486d7749b8d
8205053: Decouple type registration from framework lifecycle
egahlin
parents:
50525
diff
changeset
|
96 |
writer.set_context(ctx); |
0486d7749b8d
8205053: Decouple type registration from framework lifecycle
egahlin
parents:
50525
diff
changeset
|
97 |
return; |
0486d7749b8d
8205053: Decouple type registration from framework lifecycle
egahlin
parents:
50525
diff
changeset
|
98 |
} |
50113 | 99 |
if (_permit_cache) { |
100 |
_cache = writer.copy(&ctx); |
|
101 |
} |
|
102 |
} |
|
103 |
||
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
|
104 |
void JfrSerializerRegistration::on_rotation() const { |
57360 | 105 |
_serializer->on_rotation(); |
106 |
} |
|
107 |
||
50703
0486d7749b8d
8205053: Decouple type registration from framework lifecycle
egahlin
parents:
50525
diff
changeset
|
108 |
class SerializerRegistrationGuard : public StackObj { |
0486d7749b8d
8205053: Decouple type registration from framework lifecycle
egahlin
parents:
50525
diff
changeset
|
109 |
private: |
0486d7749b8d
8205053: Decouple type registration from framework lifecycle
egahlin
parents:
50525
diff
changeset
|
110 |
static Semaphore _mutex_semaphore; |
0486d7749b8d
8205053: Decouple type registration from framework lifecycle
egahlin
parents:
50525
diff
changeset
|
111 |
public: |
0486d7749b8d
8205053: Decouple type registration from framework lifecycle
egahlin
parents:
50525
diff
changeset
|
112 |
SerializerRegistrationGuard() { |
0486d7749b8d
8205053: Decouple type registration from framework lifecycle
egahlin
parents:
50525
diff
changeset
|
113 |
_mutex_semaphore.wait(); |
0486d7749b8d
8205053: Decouple type registration from framework lifecycle
egahlin
parents:
50525
diff
changeset
|
114 |
} |
0486d7749b8d
8205053: Decouple type registration from framework lifecycle
egahlin
parents:
50525
diff
changeset
|
115 |
~SerializerRegistrationGuard() { |
0486d7749b8d
8205053: Decouple type registration from framework lifecycle
egahlin
parents:
50525
diff
changeset
|
116 |
_mutex_semaphore.signal(); |
0486d7749b8d
8205053: Decouple type registration from framework lifecycle
egahlin
parents:
50525
diff
changeset
|
117 |
} |
0486d7749b8d
8205053: Decouple type registration from framework lifecycle
egahlin
parents:
50525
diff
changeset
|
118 |
}; |
0486d7749b8d
8205053: Decouple type registration from framework lifecycle
egahlin
parents:
50525
diff
changeset
|
119 |
|
0486d7749b8d
8205053: Decouple type registration from framework lifecycle
egahlin
parents:
50525
diff
changeset
|
120 |
Semaphore SerializerRegistrationGuard::_mutex_semaphore(1); |
0486d7749b8d
8205053: Decouple type registration from framework lifecycle
egahlin
parents:
50525
diff
changeset
|
121 |
|
0486d7749b8d
8205053: Decouple type registration from framework lifecycle
egahlin
parents:
50525
diff
changeset
|
122 |
typedef JfrDoublyLinkedList<JfrSerializerRegistration> List; |
0486d7749b8d
8205053: Decouple type registration from framework lifecycle
egahlin
parents:
50525
diff
changeset
|
123 |
typedef StopOnNullIterator<const List> Iterator; |
0486d7749b8d
8205053: Decouple type registration from framework lifecycle
egahlin
parents:
50525
diff
changeset
|
124 |
static List types; |
0486d7749b8d
8205053: Decouple type registration from framework lifecycle
egahlin
parents:
50525
diff
changeset
|
125 |
|
0486d7749b8d
8205053: Decouple type registration from framework lifecycle
egahlin
parents:
50525
diff
changeset
|
126 |
void JfrTypeManager::clear() { |
0486d7749b8d
8205053: Decouple type registration from framework lifecycle
egahlin
parents:
50525
diff
changeset
|
127 |
SerializerRegistrationGuard guard; |
0486d7749b8d
8205053: Decouple type registration from framework lifecycle
egahlin
parents:
50525
diff
changeset
|
128 |
Iterator iter(types); |
50113 | 129 |
JfrSerializerRegistration* registration; |
130 |
while (iter.has_next()) { |
|
50703
0486d7749b8d
8205053: Decouple type registration from framework lifecycle
egahlin
parents:
50525
diff
changeset
|
131 |
registration = types.remove(iter.next()); |
50113 | 132 |
assert(registration != NULL, "invariant"); |
133 |
delete registration; |
|
134 |
} |
|
135 |
} |
|
136 |
||
50703
0486d7749b8d
8205053: Decouple type registration from framework lifecycle
egahlin
parents:
50525
diff
changeset
|
137 |
void JfrTypeManager::write_types(JfrCheckpointWriter& writer) { |
0486d7749b8d
8205053: Decouple type registration from framework lifecycle
egahlin
parents:
50525
diff
changeset
|
138 |
const Iterator iter(types); |
50113 | 139 |
while (iter.has_next()) { |
50703
0486d7749b8d
8205053: Decouple type registration from framework lifecycle
egahlin
parents:
50525
diff
changeset
|
140 |
iter.next()->invoke(writer); |
50113 | 141 |
} |
142 |
} |
|
143 |
||
57360 | 144 |
void JfrTypeManager::notify_types_on_rotation() { |
145 |
const Iterator iter(types); |
|
50113 | 146 |
while (iter.has_next()) { |
57360 | 147 |
iter.next()->on_rotation(); |
50113 | 148 |
} |
149 |
} |
|
150 |
||
50703
0486d7749b8d
8205053: Decouple type registration from framework lifecycle
egahlin
parents:
50525
diff
changeset
|
151 |
void JfrTypeManager::write_type_set() { |
57360 | 152 |
assert(!SafepointSynchronize::is_at_safepoint(), "invariant"); |
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
|
153 |
JfrCheckpointWriter writer; |
50113 | 154 |
TypeSet set; |
155 |
set.serialize(writer); |
|
156 |
} |
|
157 |
||
50703
0486d7749b8d
8205053: Decouple type registration from framework lifecycle
egahlin
parents:
50525
diff
changeset
|
158 |
void JfrTypeManager::write_type_set_for_unloaded_classes() { |
57360 | 159 |
assert(SafepointSynchronize::is_at_safepoint(), "invariant"); |
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
|
160 |
JfrCheckpointWriter writer; |
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
|
161 |
const JfrCheckpointContext ctx = writer.context(); |
50113 | 162 |
ClassUnloadTypeSet class_unload_set; |
163 |
class_unload_set.serialize(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
|
164 |
if (!Jfr::is_recording()) { |
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
|
165 |
// discard anything written |
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
|
166 |
writer.set_context(ctx); |
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
|
167 |
} |
50113 | 168 |
} |
169 |
||
57360 | 170 |
size_t JfrTypeManager::flush_type_set() { |
171 |
assert(!SafepointSynchronize::is_at_safepoint(), "invariant"); |
|
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
|
172 |
JfrCheckpointWriter writer; |
57360 | 173 |
FlushTypeSet flush; |
174 |
flush.serialize(writer); |
|
175 |
return flush.elements(); |
|
176 |
} |
|
177 |
||
178 |
void JfrTypeManager::create_thread_checkpoint(Thread* t) { |
|
179 |
assert(t != NULL, "invariant"); |
|
57878
bffba8d6611a
Thread metadata to include excluded threads, thread sampler to exclude excluded threads, thread name friend
mgronlun
parents:
57870
diff
changeset
|
180 |
ResourceMark rm(t); |
bffba8d6611a
Thread metadata to include excluded threads, thread sampler to exclude excluded threads, thread name friend
mgronlun
parents:
57870
diff
changeset
|
181 |
HandleMark hm(t); |
57360 | 182 |
JfrThreadConstant type_thread(t); |
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
|
183 |
JfrCheckpointWriter writer(t); |
50113 | 184 |
writer.write_type(TYPE_THREAD); |
185 |
type_thread.serialize(writer); |
|
186 |
// create and install a checkpoint blob |
|
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
|
187 |
t->jfr_thread_local()->set_thread_checkpoint(writer.move()); |
57360 | 188 |
assert(t->jfr_thread_local()->has_thread_checkpoint(), "invariant"); |
50113 | 189 |
} |
190 |
||
57360 | 191 |
void JfrTypeManager::write_thread_checkpoint(Thread* t) { |
192 |
assert(t != NULL, "invariant"); |
|
57878
bffba8d6611a
Thread metadata to include excluded threads, thread sampler to exclude excluded threads, thread name friend
mgronlun
parents:
57870
diff
changeset
|
193 |
ResourceMark rm(t); |
bffba8d6611a
Thread metadata to include excluded threads, thread sampler to exclude excluded threads, thread name friend
mgronlun
parents:
57870
diff
changeset
|
194 |
HandleMark hm(t); |
57360 | 195 |
JfrThreadConstant type_thread(t); |
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
|
196 |
JfrCheckpointWriter writer(t); |
57360 | 197 |
writer.write_type(TYPE_THREAD); |
198 |
type_thread.serialize(writer); |
|
50113 | 199 |
} |
200 |
||
201 |
#ifdef ASSERT |
|
50703
0486d7749b8d
8205053: Decouple type registration from framework lifecycle
egahlin
parents:
50525
diff
changeset
|
202 |
static void assert_not_registered_twice(JfrTypeId id, List& list) { |
0486d7749b8d
8205053: Decouple type registration from framework lifecycle
egahlin
parents:
50525
diff
changeset
|
203 |
const Iterator iter(list); |
50113 | 204 |
while (iter.has_next()) { |
205 |
assert(iter.next()->id() != id, "invariant"); |
|
206 |
} |
|
207 |
} |
|
208 |
#endif |
|
209 |
||
57360 | 210 |
static bool register_type(JfrTypeId id, bool permit_cache, JfrSerializer* serializer) { |
50703
0486d7749b8d
8205053: Decouple type registration from framework lifecycle
egahlin
parents:
50525
diff
changeset
|
211 |
assert(serializer != NULL, "invariant"); |
0486d7749b8d
8205053: Decouple type registration from framework lifecycle
egahlin
parents:
50525
diff
changeset
|
212 |
JfrSerializerRegistration* const registration = new JfrSerializerRegistration(id, permit_cache, serializer); |
50113 | 213 |
if (registration == NULL) { |
50703
0486d7749b8d
8205053: Decouple type registration from framework lifecycle
egahlin
parents:
50525
diff
changeset
|
214 |
delete serializer; |
50113 | 215 |
return false; |
216 |
} |
|
57360 | 217 |
|
218 |
assert(!types.in_list(registration), "invariant"); |
|
219 |
DEBUG_ONLY(assert_not_registered_twice(id, types);) |
|
220 |
if (Jfr::is_recording()) { |
|
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
|
221 |
JfrCheckpointWriter writer; |
57360 | 222 |
registration->invoke(writer); |
50113 | 223 |
} |
57360 | 224 |
types.prepend(registration); |
50113 | 225 |
return true; |
226 |
} |
|
227 |
||
228 |
bool JfrTypeManager::initialize() { |
|
50703
0486d7749b8d
8205053: Decouple type registration from framework lifecycle
egahlin
parents:
50525
diff
changeset
|
229 |
SerializerRegistrationGuard guard; |
0486d7749b8d
8205053: Decouple type registration from framework lifecycle
egahlin
parents:
50525
diff
changeset
|
230 |
|
50113 | 231 |
// register non-safepointing type serialization |
57360 | 232 |
register_type(TYPE_THREADGROUP, false, new JfrThreadGroupConstant()); |
233 |
register_type(TYPE_THREAD, false, new JfrThreadConstantSet()); |
|
234 |
register_type(TYPE_FLAGVALUEORIGIN, true, new FlagValueOriginConstant()); |
|
235 |
register_type(TYPE_INFLATECAUSE, true, new MonitorInflateCauseConstant()); |
|
236 |
register_type(TYPE_GCCAUSE, true, new GCCauseConstant()); |
|
237 |
register_type(TYPE_GCNAME, true, new GCNameConstant()); |
|
238 |
register_type(TYPE_GCWHEN, true, new GCWhenConstant()); |
|
239 |
register_type(TYPE_G1HEAPREGIONTYPE, true, new G1HeapRegionTypeConstant()); |
|
240 |
register_type(TYPE_GCTHRESHOLDUPDATER, true, new GCThresholdUpdaterConstant()); |
|
241 |
register_type(TYPE_METADATATYPE, true, new MetadataTypeConstant()); |
|
242 |
register_type(TYPE_METASPACEOBJECTTYPE, true, new MetaspaceObjectTypeConstant()); |
|
243 |
register_type(TYPE_G1YCTYPE, true, new G1YCTypeConstant()); |
|
244 |
register_type(TYPE_REFERENCETYPE, true, new ReferenceTypeConstant()); |
|
245 |
register_type(TYPE_NARROWOOPMODE, true, new NarrowOopModeConstant()); |
|
246 |
register_type(TYPE_COMPILERPHASETYPE, true, new CompilerPhaseTypeConstant()); |
|
247 |
register_type(TYPE_CODEBLOBTYPE, true, new CodeBlobTypeConstant()); |
|
248 |
register_type(TYPE_VMOPERATIONTYPE, true, new VMOperationTypeConstant()); |
|
249 |
register_type(TYPE_THREADSTATE, true, new ThreadStateConstant()); |
|
50113 | 250 |
|
251 |
return true; |
|
252 |
} |
|
253 |
||
50703
0486d7749b8d
8205053: Decouple type registration from framework lifecycle
egahlin
parents:
50525
diff
changeset
|
254 |
// implementation for the static registration function exposed in the JfrSerializer api |
57360 | 255 |
bool JfrSerializer::register_serializer(JfrTypeId id, bool permit_cache, JfrSerializer* serializer) { |
50703
0486d7749b8d
8205053: Decouple type registration from framework lifecycle
egahlin
parents:
50525
diff
changeset
|
256 |
SerializerRegistrationGuard guard; |
57360 | 257 |
return register_type(id, permit_cache, serializer); |
50703
0486d7749b8d
8205053: Decouple type registration from framework lifecycle
egahlin
parents:
50525
diff
changeset
|
258 |
} |