Skip to main content

trace0

A low-overhead tracing profiler for Python, written in Rust.

trace0 hooks PEP 669 sys.monitoring, packs each event into 8 bytes in a thread-local buffer, and hands whole batches to a background thread over lock-free SPSC rings. It emits Perfetto-compatible traces — open them at https://ui.perfetto.dev.

Roughly 13 ns per traced function call at 4 threads on an M-series Mac.

Try it, without installing anything

uvx fetches the wheel, traces your script, and leaves nothing behind:

uvx trace0 run --output trace.pb --format protobuf your_script.py

Drop trace.pb onto https://ui.perfetto.dev and you have a flame chart.

The traced script runs inside the tracer's environment, so give it whatever it imports with --with:

uvx --with httpx --with pandas trace0 run --output trace.pb your_script.py

To trace under a free-threaded interpreter, name it — every thread is traced, not just the calling one:

uvx --python 3.13t trace0 run --output trace.pb your_script.py

Install

Add it to a project when you want the Tracer API:

uv add trace0

Requires Python 3.13+. Free-threaded builds (3.13t, 3.14t) are a first-class target.

from trace0 import Tracer

with Tracer("trace.pb", "protobuf"):
    your_workload()

The same CLI is then on your project's path:

uv run trace0 run --output trace.pb --format protobuf your_script.py

Formats are json (Chrome Trace Event, human-readable and diffable) and protobuf (Perfetto, smaller and faster to write).

Status

Early. The tracer works end to end and is covered by tests, but the API is not yet stable and wheels are not yet built for every platform.

Layout

crate role
trace0-core clock, event model, event queue, exporter contract
trace0-json Chrome Trace Event output
trace0-proto Perfetto protobuf output

License

MIT

Download files

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

Source Distribution

