进程中线程查看及线程栈查看

进程线程查看 可以通过一下方法查看: 命令: ps top pidstat pstree 文件: proc filesystem 使用 ps ps与线程相关的参数 THREAD DISPLAY H Show threads as if they were processes. -L Show threads, possibly with LWP and NLWP columns. m Show threads after processes. -m Show threads after processes. -T Show threads, possibly with SPID column. 使用-L ps -eLo pid,tid,tgid,pgrp,args [root@centosgpt ~]# ps -eLo pid,tid,tgid,pgrp,args|grep python 1173 1173 1173 1173 /usr/bin/python -Es /usr/sbin/tuned -l -P 1173 1594 1173 1173 /usr/bin/python -Es /usr/sbin/tuned -l -P 1173 1595 1173 1173 /usr/bin/python -Es /usr/sbin/tuned -l -P 1173 1596 1173 1173 /usr/bin/python -Es /usr/sbin/tuned -l -P 1173 1613 1173 1173 /usr/bin/python -Es /usr/sbin/tuned -l -P 77189 77189 77189 77188 grep --color=auto python 使用-m显示 ps -mLe ...

2019-10-12 · 10 min · 2039 words

函数栈的调用

 本篇主要通过反汇编与GDB两种方式分析函数栈的使用过程。 反编译方法: gcc -S Stop after the stage of compilation proper; do not assemble. The output is in theform of an assembler code file for each non-assembler input file specified.By default, the assembler file name for a source file is made by replacing the suffix.c, .i, etc., with .s.Input files that don't require compilation are ignored. gcc -S -o [source].s [source].c objdump gcc stack.c -o stack.oobjdump -S ./stack.o > stack_objdump.s 编译环境: 环境: cenos7, X86_64 ...

2019-07-07 · 9 min · 1777 words