Systemtap is a linux System Call and tracking program. If you have used filemon or processmonitor in windows, you will understand it. systemtap is more powerful than processmonitor and more customizable. but obviously, like most linux programs, it is more difficult to use!
Many posts have been posted to install this systemtap. The simplest method is as follows:
- Run the command: sudo apt-get install linux-image-debug-'uname-R'
- Run the command: sudo ln-s vmlinux-debug-'uname-R' vmlinux-'uname-R'
- Run the command: sudo apt-get install systemtap
In this way, you can construct a simple script file a. stp, as shown below:
Probe syscall. open
{
Printf ("% s (% d) open (% s) \ n", execname (), pid (), argstr)
}
Run the following command: sudo stap. /. if STPS goes well, you can see the output. however, when I run pass5, the following error occurs:/usr/lib/systemtap/stapio terminated. The cause is being found.
If you are not used to using such a highly customized tool, you can use strace instead. The usage is simple: strace-f-o out_trace.txt/opt/eclipse I am here to track the file read/write records during eclipse runtime.
References:
- Http://blog.chinaunix.net/u/12679/showart_529575.html (Note: This method is not good, I have a problem in the xubuntu interface, and stap cannot run)
- Https://bugs.launchpad.net/ubuntu/+source/systemtap/+bug/106957
- Http://sourceware.org/systemtap/tutorial/node5.html for compiling systemtap scripts
- Http://www.ibm.com/developerworks/cn/linux/l-systemtap/ uses Systemtap to debug the kernel
- The http://www.xxlinux.com/linux/article/development/soft/20051125/67.html uses truss, strace, ltrace trace