Skip to content

Commit

Permalink
change shape of initialize/snapshot transcript entries, slog entries
Browse files Browse the repository at this point in the history
The load-snapshot event is now `['load-snapshot', { snapshotID }]`, to
make room for other options like which version of xsnap to use.

The save-snapshot event results are still `['ok', hash]` except the
type now thinks of the second element as `snapshotID` instead of
`hash`.

The initialize-worker event is now `['initialize-worker',
workerOptions]`, which records the worker type, as well as the helper
bundle IDs (lockdown/supervisor).

In the slog, the `heap-snapshot-save` event details now contain
`snapshotID` instead of `hash`, to be consistent.
  • Loading branch information
warner committed Apr 23, 2023
1 parent 7a91a5d commit d9dbcbb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
9 changes: 5 additions & 4 deletions packages/SwingSet/src/kernel/state/vatKeeper.js
Original file line number Diff line number Diff line change
Expand Up @@ -539,7 +539,7 @@ export function makeVatKeeper(
const info = await manager.makeSnapshot(endPosition, snapStore);

const {
hash,
hash: snapshotID,
uncompressedSize,
rawSaveSeconds,
compressedSize,
Expand All @@ -550,7 +550,7 @@ export function makeVatKeeper(
addToTranscript({
d: /** @type {TDSaveSnapshot} */ ['save-snapshot'],
sc: [],
r: /** @type {TDSaveSnapshotResults} */ { status: 'ok', hash },
r: /** @type {TDSaveSnapshotResults} */ { status: 'ok', snapshotID },
});

// then start a new transcript span
Expand All @@ -559,16 +559,17 @@ export function makeVatKeeper(
// then push a load-snapshot entry, so that the current span
// always starts with an initialize-worker or load-snapshot
// pseudo-delivery
const loadConfig = { snapshotID };
addToTranscript({
d: /** @type {TDLoadSnapshot} */ ['load-snapshot', hash],
d: /** @type {TDLoadSnapshot} */ ['load-snapshot', loadConfig],
sc: [],
r: { status: 'ok' },
});

kernelSlog.write({
type: 'heap-snapshot-save',
vatID,
hash,
snapshotID,
uncompressedSize,
rawSaveSeconds,
compressedSize,
Expand Down
3 changes: 2 additions & 1 deletion packages/SwingSet/src/kernel/vat-warehouse.js
Original file line number Diff line number Diff line change
Expand Up @@ -325,8 +325,9 @@ export function makeVatWarehouse({
// initialize-worker event, to represent the vatLoader.create()
// we're about to do
if (options.useTranscript && vatKeeper.transcriptSize() === 0) {
const wo = options.workerOptions;
vatKeeper.addToTranscript({
d: /** @type {TDInitializeWorker} */ ['initialize-worker'],
d: /** @type {TDInitializeWorker} */ ['initialize-worker', wo],
sc: [],
r: { status: 'ok' },
});
Expand Down

0 comments on commit d9dbcbb

Please sign in to comment.