Expand description
Kernel trace control (SYS_TRACE_CTL, SYS_TRACE_READ).
The per-CPU trace rings already existed for memory events; these syscalls expose the IPC/scheduling/syscall/IRQ categories to a userspace tracing daemon. Everything is gated on silo-admin capability because records contain kernel instruction pointers, task ids and wake deadlines.
Cost when tracing is disabled is a single relaxed mask load per hook:
the same enabled() check that the memory trace already pays.
Re-exportsยง
use super::error::SyscallError;๐use crate::arch::percpu;๐use crate::memory::UserSliceWrite;๐use crate::silo;๐use alloc::vec::Vec;๐use strat9_abi::data::TraceRecord;๐use strat9_abi::data::TraceStats;๐use strat9_abi::syscall::TRACE_CTL_CLEAR;๐use strat9_abi::syscall::TRACE_CTL_GET_MASK;๐use strat9_abi::syscall::TRACE_CTL_SET_MASK;๐use strat9_abi::syscall::TRACE_CTL_STATS;๐
Constantsยง
- TRACE_
READ_ ๐MAX - Upper bound on records returned by one
SYS_TRACE_READcall.
Functionsยง
- sys_
trace_ ctl SYS_TRACE_CTL(602): configure the trace subsystem.- sys_
trace_ read SYS_TRACE_READ(603): copy trace records to userspace.