-
Notifications
You must be signed in to change notification settings - Fork 226
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(swingset): add slogging framework
This adds a set of logging hooks which record swingset deliveries (the kernel sending messages and resolution notifications into vats), syscalls (from the vat into the kernel), and console messages. All these events can be correlated by their crank number, vatID, delivery number, and syscall number. The output function is not yet implemented; my notional plan is to log to lines of JSON for now, and maybe move to a SQLite based store for later. I've not written any analysis tools yet either. I made a few refactorings to make things smoother: * vats get their console object from `managerOptions.vatConsole`, rather than having the manager build it themselves, which makes it easier to provide one that writes to both the regular console and the slog * as a result, all vats get the same basic `vatEndowments` (with the console added on later), rather than calling `makeVatEndowments(vatID)` * in kernel.js, `deliverToVat` and `processNotify` had their common code factored out into `deliverAndLogToVat()`, which now writes to the slog in addition to actually performing the `manager.deliver`. The names aren't great and want to be changed at some point. * `buildVatSyscallHandler` function was moved out of `addVatManager` to make things easier to read. The new function writes syscalls to the slog. * console messages written by vats in top-level code, or during the execution of `buildRootObject`, are slogged in the "startup" phase. All other calls to `console.log` and friends are recorded in a "delivery" phase. The slog is disabled during test-kernel.js and test-vpid-kernel.js, because these tests make syscalls outside the context of a delivery, which is normally illegal, and the slog complains bitterly when it happens. refs #1535
- Loading branch information
Showing
9 changed files
with
281 additions
and
99 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.