From 6be50bcfe97d1da30f4a5917c42e1578a18bf796 Mon Sep 17 00:00:00 2001 From: Joyee Cheung Date: Wed, 13 Sep 2023 15:18:28 +0200 Subject: [PATCH 1/2] src: use SNAPSHOT_SERDES to log snapshot ser/deserialization To avoid clobbering output of MKSNAPSHOT --- src/debug_utils.h | 1 + src/node_snapshotable.cc | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/debug_utils.h b/src/debug_utils.h index 31c929f122cd1f..280b4cb39c780a 100644 --- a/src/debug_utils.h +++ b/src/debug_utils.h @@ -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 { diff --git a/src/node_snapshotable.cc b/src/node_snapshotable.cc index 2c10f176c94033..fe5c15ad9af4d2 100644 --- a/src/node_snapshotable.cc +++ b/src/node_snapshotable.cc @@ -145,7 +145,7 @@ class SnapshotDeserializer : public BlobDeserializer { public: explicit SnapshotDeserializer(std::string_view v) : BlobDeserializer( - per_process::enabled_debug_list.enabled(DebugCategory::MKSNAPSHOT), + per_process::enabled_debug_list.enabled(DebugCategory::SNAPSHOT_SERDES), v) {} template { SnapshotSerializer() : BlobSerializer( 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); From 83cb3a4b0c1c8ad5b7efcc0019ea05b62f6751b7 Mon Sep 17 00:00:00 2001 From: Joyee Cheung Date: Fri, 15 Sep 2023 13:17:57 +0200 Subject: [PATCH 2/2] fixup! src: use SNAPSHOT_SERDES to log snapshot ser/deserialization --- src/node_snapshotable.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/node_snapshotable.cc b/src/node_snapshotable.cc index fe5c15ad9af4d2..562a47ddcc9c8e 100644 --- a/src/node_snapshotable.cc +++ b/src/node_snapshotable.cc @@ -145,7 +145,8 @@ class SnapshotDeserializer : public BlobDeserializer { public: explicit SnapshotDeserializer(std::string_view v) : BlobDeserializer( - per_process::enabled_debug_list.enabled(DebugCategory::SNAPSHOT_SERDES), + per_process::enabled_debug_list.enabled( + DebugCategory::SNAPSHOT_SERDES), v) {} template