Crate kprobe

Crate kprobe 

Source
Expand description

A Rust library for dynamic kernel probing (kprobes and kretprobes). ! This library provides a safe and ergonomic interface for registering and managing kprobes and kretprobes in a kernel environment. ! It supports multiple architectures, including x86_64, riscv64, and loongarch64. ! # Features

  • Register and unregister kprobes and kretprobes.
  • Support for pre-handler and post-handler functions.
  • Safe management of probe points and handlers.
  • Architecture-specific implementations for handling breakpoints and single-stepping.

Structs§

Kprobe
The x86_64 implementation of Kprobe.
KprobeBasic
The basic information of a kprobe.
KprobeBuilder
The builder for creating a kprobe.
KprobeManager
A manager for kprobes.
Kretprobe
The kretprobe structure.
KretprobeBuilder
The builder for creating a kretprobe.
KretprobeInstance
The instance of a kretprobe.
PtRegs
The CPU register state for x86_64 architecture.
X86KprobePoint
The probe point for x86_64 architecture.

Enums§

Probe
An enum representing either a kprobe or a kretprobe.

Traits§

CallBackFunc
The callback function type for events.
KprobeAuxiliaryOps
The auxiliary operations required for kprobes.
KprobeOps
The operations available for kprobes.
ProbeData
The user data associated with a probe point.

Functions§

kprobe_handler_from_break
Run kprobe which has been registered on the address
kprobe_handler_from_debug
Run kprobe which has been registered on the address
register_kprobe
Register a kprobe.
register_kretprobe
Register a kretprobe.
unregister_kprobe
Unregister a kprobe.
unregister_kretprobe
Unregister a kretprobe.

Type Aliases§

KprobePoint
The probe point structure for the current architecture.
KprobePointList
A list of kprobe points.
ProbeHandlerFunc
The type of the probe handler function.