systemtap script
I want to write a script in systemtap and trace memory system call I want to catch number开发者_开发技巧 of memory system calls and memory used by specific process in a fix duration time I don't know how to write this script.
A good startpoint is this script.
The syscalls that allocate memory are sbrk and mmap, so those are the ones to look for.
I would start with the example for system calls from system tap and then make it specific for the system call you are interested in and print out the args of the system call:
http://sourceware.org/systemtap/examples/process/syscalls_by_proc.stp
精彩评论