Debugging & Profiling
faulthandler — Dump the Python traceback
This module contains functions to dump Python tracebacks explicitly, on a fault, after a timeout, or on a user signal. Call
to install fault handlers for the faulthandler.enable()
SIGSEGV
, SIGFPE
, SIGABRT
, SIGBUS
, and SIGILL
signals. You can also enable them at startup by setting the
environment variable or by using the PYTHONFAULTHANDLER
-X
faulthandler
command line option.
bdb — Debugger framework
Source code: Lib/bdb.py
Audit events table
This table contains all events raised by
or sys.audit()
calls throughout the CPython runtime and the standard library. These calls were added in 3.8.0 or later.
PySys_Audit()
pdb — The Python Debugger
Source code: Lib/pdb.py
The Python Profilers
Source code: Lib/profile.py
and Lib/pstats.py
trace — Trace or track Python statement execution
Source code: Lib/trace.py
tracemalloc — Trace memory allocations
Source code: Lib/tracemalloc.py
timeit — Measure execution time of small code snippets
Source code: Lib/timeit.py