-
Notifications
You must be signed in to change notification settings - Fork 822
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a script to dump all stacks from the debug shell (#10178)
* Add a script to dump init's stacks and fd's * Fix LF
- Loading branch information
Showing
1 changed file
with
28 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#! /bin/bash | ||
|
||
set -ue | ||
|
||
for proc in /proc/[0-9]*; do | ||
pid=$(basename "$proc") | ||
|
||
echo -e "\nProcess: $pid" | ||
echo -en "cmd: " | ||
cat "/proc/$pid/cmdline" || true | ||
echo -e "\nstat: " | ||
cat "/proc/$pid/stat" || true | ||
|
||
for tid in $(ls "/proc/$pid/task" || true); do | ||
echo -n "tid: $tid - " | ||
cat "/proc/$pid/task/$tid/comm" || true | ||
cat "/proc/$pid/task/$tid/stack" || true | ||
done | ||
|
||
echo "fds: " | ||
ls -la "/proc/$pid/fd" || true | ||
done | ||
|
||
echo "hvsockets: " | ||
ss -lap --vsock | ||
|
||
echo "meminfo: " | ||
cat /proc/meminfo |