Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

src: use SNAPSHOT_SERDES to log snapshot ser/deserialization #49637

Merged
merged 2 commits into from
Sep 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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