trace [ -ct ] [ -o filename ] -p pid
trace runs the specified command until it exits. It intercepts the system calls and signals of a process. The name of the system call, its arguments and result are listed on the standard output.
Each line in the trace contains the system call name, followed by its arguments in parentheses and its result. Error returns (result = -1) have the error name and error message appended. Signals are printed as a signal name followed by the signal number. Arguments are printed according to their type. Structure pointers are always printed as hex addresses. Character pointers are dereferenced and printed as a quoted string. Non-printing characters in strings are represented by escape codes. Only the first 32 bytes of strings are printed; longer strings have two dots appended following the closing quote.
The quick brown fox jumps over t ..
Strings with more than 50% non-printing characters are assumed to contain binary data and are represented by a null string followed by two dots.
""..
example% trace date gettimeofday (0x21474, 0x2147c) = 0 gettimeofday (0x21474, 0) = 0 gettimeofday (0xefffc78, 0x214ac) = 0 ioctl (1, 0x40067408, 0xefffa10) = -1 ENOTTY (Inappropriate ioctl for device) fstat (1, 0xefffa30) = 0 getpagesize () = 8192 brk (0x27640) = 0 close (0) = 0 Thu Dec 4 14:16:36 PST 1986 write (1, "Thu Dec 4 14:16:36 PST 1986\n", 29) = 29 close (1) = 0 close (2) = 0 exit (0) = ? example%
Programs that use the setuid bit do not have effective user ID privileges while being traced.
Child processes of a traced process are not traced.
A traced process ignores SIGSTOP.
A traced process runs slowly.
Created by unroff & hp-tools. © somebody (See intro for details). All Rights Reserved. Last modified 11/5/97