Use Hotspot Analysis to profile python application using launch application profile scope. When the target executable is a path to python interpreter, the profiler will automatically initiate sample collections for the Python application alongside the Hotspot Analysis. The samples gathered by the Python Profiling Agent will include those from child processes and threads created by the targeted Python script.
Additionally, the Python Profiling Agent also supports profiling Python applications launched from shell scripts.
GUI
To launch the AMDuProf GUI, go to page.
- Click Profile an Application on the Welcome page.
- Provide application path, application options, working directory, and environment variables, if any. Click Next.
- From Predefined Configs, select Hotspots.
- Set the timer interval and profiling signal.
- From the Advanced Options select the Callstack Collection and Callstack Unwind Depth.
- Click Start Profile to start the profiling.
CLI
- Python hotspots
collection
AMDuProfCLI collect --config hotspots -o <output-dir> python <application.py> - Python hotspots with callstack
collection
AMDuProfCLI collect --config hotspots -g -o <output-dir> python <application.py> - Python hotspots when python script is launched from shell
script
AMDuProfCLI collect --config hotspots -o <output-dir> <application.sh>
To show python interpreter functions in the
callgraph/flamegraph
AMDuProfCLI report -I <python_session> --detail --python-show-all
For more detailed information about Hotspot configuration, see Hotspots Analysis.