blob: aa5f0f60f74b22d78837729512668631d92a60a8 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
#!/bin/sh
# SPDX-License-Identifier: BSD-3-Clause
# Copyright (c) 2026 Open-IOV contributors
# state_log.sh <pid> - 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
|