Skip to content

Commit

Permalink
src: use SNAPSHOT_SERDES to log snapshot ser/deserialization
Browse files Browse the repository at this point in the history
To avoid clobbering output of MKSNAPSHOT

PR-URL: #49637
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
joyeecheung authored and ruyadorno committed Sep 28, 2023
1 parent a597cb8 commit f611583
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/debug_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ void NODE_EXTERN_PRIVATE FWrite(FILE* file, const std::string& str);
V(SEA) \
V(WASI) \
V(MKSNAPSHOT) \
V(SNAPSHOT_SERDES) \
V(PERMISSION_MODEL)

enum class DebugCategory : unsigned int {
Expand Down
5 changes: 3 additions & 2 deletions src/node_snapshotable.cc
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,8 @@ class SnapshotDeserializer : public BlobDeserializer<SnapshotDeserializer> {
public:
explicit SnapshotDeserializer(std::string_view v)
: BlobDeserializer<SnapshotDeserializer>(
per_process::enabled_debug_list.enabled(DebugCategory::MKSNAPSHOT),
per_process::enabled_debug_list.enabled(
DebugCategory::SNAPSHOT_SERDES),
v) {}

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

0 comments on commit f611583

Please sign in to comment.