DTrace and SystemTap are monitoring tools, each providing a way to inspect what the processes on a computer system are doing.  They both use domain-sp

Instrumenting CPython with DTrace and SystemTap¶

submited by
Style Pass
2024-09-24 22:00:07

DTrace and SystemTap are monitoring tools, each providing a way to inspect what the processes on a computer system are doing. They both use domain-specific languages allowing a user to write scripts which:

As of Python 3.6, CPython can be built with embedded “markers”, also known as “probes”, that can be observed by a DTrace or SystemTap script, making it easier to monitor what the CPython processes on a system are doing.

CPython implementation detail: DTrace markers are implementation details of the CPython interpreter. No guarantees are made about probe compatibility between versions of CPython. DTrace scripts can stop working or work incorrectly without warning when changing CPython versions.

macOS comes with built-in support for DTrace. On Linux, in order to build CPython with the embedded markers for SystemTap, the SystemTap development tools must be installed.

CPython must then be configured with the --with-dtrace option:

Leave a Comment