]> git.saurik.com Git - apple/system_cmds.git/blob - lskq.tproj/lskq.1
system_cmds-790.tar.gz
[apple/system_cmds.git] / lskq.tproj / lskq.1
1 .\" Copyright (c) 2015, Apple Inc. All rights reserved.
2 .\"
3 .Dd Apr 20, 2015
4 .Dt lskq 1
5 .Os "Mac OS X"
6 .Sh NAME
7 .Nm lskq
8 .Nd display process kqueue state
9 .Sh SYNOPSIS
10 .Nm lskq
11 .Op Fl vhe
12 .Op Fl p Ar <pid> | Fl a
13 .Sh DESCRIPTION
14 The
15 .Nm lskq
16 command enumerates kqueues and registered kevents of running processes.
17 .Sh OPTIONS
18 .Pp
19 .Bl -tag -width xxx
20 .It Fl p Ar <pid>
21 Show kqueues of process
22 .Ar <pid> .
23 .It Fl a
24 Show kqueues for all running processes. Requires root.
25 .It Fl v
26 Verbose: show opaque user data and filter-specific extension fields.
27 .It Fl e
28 Ignore empty kqueues.
29 .It Fl r
30 Print fields in raw hex.
31 .It Fl h
32 Show help and exit.
33 .El
34 .Sh OUTPUT
35 .Nm lskq
36 prints one line of output for each registered kevent, consisting of process,
37 kqueue, and kevent information. For kqueues with no registered kevents, a single
38 line is output with an ident of `-'. See
39 .Xr kevent 2
40 for field semantics. The output columns are:
41 .Bl -tag -width xxxxxxxxxxxx
42 .It command
43 shortened process name.
44 .It pid
45 process identifier.
46 .It kq
47 file descriptor corresponding to kqueue, or ``wq'' for the special workq kqueue.
48 .It kqst
49 kqueue status bitmask.
50 .Bl -tag -width xxxxxxx -compact
51 .It Sy k
52 kqueue is in a
53 .Fn kevent*
54 wait set (KQ_SLEEP).
55 .It Sy s
56 kqueue is in a
57 .Fn select
58 wait set (KQ_SEL).
59 .It Sy 3 6 q
60 Type of kevents on this kqueue: KEV32, KEV64, or KEV_QOS.
61 .El
62 .It ident
63 kevent identifier. The meaning depends on the kevent filter specified. Where
64 possible,
65 .Nm lskq
66 prints both numeric and symbolic names.
67 .It filter
68 kevent filter type (EVFILT_*).
69 .It fdtype
70 file descriptor type, for filters operating on file descriptors.
71 .It fflags
72 kevent filter flags bitmask. The meaning of each field depends on the filter type.
73 .Bl -tag -width xxxxxxx -compact
74 .Pp
75 .It EVFILT_READ:
76 .It Sy l
77 NOTE_LOWAT
78 .Pp
79 .It EVFILT_MACHPORT:
80 .It Sy r
81 MACH_RCV_MSG
82 .Pp
83 .It EVFILT_VNODE:
84 .It Sy d
85 NOTE_DELETE
86 .It Sy w
87 NOTE_WRITE
88 .It Sy e
89 NOTE_EXTEND
90 .It Sy a
91 NOTE_ATTRIB
92 .It Sy l
93 NOTE_LINK
94 .It Sy r
95 NOTE_RENAME
96 .It Sy v
97 NOTE_REVOKE
98 .Pp
99 .It EVFILT_PROC:
100 .It Sy x
101 NOTE_EXIT
102 .It Sy t
103 NOTE_EXITSTATUS
104 .It Sy d
105 NOTE_EXIT_DETAIL
106 .It Sy f
107 NOTE_FORK
108 .It Sy e
109 NOTE_EXEC
110 .It Sy s
111 NOTE_SIGNAL
112 .It Sy r
113 NOTE_REAP
114 .Pp
115 .It EVFILT_TIMER:
116 .It Sy s u n
117 NOTE_SECONDS, NOTE_USECONDS, NOTE_NSECONDS
118 .It Sy a
119 NOTE_ABSOLUTE
120 .It Sy c
121 NOTE_CRITICAL
122 .It Sy b
123 NOTE_BACKGROUND
124 .It Sy l
125 NOTE_LEEWAY
126 .Pp
127 .It EVFILT_USER:
128 .It Sy t
129 NOTE_TRIGGER
130 .It Sy a
131 NOTE_FFAND
132 .It Sy o
133 NOTE_FFOR
134 .Pp
135 .It EVFILT_WORKLOOP:
136 .It Sy t w
137 NOTE_WL_THREAD_REQUEST, NOTE_WL_SYNC_WAIT
138 .It Sy !
139 NOTE_WL_SYNC_WAKE
140 .It Sy q
141 NOTE_WL_UPDATE_QOS
142 .It Sy O o
143 NOTE_WL_UPDATE_OWNER, NOTE_WL_DISCOVER_OWNER
144 .El
145 .It flags
146 kevent generic flags bitmask.
147 .Bl -tag -width xxxxxxx -compact
148 .It Sy a
149 EV_ADD
150 .It Sy n
151 EV_ENABLE
152 .It Sy d
153 EV_DISABLE
154 .It Sy x
155 EV_DELETE
156 .Pp
157 .It Sy r
158 EV_RECEIPT
159 .It Sy 1
160 EV_ONESHOT
161 .It Sy c
162 EV_CLEAR
163 .It Sy s
164 EV_DISPATCH
165 .Pp
166 .It Sy u
167 EV_UDATA_SPECIFIC
168 .It Sy p
169 EV_FLAG0 (EV_POLL)
170 .It Sy b
171 EV_FLAG1 (EV_OOBAND)
172 .It Sy o
173 EV_EOF
174 .It Sy e
175 EV_ERROR
176 .El
177 .It evst
178 kevent status bitmask.
179 .Bl -tag -width xxxxxxx -compact
180 .It Sy a
181 KN_ACTIVE (event has triggered)
182 .It Sy q
183 KN_QUEUED (event has been added to the active list)
184 .It Sy d
185 KN_DISABLED
186 .It Sy s
187 KN_STAYQUEUED (event is marked as always-enqueued on the active list)
188 .Pp
189 .It Sy o
190 KN_DROPPING
191 .It Sy u
192 KN_USEWAIT
193 .It Sy c
194 KN_ATTACHING
195 .It Sy f
196 KN_DEFERDROP
197 .It Sy t
198 KN_TOUCH
199 .El
200 .It data
201 Filter-specific data.
202 .El
203 .Pp
204 If the
205 .Fl v
206 (verbose) option is specified, the opaque user-data field and further
207 filter-specific extension fields are printed in raw hexadecimal.
208 .Sh NOTES
209 The output of
210 .Nm lskq
211 is not an atomic snapshot of system state. In cases where
212 .Nm lskq
213 is able to detect an inconsistency, a warning will be printed.
214 .Pp
215 Not all flags are symbolicated. Use
216 .Fl r
217 (raw mode) to inspect additional flags.
218 .Sh SEE ALSO
219 .Xr kqueue 2 ,
220 .Xr kevent 2 ,
221 .Xr ddt 1 ,
222 .Xr lsof 8 ,
223 .Xr lsmp 1