A python tracer
Panopticon is a debugger-powered tracer for Python code to quickly visualize and explore code execution. Traces generated are Catapult compatible — available at `chrome://tracing` if you're using Chrome.
Alpha: I'm still working on adding tests, polishing the api, and cleaning up the code in general. Expect the API to change drastically as it meanders towards v1. It should still be immediately useful as a debugging tool. Please report issues if you come across bugs!
You can read a more detailed guide with several examples of simple Python programs, different interfaces to visualize them and the corresponding traces at explog.in/panopticon.
Run a command directly
python3 -m panopticon -c "print('hello')" -o print_hello.trace
Run a file
python3 -m panopticon -o file.trace file.py
from panopticon import record_trace with record_trace("print_hello.trace"): print("Hello")
Probe a specific function
It can be tricky to control how a program is executed: using the probe decorator allows instrumenting a specific function instead.
from panopticon.probe import probe from panopticon.trace import StreamingTrace @probe(trace=StreamingTrace(open("probe.trace", "w"))) def myfunction(): ...
Python supports suspending and continuing execution of a frame through generators, coroutines and asynchronous generators. Panopticon creates "flow" events to connect a single frame executing through time, making it easier to visualize what's actually happening.
You can enable/disable connections for different types of functions by choosing to enable/disable flow events in Catpult (top-right).
- Added a simplified record_trace API
- Added support for @probe to instrument functions and classes
- Initial version of Panopticon
- CLI supports running commands and files for tracing
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
|Filename, size||File type||Python version||Upload date||Hashes|
|Filename, size panopticon-0.0.2-py3-none-any.whl (8.7 kB)||File type Wheel||Python version py3||Upload date||Hashes View|
|Filename, size panopticon-0.0.2.tar.gz (8.7 kB)||File type Source||Python version None||Upload date||Hashes View|
Hashes for panopticon-0.0.2-py3-none-any.whl