Python support for the perf map compatible profilers — Python 3.16.0a0 documentation

docs.python.org

Tin mới

Instrumenting CPython with DTrace and SystemTap

Annotations Best Practices

Python Module Index

3.16.0a0 Documentation

Using the samply profiler¶

The Linux perf profiler and samply are powerful tools that allow you to profile and obtain information about the performance of your application. Both tools have vibrant ecosystems that aid with the analysis of the data

How to enable perf profiling support¶

perf profiling support can be enabled either from the start using the environment variable PYTHONPERFSUPPORT or the -X perf option, or dynamically using sys.activate_stack_trampoline() and sys.deactivate_stack_trampoline

sys.activate_stack_trampoline()

perf profiling support can be enabled either from the start using the environment variable PYTHONPERFSUPPORT or the -X perf option, or dynamically using sys.activate_stack_trampoline() and sys.deactivate_stack_trampoline

--without-frame-pointers

You can check if your system has been compiled with this flag by running: