Skip to content

Commit f611583

Browse files
joyeecheungruyadorno
authored andcommitted
src: use SNAPSHOT_SERDES to log snapshot ser/deserialization
To avoid clobbering output of MKSNAPSHOT PR-URL: #49637 Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent a597cb8 commit f611583

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/debug_utils.h

+1
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ void NODE_EXTERN_PRIVATE FWrite(FILE* file, const std::string& str);
5151
V(SEA) \
5252
V(WASI) \
5353
V(MKSNAPSHOT) \
54+
V(SNAPSHOT_SERDES) \
5455
V(PERMISSION_MODEL)
5556

5657
enum class DebugCategory : unsigned int {

src/node_snapshotable.cc

+3-2
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,8 @@ class SnapshotDeserializer : public BlobDeserializer<SnapshotDeserializer> {
145145
public:
146146
explicit SnapshotDeserializer(std::string_view v)
147147
: BlobDeserializer<SnapshotDeserializer>(
148-
per_process::enabled_debug_list.enabled(DebugCategory::MKSNAPSHOT),
148+
per_process::enabled_debug_list.enabled(
149+
DebugCategory::SNAPSHOT_SERDES),
149150
v) {}
150151

151152
template <typename T,
@@ -159,7 +160,7 @@ class SnapshotSerializer : public BlobSerializer<SnapshotSerializer> {
159160
SnapshotSerializer()
160161
: BlobSerializer<SnapshotSerializer>(
161162
per_process::enabled_debug_list.enabled(
162-
DebugCategory::MKSNAPSHOT)) {
163+
DebugCategory::SNAPSHOT_SERDES)) {
163164
// Currently the snapshot blob built with an empty script is around 4MB.
164165
// So use that as the default sink size.
165166
sink.reserve(4 * 1024 * 1024);

0 commit comments

Comments
 (0)