lskq(1)

NAME
lskq - display process kqueue state

SYNOPSIS
lskq [-vhe] [-p <pid> | -a]

DESCRIPTION
The lskq command enumerates kqueues and registered kevents of running processes.

OPTIONS

-p <pid>
    Show kqueues of process <pid>.

-a  Show kqueues for all running processes. Requires root.

-v  Verbose: show opaque user data and filter-specific extension fields.

-e  Ignore empty kqueues.

-r  Print fields in raw hex.

-h  Show help and exit.

OUTPUT
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 kevent(2) for field semantics. The output columns are:

command
    shortened process name.

pid process identifier.

kq  file descriptor corresponding to kqueue, or ``wq'' for the special workq kqueue.

kqst
    kqueue status bitmask.
    k   kqueue is in a kevent*() wait set (KQ_SLEEP).
    s   kqueue is in a select() wait set (KQ_SEL).
    3 6 q
        Type of kevents on this kqueue: KEV32, KEV64, or KEV_QOS.

ident
    kevent identifier. The meaning depends on the kevent filter specified. Where possible, lskq prints both numeric and symbolic names.

filter
    kevent filter type (EVFILT_*).

fdtype
    file descriptor type, for filters operating on file descriptors.

fflags
    kevent filter flags bitmask. The meaning of each field depends on the filter type.

    EVFILT_READ:
    l   NOTE_LOWAT

    EVFILT_MACHPORT:
    r   MACH_RCV_MSG

    EVFILT_VNODE:
    d   NOTE_DELETE
    w   NOTE_WRITE
    e   NOTE_EXTEND
    a   NOTE_ATTRIB
    l   NOTE_LINK
    r   NOTE_RENAME
    v   NOTE_REVOKE

    EVFILT_PROC:
    x   NOTE_EXIT
    t   NOTE_EXITSTATUS
    d   NOTE_EXIT_DETAIL
    f   NOTE_FORK
    e   NOTE_EXEC
    s   NOTE_SIGNAL
    r   NOTE_REAP

    EVFILT_TIMER:
    s u n
        NOTE_SECONDS, NOTE_USECONDS, NOTE_NSECONDS
    a   NOTE_ABSOLUTE
    c   NOTE_CRITICAL
    b   NOTE_BACKGROUND
    l   NOTE_LEEWAY

    EVFILT_USER:
    t   NOTE_TRIGGER
    a   NOTE_FFAND
    o   NOTE_FFOR

flags
    kevent generic flags bitmask.
    a   EV_ADD
    n   EV_ENABLE
    d   EV_DISABLE
    x   EV_DELETE

    r   EV_RECEIPT
    1   EV_ONESHOT
    c   EV_CLEAR
    s   EV_DISPATCH

    u   EV_UDATA_SPECIFIC
    p   EV_FLAG0 (EV_POLL)
    b   EV_FLAG1 (EV_OOBAND)
    o   EV_EOF
    e   EV_ERROR

evst
    kevent status bitmask.
    a   KN_ACTIVE (event has triggered)
    q   KN_QUEUED (event has been added to the active list)
    d   KN_DISABLED
    s   KN_STAYQUEUED (event is marked as always-enqueued on the active list)

    o   KN_DROPPING
    u   KN_USEWAIT
    c   KN_ATTACHING
    f   KN_DEFERDROP
    t   KN_TOUCH

data
    Filter-specific data.

If the -v (verbose) option is specified, the opaque user-data field and further filter-specific extension fields are printed in raw hexadecimal.

NOTES
The output of lskq is not an atomic snapshot of system state. In cases where lskq is able to detect an inconsistency, a warning will be printed.

Not all flags are symbolicated. Use -r (raw mode) to inspect additional flags.

SEE ALSO
kqueue(2), kevent(2), ddt(1), lsof(8), lsmp(1)