Python/C Profiler Functions
If a performance bottleneck occurs when you run a Python or Python and C/C++ hybrid program, you can use this tool to analyze hotspot functions and locate code problems.
Command Function
Uses ptrace to sample Python programs and Python & C/C++ hybrid programs, analyzes call stacks, obtains top 20 hotspot functions, and draws flame graphs.
Syntax
1 | devkit py-perf [-h | --help] TASK [ARGS] |
An RPM package is used as an example.
Example
View the information about Python/C performance analysis functions:
1 | devkit py-perf -h |
Command output:
1 2 3 4 5 6 7 | Usage: devkit py-perf [-h | --help] TASK [ARGS] The most commonly used devkit py-perf sub tasks are: help Get help information hotspot Run the hotspot collection and analysis task See 'devkit py-perf TASK --help' for more information on a specific task. |
Function |
Description |
|---|---|
help |
Displays help information. |
hotspot |
Python/C performance hotspot analysis. |
Parent topic: Python/C Profiler