Personal tools
You are here: Home UiT files-uit Performance tools strace

strace

by Peter Wind last modified Oct 21, 2011 10:37 AM

trace system calls and signals

Examples:

intercepts and logs all system calls of the program or command "MyProgram.x"

strace -c MyProgram.x

 

attach strace to a running process with PID 12345 (find process number with top or lsof for example)

strace -p 12345

 Each  line  in  the trace contains the system call name, followed by its arguments in parentheses and its return value.

For example

read(3, "7  8 9 10\n", 8120)            = 10

means read from unit 3, the string which is read is "7  8 9 10\n",  10 bytes (or characters) are read.

lseek(3, 0, SEEK_SET)                   = 0

lseek shows direct (random) access. This can be less efficient that sequential access.

 

 

 

 

 

 

Document Actions