#!/bin/sh # SPDX-License-Identifier: BSD-3-Clause # Copyright (c) 2026 Open-IOV contributors # state_log.sh - 200ms sampler of state/syscall/wchan for the whole run. PID="$1" : > /tmp/state.log while kill -0 "$PID" 2>/dev/null; do st=$(awk '{print $3}' /proc/$PID/stat 2>/dev/null) sc=$(cat /proc/$PID/syscall 2>/dev/null | cut -d' ' -f1-3) wc=$(cat /proc/$PID/wchan 2>/dev/null) echo "$(date +%T.%3N) st=$st sc=[$sc] wchan=$wc" >> /tmp/state.log sleep 0.2 done echo "$(date +%T.%3N) GONE" >> /tmp/state.log