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