Solaris commands for process management - truss

truss – for tracing user/library/system calls and signals

bash-3.2# truss ls
execve("/usr/bin/ls", 0x0804759C, 0x080475A4)  argc = 1
sysinfo(SI_MACHINE, "i86pc", 257)               = 6
mmap(0x00000000, 32, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_ANON, -1, 0) = 0xFEFF0000
mmap(0x00000000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANON, -1, 0) = 0xFEFB0000
mmap(0x00000000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANON, -1, 0) = 0xFEFA0000
memcntl(0xFEFBE000, 13408, MC_ADVISE, MADV_WILLNEED, 0, 0) = 0
memcntl(0x08050000, 3784, MC_ADVISE, MADV_WILLNEED, 0, 0) = 0
resolvepath("/usr/lib/ld.so.1", "/lib/ld.so.1", 1023) = 12
resolvepath("/usr/bin/ls", "/usr/bin/ls", 1023) = 11
sysconfig(_CONFIG_PAGESIZE)                     = 4096
stat64("/usr/bin/ls", 0x08047180)               = 0
open("/var/ld/ld.config", O_RDONLY)             Err#2 ENOENT
stat64("/lib/libsec.so.1", 0x08046A30)          = 0
resolvepath("/lib/libsec.so.1", "/lib/libsec.so.1", 1023) = 16
open("/lib/libsec.so.1", O_RDONLY)              = 3


Shows you system calls made by a process along with parameters of the function - very good for program execution traces. Use -u a.out to see user-level function calls. Note "a.out" is typed literally as "a.out" - not replaced with the name of the program

No comments:

Post a Comment

Should I trust AI

 Should I trust AI? So far no, sorry.  I tested for the moment (May, 2025) most advanced model for programming and ask very simple question:...