#!/bin/bash
PID=$(pgrep -f 'main.py')
echo "PID: $PID"

echo "=== SUDO STRACE 3s ==="
sudo timeout 3 strace -p $PID -e trace=write,read,ioctl,futex -c 2>&1

echo "=== THREAD STACKS (py-spy) ==="
sudo py-spy dump --pid $PID 2>/dev/null || echo "py-spy not available"

echo "=== LOG TAIL ==="
tail -5 /home/fabian/comfyui.log
