/projects/be_trace
Kernel observability for Haiku OS. Static tracepoints with per-CPU ring buffers, exposed as BMessages through native Haiku APIs.
Interactive Demo: Ku Trace Viewer
Philosophy & Approach
The DTrace Way
Complex, specialized language (D), strict safety guarantees, massive monolithic kernel integration.
The Haiku Way
Simple static tracepoints, data exposed via BMessage for easy consumption by GUI tools. Build Deskbar replicants, full apps, or script with Hey.
Implementation Roadmap
Kernel Module + Ring Buffers
Per-CPU lock-free ring buffers with /dev/ku device node for userland access via read() and ioctl().
Core Probe Categories
Scheduler (switch/wake/block), Port IPC (create/write/read), and syscall entry/exit tracepoints.
Userland Libraries
libku (C API) and libku++ (BMessage-based C++ API with BMessenger delivery).
CLI Tool
ku watch for live streaming, ku stat for aggregate counters, ku list for available probes.
Extended Probes
VFS operations, VM paging, network stack events, and application-defined tracepoints.
GUI Viewer & Deskbar Replicant
Graphical trace viewer with filtering, timeline visualization, and a compact Deskbar widget.