This preview shows page 1. Sign up to view the full content.
Unformatted text preview: ctrl-c User hits ctrl-c 8.7 Tools for Manipulating Processes
Unix systems provide a number of useful tools for monitoring and manipulating processes.
STRACE: Prints a trace of each system call invoked by a program and its children. A fascinating tool for the curious student. Compile your program with -static to get a cleaner trace without a lot of output related to shared libraries. PS: Lists processes (including zombies) currently in the system. Prints information about the resource usage of current processes. Sends a signal to a process. Useful for debugging programs with signal handlers and cleaning up wayward processes. TOP: KILL: /proc (Linux and Solaris) : A virtual ﬁlesystem that exports the contents of numerous kernel data structures in an ASCII text form that can be read by user programs. For example, type “cat /proc/loadavg” to see the current load average on your Linux system. 8.8 Summary
Exceptional control ﬂow occurs at all levels of a computer system. At the hardware level, exceptions are abrupt changes in the control ﬂow that are triggered by events in the processor. At the operating system level, the kernel triggers abrupt...
View Full Document
- Spring '10
- The American