Skip to main content

Crate corescout_substrate

Crate corescout_substrate 

Source
Expand description

The substrate: hardware discovery and passive observation.

This is the only crate in the workspace that touches hardware. It reads sysfs, procfs, CPUID and perf_event_open, and it produces MirrorSnapshots. Every other crate either produces snapshots for it to publish, or consumes them.

That is the load-bearing fact about the dependency graph. corescout-model, corescout-observer and their neighbours do not depend on this crate, so an observer cannot read /sys even by mistake: the code that would do it is not linked into its binary.

§Layers here

moduleresponsibility
platformthe only cfg(target_os) in the project
topologyplatform-neutral model of what the CPU is made of
discoveryturning topology into stable entities and relations
observationpassive sensors, each declaring what looking costs
reflectorthe loop that binds sensors and produces reflections

§The rule this crate enforces

Observation belongs to the mirror. Intentional perturbation belongs to experimentation.

Every sensor here is passive: it reads state the machine maintains anyway, for its own reasons, whether or not anyone is looking. Nothing here runs a workload, moves a thread, changes a frequency or requests an idle state. Code that wants to do those things lives in corescout-experiment or corescout-agency.

Re-exports§

pub use discovery::Roots;
pub use discovery::Substrate;
pub use reflector::Reflector;
pub use topology::Topology;

Modules§

discovery
Turning a topology into the entities and relations the mirror reflects.
observation
Observation: how the machine samples itself, and what that costs.
platform
Platform abstraction layer.
reflector
The reflector: the loop that produces M(t) from a real machine.
topology
The topology data model.