content_image/805260.jpg
# Instrumenting CPython with DTrace and SystemTap 

## Contents 

## Guido van Rossum and the Python development team 

Python Software Foundation Email: docs@python.org 

Release 3.9.5 

June 01, 2021 

<img src='content_image/805260.jpg'>

author David Malcolm 

author Łukasz Langa 

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: 

• filter which processes are to be observed 

• gather data from the processes of interest 

• generate reports on the data 

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 guar- antees are made about probe compatibility between versions of CPython. DTrace scripts can stop working or work incorrectly without warning when changing CPython versions. 

