Expand description
Kernel probe (kprobe) subsystem for StarryOS.
This module provides dynamic tracing support by allowing breakpoint
insertion at kernel function entry/return points. It integrates the
kprobe crate with StarryOS kernel infrastructure.
§Architecture Support
All four supported architectures are enabled: x86_64, riscv64, aarch64,
and loongarch64. Each architecture provides TrapFrame↔PtRegs register
conversion to bridge the kernel’s trap frame format with the kprobe
crate’s portable PtRegs type.
§Key Components
KernelKprobeOps: Platform-specific auxiliary operations for the kprobe cratehandle_breakpoint: Entry point for breakpoint exceptions (INT3/EBREAK/BRK)handle_debug: Entry point for debug exceptions (x86_64 single-step only)
Structs§
Functions§
- handle_
breakpoint - handle_
debug - register_
kprobe - Register a kprobe into the global manager, returning the live handle.
- register_
kretprobe - Register a kretprobe and return its live handle.
- unregister_
kprobe - Unregister a previously registered kprobe.
- unregister_
kretprobe - Unregister a previously registered kretprobe.
Type Aliases§
- Kernel
Kprobe - Concrete
kprobe::Kprobeparameterized on the kernel’sRawMutexand auxiliary ops, named to match what the perf module expects. - Kernel
Kretprobe - Concrete
kprobe::Kretprobe. - Kernel
RawMutex - Raw mutex used as the
Ltype parameter for thekprobecrate’sProbeManager/Kprobe/Kretprobe(the perf subsystem refers to the concrete probe types parameterized on it — seeKernelKprobe/KernelKretprobe). - Kprobe
Auxiliary - The
KprobeAuxiliaryOpsimpl, aliased under the name the perf module uses.