This repository has been archived on 2026-08-19. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
ROCm-Research-Archive/Scripts and Tests/pyspy4.sh
T
2026-08-20 00:45:43 +02:00

22 lines
493 B
Bash

#!/bin/bash
pid=$(pgrep -f "python.*main.py" | head -1)
echo "PID=$pid"
if [ -z "$pid" ]; then
echo "NO PROCESS"
exit 1
fi
# Find py-spy
PYSPY=$(which py-spy 2>/dev/null || find /home/fabian -name py-spy -type f 2>/dev/null | head -1)
if [ -z "$PYSPY" ]; then
PYSPY="/home/fabian/ComfyUI/venv/bin/py-spy"
fi
echo "py-spy=$PYSPY"
# Get stack trace
sudo $PYSPY dump --pid $pid 2>&1 | head -80
echo ""
echo "=== Process stats ==="
ps -p $pid -o pid,pcpu,pmem,rss,etime 2>/dev/null