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/_TestScripts/Scripts and Tests/pyspy3.sh
T
2026-08-20 00:45:43 +02:00

18 lines
654 B
Bash

#!/bin/bash
pid=$(pgrep -f "python.*main.py" | head -1)
echo "PID: $pid"
echo 0 | sudo tee /proc/sys/kernel/yama/ptrace_scope > /dev/null 2>&1
/home/fabian/ComfyUI/venv/bin/py-spy dump --pid $pid 2>&1 | head -50
echo ""
echo "=== Thread states ==="
for tid in $(ls /proc/$pid/task/ 2>/dev/null); do
state=$(cat /proc/$pid/task/$tid/stat 2>/dev/null | awk '{print $3}')
ticks=$(cat /proc/$pid/task/$tid/stat 2>/dev/null | awk '{print $14+$15}')
if [ "$state" = "R" ] || [ "$ticks" -gt 1000 ] 2>/dev/null; then
echo " TID $tid: state=$state ticks=$ticks"
fi
done
echo ""
echo "=== Last 5 log ==="
tail -5 /home/fabian/comfyui8.log