trace0-0.1.1.tar.gz (37.4 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

trace0-0.1.1-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (619.3 kB view details)

Uploaded CPython 3.14tmanylinux: glibc 2.17+ x86-64

trace0-0.1.1-cp314-cp314t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (609.1 kB view details)

Uploaded CPython 3.14tmanylinux: glibc 2.17+ ARM64

trace0-0.1.1-cp314-cp314t-macosx_11_0_arm64.whl (555.0 kB view details)

Uploaded CPython 3.14tmacOS 11.0+ ARM64

trace0-0.1.1-cp314-cp314t-macosx_10_12_x86_64.whl (565.8 kB view details)

Uploaded CPython 3.14tmacOS 10.12+ x86-64

trace0-0.1.1-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (621.7 kB view details)

Uploaded CPython 3.14manylinux: glibc 2.17+ x86-64

trace0-0.1.1-cp314-cp314-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (611.3 kB view details)

Uploaded CPython 3.14manylinux: glibc 2.17+ ARM64

trace0-0.1.1-cp314-cp314-macosx_11_0_arm64.whl (556.8 kB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

trace0-0.1.1-cp314-cp314-macosx_10_12_x86_64.whl (567.3 kB view details)

Uploaded CPython 3.14macOS 10.12+ x86-64

trace0-0.1.1-cp313-cp313t-macosx_11_0_arm64.whl (554.3 kB view details)

Uploaded CPython 3.13tmacOS 11.0+ ARM64

trace0-0.1.1-cp313-cp313t-macosx_10_12_x86_64.whl (564.9 kB view details)

Uploaded CPython 3.13tmacOS 10.12+ x86-64

trace0-0.1.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (620.8 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

trace0-0.1.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (610.3 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ ARM64

trace0-0.1.1-cp313-cp313-macosx_11_0_arm64.whl (557.6 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

trace0-0.1.1-cp313-cp313-macosx_10_12_x86_64.whl (566.4 kB view details)

Uploaded CPython 3.13macOS 10.12+ x86-64

File details

Details for the file trace0-0.1.1.tar.gz.

File metadata

  • Download URL: trace0-0.1.1.tar.gz
  • Upload date:
  • Size: 37.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for trace0-0.1.1.tar.gz
Algorithm Hash digest
SHA256 b4d992cf2ee7bf8f90d3705120640e2317ecc0d65d05cf13cbd8a2dc772dae34
MD5 c77d3e66c6917a84ab4b4f2022302ed5
BLAKE2b-256 e24f2925810f1a0b07ac432021adba5ad4757e770e025188844583f3b52645d0

See more details on using hashes here.

Provenance

The following attestation bundles were made for trace0-0.1.1.tar.gz:

Publisher: release.yml on soof-golan/trace0

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file trace0-0.1.1-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for trace0-0.1.1-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 059d32cd5a162a15f547a17f9a0e6d2c27dd74233ee920f41e50112fdfb4f7a7
MD5 3df06f14a7c20c3a1b6205d0b8493d7d
BLAKE2b-256 4b5e2d60c28ffdcef194c7950cf8ad13ab6f684c17d630db43cdbc6c0e6ae010

See more details on using hashes here.

Provenance

The following attestation bundles were made for trace0-0.1.1-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: release.yml on soof-golan/trace0

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file trace0-0.1.1-cp314-cp314t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for trace0-0.1.1-cp314-cp314t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 c026d9173aaa904096bc093178bf4db5e200434204931004be96dab2ea14e353
MD5 10750a2dc5328501466080822e9de79d
BLAKE2b-256 807c898929f6e8463de3ba5aeab217f96eccdc41af8a795098c9a7d2a9f788e4

See more details on using hashes here.

Provenance

The following attestation bundles were made for trace0-0.1.1-cp314-cp314t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: release.yml on soof-golan/trace0

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file trace0-0.1.1-cp314-cp314t-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for trace0-0.1.1-cp314-cp314t-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 aa2bbb259d1b75ac9d8283b7deabb6b0c3c6e053d7574fdc66b862326e8264bd
MD5 9afd81ac63e85125317c91f92ee635e0
BLAKE2b-256 95b17e2ea0ff46516803e42ea4b87d25845cd09a9b5e96eeca7770469d5663d6

See more details on using hashes here.

Provenance

The following attestation bundles were made for trace0-0.1.1-cp314-cp314t-macosx_11_0_arm64.whl:

Publisher: release.yml on soof-golan/trace0

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file trace0-0.1.1-cp314-cp314t-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for trace0-0.1.1-cp314-cp314t-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 e5804d8c34fed2900536694a717ded7f523a002acb8b593b5de76c86d097822b
MD5 025381fa57bb24a9f97daccd3d2e6c1d
BLAKE2b-256 c243c202e46d0575ace70e5905981806497b23d028c9fa03771855e4d4fa1efe

See more details on using hashes here.

Provenance

The following attestation bundles were made for trace0-0.1.1-cp314-cp314t-macosx_10_12_x86_64.whl:

Publisher: release.yml on soof-golan/trace0

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file trace0-0.1.1-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for trace0-0.1.1-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 64a5acbad5043fd70584606f2831acb24a85804fc08048d69c422b96708059af
MD5 4c66264d6905cc5d84ec39050a8db442
BLAKE2b-256 de76bcfab10bf19c1b0e5d133234894cf0ce6192044d620f096e39047b9350da

See more details on using hashes here.

Provenance

The following attestation bundles were made for trace0-0.1.1-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: release.yml on soof-golan/trace0

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file trace0-0.1.1-cp314-cp314-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for trace0-0.1.1-cp314-cp314-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 dda8823de1ad688825f1205feebc5401022807c627912545549900276d9cb305
MD5 fe125019f03aa12b045ad71a2d8ebd29
BLAKE2b-256 75075e2016113ca8049a2b2a1b498d38582264da407c40d13fb7026b9dcd9338

See more details on using hashes here.

Provenance

The following attestation bundles were made for trace0-0.1.1-cp314-cp314-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: release.yml on soof-golan/trace0

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file trace0-0.1.1-cp314-cp314-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for trace0-0.1.1-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 faad9e4b7a07231863849b3524ea4c115bdc31ab325f4e488dbb1ec10e427d13
MD5 d769b55e77c29a3ee6c93a9d25503c19
BLAKE2b-256 c36bff313e79c65b4f24cd5e295689da841c05e12f4917d63e0efa3b104a8e11

See more details on using hashes here.

Provenance

The following attestation bundles were made for trace0-0.1.1-cp314-cp314-macosx_11_0_arm64.whl:

Publisher: release.yml on soof-golan/trace0

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file trace0-0.1.1-cp314-cp314-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for trace0-0.1.1-cp314-cp314-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 5148f9f893bc08232cca889a5d349ebc37135be4d497e8b3fe38e1dea59bbdbc
MD5 28df139505a8af6a85d2578c91511baa
BLAKE2b-256 3de0509fb5d8400e23dd64fc1c77d5f4af5b052d939ed2785ce537c72efc077d

See more details on using hashes here.

Provenance

The following attestation bundles were made for trace0-0.1.1-cp314-cp314-macosx_10_12_x86_64.whl:

Publisher: release.yml on soof-golan/trace0

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file trace0-0.1.1-cp313-cp313t-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for trace0-0.1.1-cp313-cp313t-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 924fbca808e53d216c23d328b5d27f94ef473cf445bb6a824838a857c6144ed2
MD5 314ea473d9ce5d6d4499ac604b2aab19
BLAKE2b-256 03d5e142806e21930ed936508eae9d0173f08c24c96a3da1b79757c8d8bd9f54

See more details on using hashes here.

Provenance

The following attestation bundles were made for trace0-0.1.1-cp313-cp313t-macosx_11_0_arm64.whl:

Publisher: release.yml on soof-golan/trace0

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file trace0-0.1.1-cp313-cp313t-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for trace0-0.1.1-cp313-cp313t-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 591e2eea7e526011af6927f439611807c0db6b7971a8c22892db747b71c864ed
MD5 13928ff72243fa1a3300e9e73a27e327
BLAKE2b-256 da9d49e461db60c7133ae11a94d527682129962eeb1eaf6eb2efb05b6463110c

See more details on using hashes here.

Provenance

The following attestation bundles were made for trace0-0.1.1-cp313-cp313t-macosx_10_12_x86_64.whl:

Publisher: release.yml on soof-golan/trace0

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file trace0-0.1.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for trace0-0.1.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 8cb9c0da5ba18b94a68799bf40a838e3ab241ac6effc4ced4c9943cf3627343b
MD5 23acb77ca57464239c461d6d83f0d082
BLAKE2b-256 b68e68ac106e25551815a15bb2c3db93f5b0c5de78d4e10bad0262426df25586

See more details on using hashes here.

Provenance

The following attestation bundles were made for trace0-0.1.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: release.yml on soof-golan/trace0

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file trace0-0.1.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for trace0-0.1.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 576a6de8dfcfc91e2cae34edd12d1f6f4b3262d7b73cbf73787748e9c88433af
MD5 2b774fcccec745265824643f45b723ab
BLAKE2b-256 495c0f249d674b6383a1b7b3086edffe1e6e2933fdfb1f6b439ab4a82cfc5e58

See more details on using hashes here.

Provenance

The following attestation bundles were made for trace0-0.1.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: release.yml on soof-golan/trace0

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file trace0-0.1.1-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for trace0-0.1.1-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 faf4d5afa1720ec9db0658972dfdd647ceca3b88d2420aa2910955c7479ae8bf
MD5 cd9e893f6f82a4c6b6549733fe34326d
BLAKE2b-256 2a197bf6a4fa9c5767b4c579c1c7d53ea98e1d2dbfdaff46ecdbba01ad764ed8

See more details on using hashes here.

Provenance

The following attestation bundles were made for trace0-0.1.1-cp313-cp313-macosx_11_0_arm64.whl:

Publisher: release.yml on soof-golan/trace0

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file trace0-0.1.1-cp313-cp313-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for trace0-0.1.1-cp313-cp313-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 5d28e1188e054b54ded6fef664ddf1c7fa2df9f892d855c803a0174e8b021315
MD5 fdc7a2fe0e10f0a47ab2284ac264cc63
BLAKE2b-256 aa2f00aebbd57809d364e3744ba31ac4b3fe271c45441ee13433b673ce6bf50d

See more details on using hashes here.

Provenance

The following attestation bundles were made for trace0-0.1.1-cp313-cp313-macosx_10_12_x86_64.whl:

Publisher: release.yml on soof-golan/trace0

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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