Skip to main content
Join the official 2020 Python Developers SurveyStart the survey!

Create USDT probes and instrument your Python application dynamically

Project description

# python-stapsdt

Create USDT probes and instrument your Python application dynamically.

# Dependencies

At the moment this package only runs on Linux and requires
[libstapsdt]( to be installed to create
runtime probes.

## Ubuntu 16.04

To install libstapsdt, run:

sudo add-apt-repository ppa:sthima/oss
sudo apt-get update
sudo apt-get install libstapsdt0 libstapsdt-dev

## Other

Build from [libstapsdt](

# Install

pip install stapsdt

# Example

The following code will create a probe named `firstProbe`.

from time import sleep

import stapsdt

provider = stapsdt.Provider("pythonapp")
probe = provider.add_probe(
"firstProbe", stapsdt.ArgTypes.uint64, stapsdt.ArgTypes.int32)

while True:
print("Firing probe...")
if"My little probe", 42):
print("Probe fired!")

You can then trace this probe with any tool able to trace Systemtap's probes.
Here's an example with eBPF/bcc:

sudo trace -p PID 'u::firstProbe "%s - %d", arg1, arg2'

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for stapsdt, version 0.1.1
Filename, size File type Python version Upload date Hashes
Filename, size stapsdt-0.1.1.tar.gz (3.0 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page