From f611583b71fdf68f336bb9ae6ac3fa0cf87924ba Mon Sep 17 00:00:00 2001 From: Joyee Cheung Date: Mon, 18 Sep 2023 14:32:40 +0200 Subject: [PATCH] src: use SNAPSHOT_SERDES to log snapshot ser/deserialization To avoid clobbering output of MKSNAPSHOT PR-URL: https://github.com/nodejs/node/pull/49637 Reviewed-By: Darshan Sen Reviewed-By: James M Snell --- src/debug_utils.h | 1 + src/node_snapshotable.cc | 5 +++-- 2 files changed, 4 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..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::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);