Linux命令完全指南

Linux pstack命令使用详解

pstack命令 可显示每个进程的栈跟踪。pstack命令必须由相应进程的属主或 root运行。可以使用 pstack来确定进程挂起的位置。此命令允许使用的唯一选项是要检查的进程的PID。

命令软件包下载地址:https://packages.debian.org/sid/pstack

用法

1
pstack pid

实例

1
2
3
4
5
6
7
8
9
10
11
12
13
[root@localhost ~]# ps
PID TTY TIME CMD
7895 pts/0 00:00:00 bash
8793 pts/0 00:00:00 ps
[root@localhost ~]# pstack 7895
#0 0x00007fd8cfe99a3c in waitpid () from /lib64/libc.so.6
#1 0x0000000000440a74 in waitchld.isra.10 ()
#2 0x0000000000441d2c in wait_for ()
#3 0x00000000004339fe in execute_command_internal ()
#4 0x0000000000433c1e in execute_command ()
#5 0x000000000041e255 in reader_loop ()
#6 0x000000000041c8be in main ()
[root@localhost ~]#