Skip to main content

Module logdiff

Module logdiff 

Source
Expand description

Everything to do with post-processing hermit/detcore logs.

Structs§

BitwiseInfoV1Diagnostics
Output-only settings for a canonical BitwiseInfoV1 comparison.
Comparison
A comparison of two strings.
ComparisonSideLabels
Reader-facing names for the two inputs to a log comparison.
LogDiffOpts
Options for calling log_diff.
LogDiffSummary
What a log comparison actually compared, alongside whether it differed.
PrefixComparison
A comparison of two logs that may still be growing.

Enums§

DetLogFilter
Indicates which DETLOG entries to be used for log-diff comparison
LogComparisonMode
Selects the set of log messages compared for determinism.

Constants§

CANON_ADDRESS_ORDINAL_V1
Versioned policy token for lossless host-address ordinalization.
STRIP_WALL_CLOCK_PREFIX_V1
Versioned policy token for the only prefix removed by BitwiseInfoV1.
TRUNCATION_MARKER
The in-band line a bounded log writer emits when a run’s log file reaches its configured size bound.

Functions§

compare_complete_bitwise_info_v1_prefix
Compare the complete common prefix of two growing logs under the fixed BitwiseInfoV1 policy.
compare_complete_prefix
Compare only the records both logs have finished writing.
compare_complete_prefix_with_filter
Compare the complete common prefix after applying a caller-supplied record filter. Product callers must bind the predicate to a typed, serialized policy; this backend-neutral layer intentionally carries no backend policy identity.
complete_record_count
How many records in contents are known COMPLETE.
host_addr
Wrap a host memory address so canonicalize_addresses_in_line will canonicalize it. Producers that print a genuinely host-specific pointer (one that varies run-to-run, e.g. a supervisor-side allocation) should emit it via this helper – <hostaddr 0x7fcfb7e7d450> – instead of a bare 0x... literal. Only marked addresses are canonicalized, so reproducible hex (syscall arguments, guest memory ranges, digests) is compared exactly.
log_diff
Process log messages from two files. Log messages look like this: “Apr 09 06:08:03.100 INFO detcore: [detcore, dtid 2] finish syscall: close(2) = Ok(0)”
log_diff_detailed
Like log_diff, but returns the counted comparison evidence rather than a bare boolean.
log_diff_summary_from_strs_with_filter
Compare two in-memory logs after applying a caller-supplied record filter.
log_was_truncated
Whether log_text is the output of a writer that hit its size bound.
record_count
Total records in a log, including a final record that may still be being written. Use complete_record_count when the log is still growing.
strip_log_entry
In fully-deterministic modes, many log lines should be fully determinstic across runs. But as that is a work-in-progress, this utility strips known-nondeterministic information from logs.
take_complete_records
The prefix of contents holding exactly its first n complete records.
try_compare_bitwise_info_v1
Compare two current Hermit logs under the canonical BitwiseInfoV1 policy.
try_compare_bitwise_info_v1_bytes_with_records
Canonical comparison over bytes already captured by the caller.
try_compare_bitwise_info_v1_bytes_with_records_and_diagnostics
Canonical comparison over captured bytes with output-only diagnostics.
try_compare_bitwise_info_v1_with_diagnostics
Canonical file comparison with caller-selected diagnostic output.
try_compare_bitwise_info_v1_with_records
Canonical comparison plus total complete-record counts from both inputs.
try_compare_bitwise_info_v1_with_records_and_diagnostics
Canonical file comparison with caller-selected diagnostic output.
try_log_diff_detailed
Fallible form of log_diff_detailed for user-facing callers. Missing or unreadable inputs are ordinary command errors, not process panics.
try_log_diff_detailed_with_filter
Fallible log comparison with a caller-supplied record filter.
try_log_diff_with_records
Like try_log_diff_detailed, but also reports how many records each log contained. Every log comparison should be able to say what it read, so a caller is never left to infer coverage from a bare verdict.
try_log_diff_with_records_and_filter
Compare two logs with a caller-supplied record filter and report source counts. Product callers must bind the predicate to a typed, serialized policy; this backend-neutral layer intentionally carries no backend policy identity.
write_bitwise_info_v1_bytes
Render the canonical INFO messages that BitwiseInfoV1 would compare from bytes already captured by the caller.
write_canonical_info
Print the canonical INFO messages that strict verification would compare for one captured log.
write_canonical_info_with_filter
Print canonical INFO messages after applying a caller-supplied record filter.