python pystack
2021-03-13 07:30
标签:dump port expand elf head new 打印 进程 moni pystack 用于查看 python 的调用栈信息,与 C 语言的 pstack 和 gstack 功能相似。 /usr/local/bin/pip3 install pystack-debuger python pystack 标签:dump port expand elf head new 打印 进程 moni 原文地址:https://www.cnblogs.com/tongyishu/p/14063136.html概述
使用
pystack 4747 # 查看进程 4747 调用栈的信息,不打印线程号
pystack 4747 -v # 查看进程 4747 调用栈的详细信息,打印线程号。如下所示,4个线程号分别对应4个python调用栈
Standard Output:
[New LWP 5126]
[New LWP 5092]
[New LWP 5088]
[New LWP 5087]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
0x00007f252348bf73 in select () from /lib64/libc.so.6
$1 = (void *) 0x1
Standard Error:
Dumping Threads....
File "/usr/lib/python2.7/site-packages/tuned/exports/dbus_exporter.py", line 154, in _thread_code
self._main_loop.run()
File "/usr/lib64/python2.7/site-packages/gi/overrides/GLib.py", line 574, in run
super(MainLoop, self).run()
---------------
File "/usr/lib/python2.7/site-packages/pyudev/monitor.py", line 402, in run
for fd, _ in eintr_retry_call(notifier.poll):
File "/usr/lib/python2.7/site-packages/pyudev/_util.py", line 167, in eintr_retry_call
return func(*args, **kwargs)
---------------
File "/usr/lib64/python2.7/threading.py", line 622, in wait
self.__cond.wait(timeout, balancing)
File "/usr/lib64/python2.7/threading.py", line 362, in wait
_sleep(delay)
File "
pystack 安装