strace-3.1: description + notes

strace is a system call tracing utility. It is an invaluable tool for diagnosing problems or for understanding how other programs work especially when you have no access to source.

The builder of this package prefers strace over the standard IRIX par due to the following reasons:

This strace should not be confused with the generally less useful IRIX strace (STREAMS trace).

Known problems:


Demo of strace + reader's exercise

Here is an example of some strace output (ls output redirected to /dev/null to make the trace clearer):
% strace ls > /dev/null
execve("/usr/freeware/bin/ls", ["ls"], [/* 52 vars */]) = 0
open("/lib32/rld", O_RDONLY)            = 3
read(3, "\177ELF\1\2\1\0\0\0\0\0\0\0\0\0\0"..., 512) = 512
syssgi(SGI_ELFMAP, 0x3, 0x7fff2cb4, 0x2, 0x20008, 0x1) = 263585792
close(3)                                = 0
sysmp(0x420, 0xe, 0x7fff2ee4, 0x7fff2eec, 0) = 4096
open("/dev/zero", O_RDONLY)             = 3
mmap(0xfbe0000, 32768, PROT_READ|PROT_WRITE, MAP_PRIVATE, 0, 0x2000) = 0xfbe0000close(3)                                = 0
sysinfo(0x6d /* SI_??? */, "R5000 2.1", 257) = 10
syssgi(SGI_TOSSTSAVE, 0, 0xfb69c14, 0xfbe2030, 0, 0xfb6a460) = 0
sysmp(0x420, 0xe, 0, 0x6, 0)            = 4096
brk(0x10023000)                         = 0
syssgi(SGI_USE_FP_BCOPY, 0, 0x181, 0xffffffff, 0, 0x181) = 0
open("/usr/lib/iconv/iconvtab", O_RDONLY) = 3
lseek(3, 0, SEEK_END)                   = 17000
sysmp(0x420, 0xe, 0, 0x2, 0)            = 4096
mmap(0, 20480, PROT_READ, MAP_SHARED, 0, 0x7fff2d00) = 0x4000000
close(3)                                = 0
syssgi(SGI_USE_FP_BCOPY, 0, 0x400, 0xffffffff, 0, 0x400) = 0
xstat(2, "/usr/lib/locale/en_US/LC_CTYPE", {st_mode=020037312, st_size=0, ...}) = 0
open("/usr/lib/locale/en_US/LC_CTYPE", O_RDONLY) = 3
mmap(0, 2592, PROT_READ, MAP_SHARED, 0, 0x403eca) = 0x4008000
close(3)                                = 0
open("/usr/lib/locale/en_US/LC_NUMERIC", O_RDONLY) = 3
read(3, ".,", 2)                        = 2
close(3)                                = 0
time()                                  = 893989431
ioctl(1, TCGETA, 0x7fff2d70)            = -1 EINVAL (Invalid argument)
ioctl(1, TIOCGWINSZ, 0x7fff2dd8)        = -1 EINVAL (Invalid argument)
brk(0x10027000)                         = 0
open(".", O_RDONLY)                     = 3
fcntl(3, F_SETFD, FD_CLOEXEC)           = 0
fxstat(2, 3, {st_mode=S_IFDIR|S_ISUID|S_ISGID|0161000676, st_size=0, ...}) = 0
brk(0x1002b000)                         = 0
ngetdents(0x3, 0x10026a00, 0x4000, 0x7fff2db0) = 224
close(3)                                = 0
ioctl(1, TCGETA, 0x7fff2b60)            = -1 EINVAL (Invalid argument)
write(1, "Old\nidentity\nidentity.pub\nkno"..., 56) = 56
close(1)                                = 0
prctl(PR_GETNSHARE)                     = 0
exit(0)                                 = ?

Reader's exercise:


To auto-install this package, go back and click on the respective install icon.