📄 trace.5
字号:
.\" SCCSID: @(#)trace.5 8.1 9/11/90.TH trace 5.SH Nametrace \- system call tracer device.SH Description.NXR "trace file".NXR "system call tracer device".NXAM "open system call" "trace file".NXAM "close system call" "trace file".NXAM "read system call" "trace file".NXAM "ioctl system call" "trace file".NXAM "select system call" "trace file"The file.PN /dev/traceis the system call trace device. It supports the following system calls:.PN open ,.PN close ,.PN read ,.PN ioctl ,and.PN select .The device supports 16 (configurable in .PN sys/systrace.has TR_USRS)simultaneous users. It uses an 8192-byte buffer for trace records.The choice of which system calls to trace isdone with the .PN ioctlsystemcall. The .PN selectcall is used for efficient reading of the device.The.PN selectcalluses an 8192-byte buffer and returnswhen the buffer is 60% full.It is required that the user use a buffer the same sizeas the system buffersize defined in .PN sys/systrace.has TR_BUFSIZE.All .PN ioctloperations are defined in the header file, .PN sys/systrace.h .The .PN ioctlcalls are:.PP.TStab (@) ;lfHB lfHBlfR lfR ._.sp 4pioctl@arg (pointer to).sp 4p_.sp 6pIOTR_GETOFF@int aIOTR_GETON@int aIOTR_GETALL@int aIOTR_GETPIDS@int a[10]IOTR_GETUIDS@int a[10]IOTR_GETSYSC@int a[10]IOTR_GETPGRP@int a[10]IOTR_SETOFF@int aIOTR_SETON@int aIOTR_SETALL@int aIOTR_SETPIDS@int a[10]IOTR_SETUIDS@int a[10]IOTR_SETSYSC@int a[10]IOTR_SETPGRP@int a[10].sp 6p_.TE.PP.SH ExamplesA prototype example (with missing parts):.EX 0char cmd[BUFSIZ],buf[TR_BUFSIZ];int pgrp[10],i;fd = open("/dev/trace",0); /* open the device */pgrp[0] = dofork(cmd); /* fork the command to trace */for (i=1;i<TR_PGRP;i++) /* dofork sleeps 2 seconds while */ pgrp[i] = 0; /* we set up to do the trace */i = ioctl(fd,IOTR_SETPGRP,pgrp);/* set up for the trace *//* select code goes here */read(fd,buf,sizeof(buf));.EE.ad.SH See Alsotrace(1), close(2), ioctl(2), open(2), read(2), select(2)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -