#!/bin/bash
PID=147178
echo "=== Thread wait channels ==="
for tid_dir in /proc/$PID/task/*/; do
    tid=$(basename "$tid_dir")
    wc=$(cat "$tid_dir/wchan" 2>/dev/null)
    echo "$wc"
done | sort | uniq -c | sort -rn | head -20

echo ""
echo "=== Log tail ==="
tail -5 /home/fabian/comfyui3.log

echo ""
echo "=== GPU power ==="
cat /sys/class/drm/card0/device/hwmon/hwmon*/power1_average 2>/dev/null || echo "no power info"

echo ""
echo "=== Memory ==="
free -h | head -3

echo ""
echo "=== comgr cache ==="
ls /home/fabian/.cache/comgr/ 2>/dev/null | wc -l
echo "DONE"
