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

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