ToyBed's Life~

toybed.egloos.com

포토로그 방명록


google_adsense




truss - trace system calls and signals by 토이베드

 User Commands                                            truss(1)

NAME
     truss - trace system calls and signals

SYNOPSIS
     truss [-fcaeildDE] [- [tTvx] [!] syscall ,...]
         [- [sS] [!] signal ,...] [- [mM] [!] fault ,...]
         [- [rw] [!] fd ,...]
         [- [uU] [!] lib ,... : [:] [!] func ,...]
         [-o outfile] command | -p pid[/lwps]...

DESCRIPTION
     The truss utility executes the specified  command  and  pro-
     duces  a  trace of the system calls it performs, the signals
     it receives, and the machine faults it incurs. Each line  of
     the  trace output reports either the fault or signal name or
     the system call name with its arguments and return value(s).
     System call arguments are displayed symbolically when possi-
     ble using defines from relevant system headers. For any path
     name  pointer  argument, the pointed-to string is displayed.
     Error returns  are  reported  using  the  error  code  names
     described in intro(3). If, in the case of an error, the ker-
     nel  reports  a  missing  privilege,  a  privilege  name  as
     described in privileges(5) is reported in square brackets ([
     ]) after the error code name.

     Optionally (see  the  -u  option),  truss  also  produce  an
     entry/exit  trace  of  user-level function calls executed by
     the traced process, indented to indicate nesting.

OPTIONS
     For those options that take a list argument,  the  name  all
     can  be  used as a shorthand to specify all possible members
     of the list. If the list begins with a !, the meaning of the
     option  is negated (for example, exclude rather than trace).
     Multiple occurrences of the same option  can  be  specified.
     For  the  same  name in a list, subsequent options (those to
     the right) override previous ones (those to the left).

     The following options are supported:

     -a

         Shows the argument  strings  that  are  passed  in  each
         exec() system call.

     -c

         Counts traced system calls, faults, and  signals  rather
         than displaying the trace line-by-line. A summary report
         is produced after the traced command terminates or  when
         truss  is  interrupted.  If  -f  is  also specified, the
         counts include all traced system calls, faults, and sig-
         nals for child processes.

     -d

         Includes a time stamp on each line of trace output.  The
         time    stamp    appears    as    a   field   containing
         seconds.fraction  at  the  start  of  the   line.   This
         represents  a  time in seconds relative to the beginning
         of the trace.  The first line of the trace output  shows
         the  base time from which the individual time stamps are
         measured, both as seconds since the epoch (see  time(2))
         and  as  a  date string (see ctime(3C) and date(1)). The
         times that are reported are the times that the event  in
         question  occurred.  For  all system calls, the event is
         the completion of the system call, not the start of  the
         system call.

     -D

         Includes a time delta on each line of trace output.  The
         value appears as a field containing seconds.fraction and
         represents the elapsed time for the  LWP  that  incurred
         the event since the last reported event incurred by that
         LWP. Specifically, for system calls,  this  is  not  the
         time spent within the system call.

     -e

         Shows the environment strings that are  passed  in  each
         exec() system call.

     -E

         Includes a time delta on each line of trace output.  The
         value appears as a field containing seconds.fraction and
         represents the difference in time  elapsed  between  the

         represents the difference in time  elapsed  between  the
         beginning and end of a system call.

         In contrast to  the -D option, this  is  the  amount  of
         time spent within the system call.

     -f

         Follows all children created by fork()  or  vfork()  and
         includes  their signals, faults, and system calls in the
         trace output. Normally, only the first-level command  or
         process  is traced. When -f is specified, the process-id
         is included with each line of trace output  to  indicate
         which  process  executed the system call or received the
         signal.

     -i

         Does not display interruptible  sleeping  system  calls.
         Certain  system calls, such as open() and read() on ter-
         minal devices or pipes, can sleep for indefinite periods
         and  are  interruptible.  Normally,  truss  reports such
         sleeping system calls if they  remain  asleep  for  more
         than  one  second.  The  system call is reported again a
         second time when it completes. The -i option causes such
         system  calls  to  be reported only once, when they com-
         plete.

     -l

         Includes the id of the responsible  lightweight  process
         (LWP)  with  each  line  of  trace output. If -f is also
         specified,  both  the  process-id  and  the  LWP-id  are
         included.

     -m [!]fault,...

         Machine faults to trace or exclude. Those faults  speci-
         fied  in the comma-separated list are traced. Faults can
         be specified by name or number (see  <sys/fault.h>).  If
         the  list  begins  with  a  !,  the specified faults are
         excluded from the trace  output.  Default  is  -mall  -m
         !fltpage.

     -M [!]fault,...

         Machine faults that  stop  the  process.  The  specified
         faults  are  added to the set specified by -m. If one of
         the specified faults is incurred, truss leaves the  pro-
         cess  stopped and abandoned (see the -T option). Default
         is -M!all.

     -o outfile

         File to be used for the trace output.  By  default,  the
         output goes to standard error.