Skip to main content

Module kprobe

Module kprobe 

Source
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 crate
  • handle_breakpoint: Entry point for breakpoint exceptions (INT3/EBREAK/BRK)
  • handle_debug: Entry point for debug exceptions (x86_64 single-step only)

Structs§

KernelKprobeOps

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§

KernelKprobe
Concrete kprobe::Kprobe parameterized on the kernel’s RawMutex and auxiliary ops, named to match what the perf module expects.
KernelKretprobe
Concrete kprobe::Kretprobe.
KernelRawMutex
Raw mutex used as the L type parameter for the kprobe crate’s ProbeManager / Kprobe / Kretprobe (the perf subsystem refers to the concrete probe types parameterized on it — see KernelKprobe / KernelKretprobe).
KprobeAuxiliary
The KprobeAuxiliaryOps impl, aliased under the name the perf module uses.