Solaris 1.x to 2.x Transition Guide

truss Command

truss is a new utility, provided to trace system calls performed, signals received, and machine faults incurred. truss offers several significant improvements over the SunOS release 4.x trace(1) command, including the ability to follow forked processes and to deal with multithreaded processes.

The following example shows a summary of traced calls for the date command. With the -c option, truss does not display the trace line by line. Instead, it counts the system calls, signals, and faults, and displays a summary.


example% truss -c date
Fri Sep 18 14:31:30 PDT 1992
syscall      seconds   calls  errors
_exit            .00       1
read             .00       7
write            .00       1
open             .03      12
close            .00      12
time             .00       1
brk              .01       4
lseek            .00       1
fstat            .00       4
ioctl            .00       1
execve           .00       1
mmap             .01      17
munmap           .00       8
                ----     ---    ---
sys totals:      .05      70      0
usr time:        .03
elapsed:         .28

See the truss(1) man page for complete details on all truss options. There are a number of other Solaris 2.6 debugging tools based on proc(4) such as pmap(1).