Skip to main content

Trace Python code with the Google Perfetto tracing library

Project description

Perfnetto

Perfnetto wraps the Perfetto tracing SDK to make it possible to trace Python code.

[!NOTE]
This is a very new project and certainly rough around the edges. Please report any issues you find – I hope it's useful in any case.

Installation

From PyPI

Prebuilt binary wheels are available for Linux and macOS for recent versions of Python on PyPI, so you can use pip or uv pip to install it.

Building from source

Source packages are not available on PyPI (so pip install perfnetto won't work out of the box) because of the submodule dependency on the Perfetto SDK.

Usage

The high-level API is the with perfnetto.tracing() as ctx: context manager.

Code run within this block is traced into a perfnetto-(TIME).dump file, unless you specify another name. Perfnetto will log the name of the output file onto the standard Python logger as it finishes.

When tracing, you can use with perfnetto.region(name): to mark a region. You can also set instant marks with perfnetto.instant(name).

Once you have a dump file, view it with ui.perfetto.dev.

License

Since the majority of this code is a wrapper around the Perfetto library, it is licensed under the same license. This project is licensed under the Apache License, Version 2.0. See the LICENSE file for more details.

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

perfnetto-0.1.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (13.9 MB view details)

Uploaded CPython 3.13 manylinux: glibc 2.17+ x86-64

perfnetto-0.1.0-cp313-cp313-macosx_11_0_arm64.whl (1.1 MB view details)

Uploaded CPython 3.13 macOS 11.0+ ARM64

perfnetto-0.1.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (13.9 MB view details)

Uploaded CPython 3.12 manylinux: glibc 2.17+ x86-64

File details

Details for the file perfnetto-0.1.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for perfnetto-0.1.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 d8681e0db76b0c63b7e0675fb9dd49920f5e496f0f99619b66ad1617e06981e9
MD5 714f19f5e68ff96d89572e5764eb7f4c
BLAKE2b-256 9f411cb2a63c5490e753467b2b1eb400006f09c72a918d992326b950cc904a32

See more details on using hashes here.

Provenance

The following attestation bundles were made for perfnetto-0.1.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: ci.yml on akx/perfnetto

Attestations:

File details

Details for the file perfnetto-0.1.0-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for perfnetto-0.1.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 292acd2815a55e109e84b0662b81d9a7109646a6d5991e5e213d62130e5e90c1
MD5 4ff1de52af6b71eb047a97581319e41c
BLAKE2b-256 e30b877eb6c3b822b9303aadbb0c8c11e37a2c41d2bc680c25dda67470df0be1

See more details on using hashes here.

Provenance

The following attestation bundles were made for perfnetto-0.1.0-cp313-cp313-macosx_11_0_arm64.whl:

Publisher: ci.yml on akx/perfnetto

Attestations:

File details

Details for the file perfnetto-0.1.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for perfnetto-0.1.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c841ac3df9344fdb5468bd4bfe71226646f43ef7d5b4e9494e4623eedcaa9fae
MD5 02b95fa5c09e529889bbd7253c38bde2
BLAKE2b-256 5bf7885dc11345f12acf4436c9c9ec7b9eec01a12f66e852bb4d6381f12a7571

See more details on using hashes here.

Provenance

The following attestation bundles were made for perfnetto-0.1.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: ci.yml on akx/perfnetto

Attestations:

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page