Expand description
os_observatory: universal observability primitives for operating systems
This crate provides a zero-dependency, no_std-first toolkit that helps OS authors
instrument their kernels with structured logging, low-overhead tracing, and panic reporting.
It is designed to compile on bare metal, with optional std support for host-side testing.
Design goals:
- Independence: no external crate dependencies, only
coreand optionallyalloc/std. - Determinism: constant-time operations in interrupt contexts, lock-free paths.
- Portability: abstract I/O sinks so you can plug in UART, memory, semihosting, etc.
- Documentation: extensively commented APIs to render well on docs.rs.
- Testability: host-side tests under
std; kernel-side tests via stub sinks.
Modules:
sink: trait and implementations for safe output targetslogging: macros and logger with compile-time levelstracer: fixed-capacity event tracing buffers with timestampsbuild: compile-time build information (name, version, etc.)mem: small memory utilities useful in kernelspanic: helpers to report panics through your chosen sink
Licensing:
- MIT License.
- Authored by an AI Assistant (GPT-5-medium), originating from an idea by alisio85.
- See LICENSE-MIT for details.
Usage quickstart (no_std):
- Implement
sink::Sinkfor your hardware writer - Initialize a
logging::Loggerwith your sink - Use
os_log!,os_warn!,os_error!,os_trace!macros - Configure
tracer::EventTracerfor performance-critical instrumentation - Wire
panic::report_panicinside your panic handler to emit diagnostics
Safety notes:
- All APIs aim to be
no_stdand interrupt-safe; avoid heap unless opting intoalloc. - Logging uses bounded buffers and does not allocate.
- Tracing uses lock-free atomics and fixed-size records.
- Panics are reported in a minimalistic, reentrant-aware fashion.
Modules§
- build
- Build metadata helpers. Compile-time build information.
- logging
- Structured logging and user-facing macros. Structured logging with compile-time macros.
- mem
- Memory utilities for OS code. Small memory utilities useful in kernels.
- panic
- Panic reporting utilities for integration into
#[panic_handler]. Panic reporting utilities. - prelude
- Re-export commonly used items for convenience. Convenient re-exports for typical usage patterns.
- sink
- Output abstraction and in-crate sinks. Output sinks for observability.
- tracer
- Low-overhead event tracing. Event tracing with fixed-capacity buffers.