1KTRACE(1) 386BSD Reference Manual KTRACE(1) 2 3NNAAMMEE 4 kkttrraaccee - enable kernel process tracing 5 6SSYYNNOOPPSSIISS 7 kkttrraaccee [--aaCCccddii] [--ff _t_r_f_i_l_e] [--gg _p_g_r_p] [--pp _p_i_d] [--tt _t_r_s_t_r] 8 kkttrraaccee [--aaddii] [--ff _t_r_f_i_l_e] [--tt _t_r_s_t_r] command 9 10DDEESSCCRRIIPPTTIIOONN 11 KKttrraaccee enables kernel trace logging for the specified processes. Kernel 12 trace data is logged to the file _k_t_r_a_c_e._o_u_t. The kernel operations that 13 are traced include system calls, namei translations, signal processing, 14 and I/O. 15 16 Once tracing is enabled on a process, trace data will be logged until 17 either the process exits or the trace point is cleared. A traced process 18 can generate enormous amounts of log data quickly; It is strongly 19 suggested that users memorize how to disable tracing before attempting to 20 trace a process. The following command is sufficient to disable tracing 21 on all user owned processes, and, if executed by root, all processes: 22 23 $ trace -C 24 25 The trace file is not human readable; use kdump(1) to decode it. 26 27 The options are as follows: 28 29 --aa Append to the trace file instead of truncating it. 30 31 --CC Disable tracing on all user owned processes, and, if executed by 32 root, all processes in the system. 33 34 --cc Clear the trace points associated with the specified file or 35 processes. 36 37 --dd Descendants; perform the operation for all current children of 38 the designated processes. 39 40 --ff _f_i_l_e 41 Log trace records to _f_i_l_e instead of _k_t_r_a_c_e._o_u_t. 42 43 --gg _p_g_i_d 44 Enable (disable) tracing on all processes in the process group 45 (only one --gg flag is permitted). 46 47 --ii Inherit; pass the trace flags to all future children of the 48 designated processes. 49 50 --pp _p_i_d Enable (disable) tracing on the indicated process id (only one --pp 51 flag is permitted). 52 53 --tt _t_r_s_t_r 54 The string argument represents the kernel trace points, one per 55 letter. The following table equates the letters with the 56 tracepoints: 57 58 cc trace system calls 59 nn trace namei translations 60 ii trace I/O 61 ss trace signal processing 62 63 _c_o_m_m_a_n_d 64 Execute _c_o_m_m_a_n_d with the specified trace flags. 65 66 67 The --pp, --gg, and _c_o_m_m_a_n_d options are mutually exclusive. 68 69EEXXAAMMPPLLEESS 70 # trace all kernel operations of process id 34 71 $ ktrace -p 34 72 73 # trace all kernel operations of processes in process group 15 and # pass 74 the trace flags to all current and future children 75 $ ktrace -idg 15 76 77 # disable all tracing of process 65 78 $ ktrace -cp 65 79 80 # disable tracing signals on process 70 and all current children 81 $ ktrace -t s -cdp 70 82 83 # enable tracing of I/O on process 67 84 $ ktrace -ti -p 67 85 86 # run the command "w", tracing only system calls 87 $ ktrace -tc w 88 89 # disable all tracing to the file "tracedata" 90 $ ktrace -c -f tracedata 91 92 # disable tracing of all processes owned by the user 93 $ ktrace -C 94 95SSEEEE AALLSSOO 96 kdump(1) 97 98HHIISSTTOORRYY 99 The kkttrraaccee command is currently under development. 100 101BSD Experimental July 26, 1991 2 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133