> For the complete documentation index, see [llms.txt](https://hansimov.gitbook.io/csapp/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://hansimov.gitbook.io/csapp/part2/ch08-exceptional-control-flow/8.7-tools-for-manipulating-processes.md).

# 8.7 操作进程的工具

Linux 系统提供了大量的监控和操作进程的有用工具。

* **STRACE：**&#x6253;印一个正在运行的程序和它的子进程调用的每个系统调用的轨迹。对于好奇的学生而言，这是一个令人着迷的工具。用 -static 编译你的程序，能得到一个更干净的、不带有大量与共享库相关的输出的轨迹。
* **PS：**&#x5217;出当前系统中的进程（包括僵死进程）。
* **TOP：**&#x6253;印出关于当前进程资源使用的信息。
* **PMAP：**&#x663E;示进程的内存映射。
* **/proc：**&#x4E00;个虚拟文件系统，以 ASCII 文本格式输出大量内核数据结构的内容，用户程序可以读取这些内容。比如，输入 “cat/proc/loadavg”，可以看到你的 Linux 系统上当前的平均负载。
