虚拟机:Linux查看线程信息的步骤

电子说

1.2w人已加入

描述

1. 使用 pstree -p PID

ps aux | grep firefox | grep -v grep

charles 26058 0.0 0.0 4908 1152 ? S 19:17 0:00 /bin/sh /usr/lib/firefox-3.5.4/run-mozilla.sh /usr/lib/firefox-3.5.4/firefox

charles 26073 7.6 3.4 284264 70164 ? Sl 19:17 4:36 /usr/lib/firefox-3.5.4/firefox

pstree -p 26058

多线程

2.使用 /proc

cd /proc/26073/task

ls

26073 26074 26075 26076 26085 26086 26087 26092 26403

3. 使用 top 命令:

top -p 26073

然后press shift + h:

多线程

4. 使用 ps -eLf

5. 检查线程占用的内存

cat /proc/statm

6. 使用命令:

ps -Lo pid,ppid,pgid,nlwp,lwp,stat,command -p PID

多线程

7.自己编写一个脚本:

多线程

多线程

打开APP阅读更多精彩内容
声明:本文内容及配图由入驻作者撰写或者入驻合作网站授权转载。文章观点仅代表作者本人,不代表电子发烧友网立场。文章及其配图仅供工程师学习之用,如有内容侵权或者其他违规问题,请联系本站处理。 举报投诉

全部0条评论

快来发表一下你的评论吧 !

×
20
完善资料,
赚取积分