Skip to content

User-space statically-defined tracepoints in Haskell

User-space statically-defined tracing (USDT) is a standard mechanism for user-space applications to expose statically-defined tracing events that tracing tools (e.g. perf probe) can hook. The GHC runtime already provides several such tracepoints (although this support may have bit-rotted, see #15543). However, in speaking with Brandon Simmons I realized that it might be nice if the user could incorporate USDT probe points into their Haskell programs.

This needn't necessarily even require compiler support: one might be able to do this via a library which provides a TemplateHaskell splice that generates a foreign import, and a C stub, and a USDT declaration.

Edited by Ben Gamari
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information