📄 trace.1
字号:
.\" SCCSID: @(#)trace.1 8.2 4/2/91.TH trace 1.SH Nametrace \- trace system calls of programs.SH Syntax.B trace[\|\fIoptions\fR\|] \fIcmd args...\fR.SH Description.NXR "trace command (general)".NXAM "close system call" "trace command (general)".NXAM "open system call" "trace command (general)".NXAM "ioctl system call" "trace command (general)".NXAM "select system call" "trace command (general)".NXAM "read system call" "trace command (general)".NXR "system call tracer".NXAM "system call tracer" "system call tracer device"The.PN tracecommand with no flag arguments traces for the given\fIcmd\fP and \fIargs\fP all system callsmade and prints a time stamp,the PID, call and/or return values and argumentsand puts its output in the file trace.dump..SH Options.IP "\fB\-f\fI filename\fR" 8Puts dump in file \fIfilename\fP..IP \fB\-z\fR Echos arguments only..PPOnly one of the following option arguments can be specified atone time..PP.IP \fB\-c\fI#\fR 8Traces given PIDs and their children. Up to sixteen PIDs canbe specified..IP \fB\-g\fI#\fR Traces given groups only. Up to sixteen Group IDs can bespecified. .IP \fB\-p\fI#\fR Traces given PIDs only. Up to sixteen PIDs can be specified..IP \fB\-s\fI#\fR Traces given system calls only. Up to sixteen PIDs can bespecified..IP \fB\-u\fI#\fR Traces given UIDs only. Up to sixteen PIDs can be specified..SH Examples.EXtrace \-f ls.dump ls \-l /dev >ls.out.EEruns the cmd ls \-l /dev and puts the trace in ls.dumpand .PN lsoutput in ls.out..EXtrace \-f csh.trace \-p $$ &.EEwill trace your login shell in the background. To stop the tracejust send it a termination signal (that is, kill \-TERM trace_pid)..SH RestrictionsDue to security, no one,not even the super-user can trace anyone else'sprograms. This sort of negates some of the usefulness of the\fB-g\fP and \fB-u\fP flags..PPThe .PN setuid program cannot be traced..PPOnly 16 numberscan be given to the \fB\-c, \-p, \-g, \-u,\fP and \fB\-s\fP flags..PPThe kernel configuration file must contain the following:.EXoptions SYS_TRACEpseudo-device sys_trace.EE.PPIn addition, the superuser must use the following command sequence to create the device:.EXcd /devMAKEDEV trace.EEIf both lines are not in the configuration file or if the device is not made,the message "Cannot open /dev/trace" appears..SH Files.TP 15/dev/traceread only character special device for reading syscall data..TP 15trace.dumpdefault file for the system call trace data..SH See Alsoopen(2), close(2), ioctl(2), select(2), read(2), trace(5)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -