Skip to main content

Module syscall_histogram

Module syscall_histogram 

Source
Expand description

Per-run syscall histograms: how many times the guest made each syscall, and what Detcore did with it.

Detcore counts every syscall entry by number, at the same accounting point as the run summary’s scalar syscalls count, and at the end of its handler records one SyscallOutcome. Each thread keeps its own SyscallHistogram and hands its nonzero slots (SparseSyscallHistogram) to the scheduler with its other final statistics when it deregisters, so a run’s histogram covers exactly the calls of the syscalls total. The run summary reports the merged histogram as a SyscallHistogramSummary: sparse, ordered by x86-64 syscall number, each entry carrying the pinned syscall name, together with the SyscallObservationScope that says whether the accounting point saw every syscall the guest made.

This is the producer the compatibility-website plan asks for (dev-hermit ai_docs/compatibility-website-vision-and-implementation-plan-20260830.md, “Syscall totals” and Stage 3).

Counting reads no guest state and changes nothing the guest can observe.

Structs§

CompactSyscallHistogram
A run’s syscall histogram in the compact form machine records keep: the verification report’s runtime.run1/run2, and from it each cell’s result row and the durable series row (run 1 only). Names are left out: a reader takes them from the pinned table for architecture.
SparseSyscallHistogram
A finished thread’s histogram: only its nonzero slots, (number, counts) by ascending number.
SyscallHistogram
A histogram indexed by x86-64 syscall number, as Detcore collects it: a dense array with one SyscallOutcomes per table slot, allocated once when the thread’s state is created, so counting a syscall is two array increments with no allocation and no lookup. A thread that exits hands over only its nonzero slots (SparseSyscallHistogram), and the run’s total sums those back into one dense histogram.
SyscallHistogramEntry
One syscall’s counts in a SyscallHistogramSummary.
SyscallHistogramSummary
A run’s syscall histogram as the run summary reports it.
SyscallOutcomes
Counts for one syscall.

Enums§

SyscallObservationGap
Why the accounting point did not see every syscall the guest made.
SyscallObservationScope
Whether a histogram counts every syscall the guest made.
SyscallOutcome
What Detcore did with one completed syscall.

Constants§

SYSCALL_TABLE_SIZE
Slots in a SyscallHistogram: one per number of the pinned x86-64 syscall table, gaps included.

Functions§

pinned_syscall_table
Every syscall the pinned x86-64 table names, as (number, name) by ascending number. A coverage report takes its never-exercised list from this, so it names exactly the syscalls a histogram can count.