Expand description
Module contains macroses that help tracing DETLOG entires for the purpose of verifiying determinism [‘detlog’] can be used to write a deterministic log entry at INFO level [’detlog_debug] can be use to write a deterministic log entry at DEBUG level
Structs§
- Coordinator
Forwarding Receipt - A coordinator-local observation of a checked forwarding boundary.
- DetLog
Record - Versioned serialized form appended to the human log record.
- Forward
Policy - Which emitting modules a forwarded process may send DETLOG records from.
- Native
Forwarded Source Receipt - Coordinator-local source identity retained at native source registration. It does not authenticate an image or authorize any exec/lifecycle transition.
Enums§
- Coordinator
Forwarding CutError - Why the coordinator cannot establish a strict counted forwarding boundary.
- DetLog
Event - Producer-owned facts needed by log comparison.
- Forwarding
CutError - Why the process-local forwarding state cannot cross an image replacement.
Constants§
- DETERMINISM_
LOSS_ RECORD_ TARGET - The target of the evidence record that reports this process’s
determinism_losswhere the verifier cannot read it: under the DBT backend Detcore runs in the guest’s DynamoRIO client, so the client writes the reason into its protected evidence stream at process exit, and hermit’s DBT adapter refuses the comparison when a run’s evidence holds one. - FORWARDING_
AMBIGUOUS_ ORDER_ NOTICE - The
FORWARDING_LOSS_NOTICEthe coordinator writes when more than one guest thread sends a request before the first turn, so the forwarded records’ order would depend on the host. - FORWARDING_
LOSS_ NOTICE - Starts the line
send_forwarded_recordsends in place of a record it could not deliver, followed by the record’s length and the error number. Its presence means the forwarded records are incomplete, so verification must not compare them. - FORWARDING_
RETIRED_ NOTICE - The message an in-guest runtime sends on the forwarding socket when it has to
give the socket up (reverie-liteinst’s
reserve_tool_output_fdretirement message): aFORWARDING_LOSS_NOTICE, since no later record can arrive. - FORWARDING_
UNTAGGED_ RECORD_ NOTICE - The
FORWARDING_LOSS_NOTICEthe coordinator writes when a forwarded record arrives without a sender tag (a guest runtime older than the tag), so its place in the log would be the host’s choice. - PLAIN_
INFO_ MAGIC - Dedicated typed payload on the existing counted message socket. This is not a textual INFO acceptance rule and grants no execution authority.
- RECORD_
SCHEMA - Current schema written beside each structured DETLOG event.
- RECORD_
SEPARATOR - Delimits the machine-readable record appended to a human DETLOG message.
- UNCOUNTED
- The count a request reports when some thread’s records could not be counted.
Traits§
- Native
Physical Exit Completion - Actual physical exit-watch completion carried by a private affine backend receipt, not a caller’s assertion that an exit happened.
- Native
Physical Watch Identity - Identity retained by the actual backend watch for this run’s root process.
Functions§
- check_
empty_ forwarding_ cut - Inspect an empty forwarding boundary without consuming or resetting it.
- check_
forwarded_ count - The COMPLETENESS RULE. A counted request from guest thread
tidsays it producedproducedrecords for forwarding since its previous counted request (take_forwarded_since_request); it sent them before this request, and asendon a message socket queues a record on the receiver before it returns, so all of them have been received by now, as indexes 1 toproducedin order. Anything else means the records the coordinator holds for that thread are not the ones it produced: fewer, or a skipped index, were lost on the way (the guest disturbed the socket, the Tool could not adopt it, or a stale descriptor was refused); more, or a repeated or earlier index, came from something other than the Tool. Either way the coordinator writes a loss notice and records the determinism loss, so verification refuses to compare the run.UNCOUNTED(a thread could not be counted) is refused the same way. Without a registered source it does nothing. - check_
native_ exec_ forwarding_ cut - Collect, write and check one owner’s actual counted interval, then require the registered forwarding source to have no unchecked or queued records.
- clear_
forwarded_ source - Unregisters the source set with
set_forwarded_source, after taking the last waiting records and writing every queued record, thread by thread in thread-id order, and closes its socket. - decode_
plain_ info - Decode the complete envelope, rejecting unsupported classes and trailing bytes. Returned slices borrow the exact counted datagram payload.
- determinism_
loss - The first determinism loss
record_determinism_lossrecorded in this process, if any. - drain_
forwarded - Takes every message waiting on the registered forwarding socket into the queue of
its sending thread, without blocking and without writing it. An untagged message is
written at once as
ForwardedOrder::untaggedsays. Without a registered source it does nothing. - drain_
forwarded_ at_ request - Takes waiting messages as
drain_forwardeddoes at the top of the handler of a request from threadtid, and writestid’s queued records now when its request is a point the schedule fixes (the order rule atset_forwarded_source). - encode_
plain_ info - Encode only the message-only INFO class. Geometry/UTF-8 are checked again by the host; no raw INFO line can substitute for this envelope.
- finish_
native_ forwarded_ source_ after_ exit - Complete native DETLOG teardown after an actual physical-watch receipt. The unchanged counted/order rules must have credited every final record; unchecked tail records, legacy/order/loss notices, receive/poll errors and a replaced source all remain errors. On failure the source is retained. The successful operation consumes this registered source once.
- forward_
tail_ start - Called only by the explicit InitialImage shared Reverie delivery hook. The existing policy/count/socket own delivery; this adds no logging owner.
- forward_
to_ stderr - A
DetlogForwarderfor a tool that runs inside the guest process and shares the guest’s standard error: it writes each record as one [forwarded_line] there, where Hermit’s verification separates the records from the guest’s own output by their text. - info_
enabled_ for_ target - Whether the current subscriber would log a
detlog!record emitted in the moduletarget. In-process that record passes two checks:detlog!’s owntracing::enabled!(INFO), a hint with no fields, and then thetracing::info!event itself, which carries one field, the message. A directive with a field filter (detcore::random[{name}]=warn) applies to the hint whatever its fields but to the event only when the event has that field, so the two checks can disagree; the record is logged only when both pass, and so this answers true only when both probes do. - parse_
tool_ output_ env_ value - The descriptor and socket identity a
tool_output_env_valuenames. - record_
determinism_ loss - Records that this run’s records can no longer be trusted to compare: a
record was lost, or an event happened at a moment the host chose. The first
reason is kept. Verification refuses to compare a run whose
determinism_lossis set, independently of whether the corresponding loss notice reached the log. - record_
replay_ refusal - Records that a recording made by this process cannot be replayed
faithfully, for the recorder to persist in its metadata (
replay_refused), so that replay refuses before it starts the guest. The first reason is kept. It also records a determinism loss. - release_
forwarded_ count - Releases this thread’s count slot, at its deregistration, after its last count was taken.
- replay_
refusal - The first replay refusal
record_replay_refusalrecorded in this process, if any. - require_
forwarding - Called by a Tool image whose coordinator requires in-guest forwarding by
the policy
expectedencodes (Config::in_guest_detlog_forward_policy). Without a forwarder in this image, or with one that forwards by another policy (records its policy drops are never counted), the records cannot be accounted for, so every later count isUNCOUNTEDand the coordinator refuses the run (check_forwarded_count). - retain_
native_ forwarded_ source - Bind the actual source to its living watched root before releasing guest startup. EOF later requires completion of this exact retained birth.
- send_
forwarded_ record - Sends one record as one [
forwarded_line] message onsocket, a message-oriented socket (such as one end of aSOCK_SEQPACKETpair) that carries nothing but records, from which Hermit’s verification moves them into the run’s log. - send_
plain_ info_ record - Send the already counted record on its actual authenticated socket. None deliberately sends nothing; the produced index remains outstanding and the existing request/terminal cut must refuse the missing record.
- set_
forwarded_ source - Registers the receiving end of the socket an in-guest Tool sends its records on
(
send_forwarded_record) and the sink that writes them to the run’s log. - set_
forwarder - Installs a process-local sink for deterministic INFO records.
- set_
plain_ info_ forwarder - Select counted delivery for the two shared semantic INFO producers. Requires the actual existing DETLOG policy/channel to be installed first.
- socket_
identity - The socket
fdnames, as (st_dev,st_ino);Nonewhen it names no socket. - split_
forwarded_ message - The sender’s thread id, the record’s index and the record, for a message
tagged by
tagged_forwarded_message;Nonefor an untagged message (aFORWARDING_LOSS_NOTICEorFORWARDING_RETIRED_NOTICEsent raw, or a record from a runtime older than the tag). - tagged_
forwarded_ message - Prefixes a forwarded record with the id of the guest thread that sent it and
the record’s index in that thread’s counted interval,
T<tid>.<index>, so the coordinator can write each thread’s records at that thread’s own scheduler turn (write_forwarded_for) and check that it holds exactly the records the thread produced, in order (check_forwarded_count). The coordinator strips the tag before the record reaches the log. - take_
forwarded_ since_ request - How many records this guest thread produced for forwarding since its last
counted request, and starts its next count. The in-guest Tool sends it with
that request (
check_forwarded_count), on its RPC connection, which does not depend on the forwarding socket. A forked child starts from zero: its thread id is new.UNCOUNTEDonce any thread could not be counted. - tool_
output_ env_ target - The descriptor a
tool_output_env_valuenames, if it still names that socket in this process. - tool_
output_ env_ value - The value Hermit passes an in-guest Tool for its output socket
fd(reverie_sabre::TOOL_OUTPUT_ENV,detcore_liteinst::DETLOG_FORWARD_ENV):<fd>:<st_dev>:<st_ino>, the identity in 16 hexadecimal digits each. Guest code can run before the Tool adopts the descriptor (an executable’s.preinit_array) and close it or put a socket of its own at that number; the Tool adopts it only if it is still this socket (tool_output_env_target), so its records never reach the guest’s socket. The fixed width keeps the value’s length, which a scrubbed environment block keeps, independent of the host. - validate_
plain_ info_ directives - Refuses filters whose meaning cannot be reproduced by the existing target-only ForwardPolicy. Call before enabling the ordered INFO runtime. This does not alter the policy or guess answers for span/field directives.
- write_
forwarded_ for - Takes waiting messages as
drain_forwardeddoes, then writes every queued record threadtidsent, in the order it sent them. The scheduler calls this immediately before it commits a turn oftid;exclusiveis false for a BACKGROUND turn, which runs alongside later turns, and true for an ordinary one. - write_
loss_ notice - Writes a
FORWARDING_LOSS_NOTICEline withreasonthrough the registered forwarding sink, the unfiltered raw path, and records the determinism loss. Without a registered source the loss is still recorded.
Type Aliases§
- Detlog
Forwarder - A process-local sink for deterministic INFO records: the emitting module’s path (the
target
tracingwould give the record), the record suffix, the record’s index in its thread’s current counted interval (1 for the first record after the thread’s last counted request; seetake_forwarded_since_request), and the message. - Forwarded
Record Sink - Receives each record the coordinator writes from a forwarding socket: a
[
forwarded_line] (its sender tag removed), or aFORWARDING_LOSS_NOTICE. - Plain
Info Forwarder - Explicitly selected only by the genuine InitialImage runtime. Existing preload/DBT callers never select this delivery mode merely by installing the historical DETLOG forwarder.