check-context-switches.sh
PID=$(pgrep -f 'bin/app' | head -1)
for t in /proc/$PID/task/*; do
printf '%-8s %-10s vol=%-8s nonvol=%s\n' "${t##*/}" "$(cat $t/comm)" \
"$(awk '/^voluntary_ctxt/{print $2}' $t/status)" \
"$(awk '/^nonvoluntary_ctxt/{print $2}' $t/status)"
done