0.4.2: fix D-state sample merge (grep -vF '' was filtering everything; use awk dedupe)

This commit is contained in:
luna 2026-05-10 22:08:34 -07:00
parent ee0f0da59f
commit 6e39a1db66
2 changed files with 4 additions and 5 deletions

View file

@ -1,6 +1,6 @@
# Maintainer: luna <anassaeneroi@pm.me> # Maintainer: luna <anassaeneroi@pm.me>
pkgname=freeze-watcher pkgname=freeze-watcher
pkgver=0.4.1 pkgver=0.4.2
pkgrel=1 pkgrel=1
pkgdesc="Continuously samples system state and snapshots detailed diagnostics when freeze conditions are detected" pkgdesc="Continuously samples system state and snapshots detailed diagnostics when freeze conditions are detected"
arch=('any') arch=('any')

View file

@ -254,10 +254,9 @@ capture_snapshot() {
fi fi
echo "## D-state processes (with kernel wchan)" echo "## D-state processes (with kernel wchan)"
# Use the snapshot taken before /proc reads to catch transient blockers. # Use the snapshot taken before /proc reads to catch transient blockers.
# Combine 3 rapid samples (~100ms apart) and dedupe by pid. # Combine 3 rapid samples (~100ms apart) and dedupe by pid (column 2).
echo "$dstate_immediate" printf '%s\n%s\n%s\n' "$dstate_immediate" "$dstate_t1" "$dstate_t2" \
echo "$dstate_t1" | grep -vF "$dstate_immediate" 2>/dev/null | awk 'NF >= 4 && $1=="D" && !seen[$2]++' | head -30
echo "$dstate_t2" | grep -vF "$dstate_immediate" | grep -vF "$dstate_t1" 2>/dev/null
echo echo
if [ "${CAPTURE_KERNEL_STACKS:-1}" = "1" ]; then if [ "${CAPTURE_KERNEL_STACKS:-1}" = "1" ]; then
capture_kernel_stacks capture_kernel_stacks