当前位置:网站首页>pstack和dmesg
pstack和dmesg
2022-06-11 19:06:00 【我要精通C++】
活着的时候用pstack,死了看dmesg,让我们看看pstack的样子吧:
[[email protected] ~]$ which pstack
/usr/bin/pstack
[[email protected] ~]$ file /usr/bin/pstack
/usr/bin/pstack: symbolic link to `gstack'
[[email protected] ~]$ which gstack
/usr/bin/gstack
[[email protected] ~]$ file /usr/bin/gstack
/usr/bin/gstack: POSIX shell script, ASCII text executable
[[email protected] ~]$ more /usr/bin/gstack
#!/bin/sh
if test $# -ne 1; then
echo "Usage: `basename $0 .sh` <process-id>" 1>&2
exit 1
fi
if test ! -r /proc/$1; then
echo "Process $1 not found." 1>&2
exit 1
fi
# GDB doesn't allow "thread apply all bt" when the process isn't
# threaded; need to peek at the process to determine if that or the
# simpler "bt" should be used.
backtrace="bt"
if test -d /proc/$1/task ; then
# Newer kernel; has a task/ directory.
if test `/bin/ls /proc/$1/task | /usr/bin/wc -l` -gt 1 2>/dev/null ; then
backtrace="thread apply all bt"
fi
elif test -f /proc/$1/maps ; then
# Older kernel; go by it loading libpthread.
if /bin/grep -e libpthread /proc/$1/maps > /dev/null 2>&1 ; then
backtrace="thread apply all bt"
fi
fi
GDB=${GDB:-/usr/bin/gdb}
# Run GDB, strip out unwanted noise.
# --readnever is no longer used since .gdb_index is now in use.
$GDB --quiet -nx $GDBARGS /proc/$1/exe $1 <<EOF 2>&1 |
set width 0
set height 0
set pagination no
$backtrace
EOF
/bin/sed -n \
-e 's/^\((gdb) \)*//' \
-e '/^#/p' \
-e '/^Thread/p'
[[email protected] ~]$ which dmesg
/usr/bin/dmesg
[[email protected] ~]$ file /usr/bin/dmesg
/usr/bin/dmesg: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, BuildID[sha1]=8b0c53b5d6f76a923ef6b22a266719fd3ab0eb5b, stripped
边栏推荐
- leetcode:66.加一
- SAP BTP 上 workflow 和 Business Service 的 project 管理
- Uploading and downloading of necessary files in development
- First acquaintance with enterprise platform
- collect.stream().collect()方法的使用
- 今天睡眠质量记录60分
- cf:F. Shifting String【字符串按指定顺序重排 + 分组成环(切割联通分量) + 各组最小相同移动周期 + 最小公倍数】
- Complete in-depth learning of MySQL from 0 to 1 -- phase 2 -- basics
- Cf:g. count the trains [sortedset + bisect + simulation maintaining strict decreasing sequence]
- 开发中必备的文件的上传与下载
猜你喜欢
![cf:A. Print a Pedestal (Codeforces logo?) [simple traversal simulation]](/img/5e/0acd39d572954e5ecb936f49511d94.png)
cf:A. Print a Pedestal (Codeforces logo?) [simple traversal simulation]

视觉SLAM十四讲笔记-10-2
![leetcode:剑指 Offer 59 - II. 队列的最大值[deque + sortedlist]](/img/6b/f2e04cd1f3aaa9fe057c292301894a.png)
leetcode:剑指 Offer 59 - II. 队列的最大值[deque + sortedlist]

Crop disease detection using image processing technology and convolutional neural network (CNN)

手把手教你学会FIRST集和FOLLOW集!!!!吐血收藏!!保姆级讲解!!!
![[signal denoising] signal denoising based on FFT and fir with matlab code](/img/4c/782afe2652a674d64fccd8d28304ed.png)
[signal denoising] signal denoising based on FFT and fir with matlab code
制造出静态坦克
MySQL in-depth and complete learning - stage 1 - overview of learning

【Multisim仿真】利用运算放大器产生方波、三角波发生器

In 2023, the MPAcc of School of management of Xi'an Jiaotong University approved the interview online in advance
随机推荐
MBA, EMBA, MPa, MEM, pre interview (pre interview) time batch of national colleges and universities has been released (continuously updated) - Wendu Management Institute
Do you know that public fields are automatically filled in
Replace the backbone of target detection (take the fast RCNN as an example)
视觉SLAM十四讲笔记-10-1
Record the phpstudy configuration php8.0 and php8.1 extension redis
求数据库设计毕业信息管理
我不太想在网上开户,网上股票开户安全吗?
手把手教你学会FIRST集和FOLLOW集!!!!吐血收藏!!保姆级讲解!!!
【视频去噪】基于SALT实现视频去噪附Matlab代码
cf:D. Black and White Stripe【连续k个中最少的个数 + 滑动窗口】
Specific methods for JS to realize full screen display
Visual slam lecture notes-10-2
SAP UI5 里 XML 视图根节点运行时实例化的分析
ASEMI的MOS管25N120在不同应用场景的表现
Add your favorite background music
Experience of remote office communication under epidemic situation | community essay solicitation
Flink CDC 在大健云仓的实践
Swagger2 easy to use
《经济学人》:WTO MC12重启 数字经济成为全球经济复苏和增长的核心引擎
Flask CKEditor 富文本编译器实现文章的图片上传以及回显,解决路径出错的问题