check_trace_log namespace

Classes

class _MessageCollector
Count messages while retaining only a bounded leading sample.

Functions

auto _iter_events(Iterable lines[str], int max_details = 20) -> tuple[Iterable[dict[str, str]], _MessageCollector, dict[str, int]]
Yield structured trace events from one raw line iterator.
auto _validate_events(Iterable] events[dict[str, str], int max_details = 20) -> tuple[_MessageCollector, _MessageCollector, dict[str, int], dict]
Validate trace event sequences for definite runtime misuse patterns.
auto _print_report(dict counts[str, int], _MessageCollector parse_warnings, _MessageCollector errors, _MessageCollector warnings, dict op_counts[str, int], dict triage, int max_details, bool show_triage) -> None
Print a validation summary and optional leak triage details.
auto _build_arg_parser() -> argparse.ArgumentParser
Build the command-line parser for the trace log checker.
auto main(list argv[str]) -> int
Run the trace log checker command-line entry point.

Variables

TRACE_RE
KV_RE

Function documentation

tuple[Iterable[dict[str, str]], _MessageCollector, dict[str, int]] check_trace_log::_iter_events(Iterable lines[str], int max_details = 20) protected

Yield structured trace events from one raw line iterator.

Parameters
lines Raw trace log lines, typically captured from Stage 2 stderr.
max_details Maximum number of non-fatal parse-warning details to retain.
Returns A triple containing the parsed event iterator, non-fatal parse warnings, and summary event counts.

tuple[_MessageCollector, _MessageCollector, dict[str, int], dict] check_trace_log::_validate_events(Iterable] events[dict[str, str], int max_details = 20) protected

Validate trace event sequences for definite runtime misuse patterns.

Parameters
events Parsed trace events from _parse_events.
max_details Maximum number of validation error and warning details to retain.
Returns A tuple of "(errors, warnings, op_counts, triage)" summarizing the validation result and leak triage metadata.

None check_trace_log::_print_report(dict counts[str, int], _MessageCollector parse_warnings, _MessageCollector errors, _MessageCollector warnings, dict op_counts[str, int], dict triage, int max_details, bool show_triage) protected

Print a validation summary and optional leak triage details.

Parameters
counts Parsed trace event counts by family and in total.
parse_warnings Non-fatal warnings produced during parsing.
errors Validation errors to report.
warnings Validation warnings to report.
op_counts Per-family operation counts.
triage Leak triage metadata from _validate_events.
max_details Maximum number of detail lines to print per section.
show_triage Whether to print the triage section.

argparse.ArgumentParser check_trace_log::_build_arg_parser() protected

Build the command-line parser for the trace log checker.

Returns Configured argument parser for the check_trace_log.py CLI.

int check_trace_log::main(list argv[str])

Run the trace log checker command-line entry point.

Parameters
argv Process argument vector, including program name at index 0.
Returns Exit status 0 on success, 1 when validation finds errors, or 2 for invalid usage or file-read failures.

Variable documentation