Commit 821eece2 authored by Kirill Smelkov's avatar Kirill Smelkov

proc_kstacks: Tool to print kernel traceback of all process'es threads

This is useful to do with e.g. wcfs when it is stuck somewhere in the
kernel and neither SIGABRT nor attaching via gdb work.
parent 13c8c87c
#!/bin/bash -e
# Program proc_kstacks dumps /proc/<prog>/tasks/stack
die() {
echo "$*" >&2; exit 1
}
test "$#" = 1 || die "Usage: $0 <pid>"
pid=$1
echo "pid$pid (`cat /proc/$pid/comm`)"
task=/proc/$pid/task
for tid in `cd $task && ls`; do
echo "T$tid"
cat $task/$tid/stack
done
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment