6 .Nd Mach spy agency. Shows mach ipc, vouchers, importance boosts, etc.
7 .Sh SYNOPSIS \" Section Header - required - don't modify
13 .Op Fl -lifecycle Ar all | user | none
14 .Op Fl -mach-msg Ar all | user | voucher | none
16 .Op Fl -raw-timestamps
17 .Op Fl -mach-absolute-time
23 command is used to observe voucher and importance propagation.
25 displays mach message senders and receivers, message state (voucher, importance, reply expected, etc.) and receiver behavior such as refusing a voucher.
27 shows process & thread lifecycle events, adoption & clearing of vouchers by threads, process importance count changes, and process DarwinBG state.
29 uses the kernel trace facility and can be run live or against saved trace files.
31 Options are as follows:
34 .Bl -tag -width -indent
38 Print additional details and output.
41 .It Fl -lifecycle Ar all | user | none
42 Set the process and thread lifecycle filter level. The default is "user".
43 .Bl -tag -width -indent
45 Show kernel & userspace process and thread events
47 Show userspace process and thread events
49 Show no process and thread events
51 .It Fl -mach-msg Ar all | user | voucher | none
52 Set the mach message sender/receiver filter level. The default is "voucher".
53 .Bl -tag -width -indent
55 Show all mach message senders/receivers
57 Show mach message senders/receivers where both the sender and receiver are in userspace
59 Show "interesting" mach message senders/receivers. An "interesting" message is any message containing a voucher, any message not containing a voucher if the sending thread has adopted a voucher, and any message carrying importance.
61 Show no mach message senders/receivers
63 .It Fl o, -output Ar file
66 .It Fl -raw-timestamps
67 Do not show time as a delta from the first trace event, print the actual time offsets.
68 .It Fl -mach-absolute-time
69 Do not translate time from mach absolute units to nanoseconds.
71 Print the index of each event.
75 displays columns of data, the first five columns are fixed. The data after the fifth column depends on the type of event. Example output below (your terminal will need to be at least 200 characters wide to display this correctly):
77 Time(uS) Type Thread ThreadVoucher Process ;; Message-From/To MsgID MsgVoucher DeliveryTime FLAGS
78 9304.56 send 8C2 - coreaudiod (236) ;; -> coreaudiod (236) 2 - - ONEWAY
79 9346.52 impdelv 8A6 - coreaudiod (236) ;; linked to coreaudiod (236)'s live importance chain
80 9349.02 recv 8A6 - coreaudiod (236) ;; <- coreaudiod (236) 2 5EBD6CB68FF6401F 44.46
81 9361.50 adopt 8A6 5EBD6CB68FF6401F coreaudiod (236) ;;
83 .Bl -tag -width -indent
84 .It The column headers have the following meanings:
85 .Bl -tag -width -indent
87 The Time column displays the number of microseconds elapsed since
89 started, or since the first event in the trace file. This value may be modified by
92 .Fl -mach-absolute-time.
93 You might set these flags in order to correlate timestamps with output from another process that was printing mach_absolute_time() based timestamps.
95 This describes the type of event being reported. Information to the right of the ';;' will vary based on this type.
97 The Thread column shows the thread id of the thread that generated the event. This is the thread id as displayed by
101 and may be cross correlated with trace events shown by either. Note that in some cases a thread in process A may cause changes in process B, for example a thread in Safari might raise the importance of a daemon.
103 The ThreadVoucher column shows the id of any voucher currently adopted by the thread. This voucher id is the same identifier as shown by
107 has not yet seen a voucher adopt for the thread. A NULL voucher is displayed as '0'.
109 The Process column shows the name and pid of the process executing. The name is limited to 16 characters and may appear truncated.
111 .It Mach message send/recv have the following additional column headers:
112 .Bl -tag -width -indent
114 This field shows either the sender or the recipient of the message. The arrow at the beginning will indicate the direction the message is flowing. A '->' means sent to, a '<-' means received from. The name of the sender or recipient is limited to 16 characters and may appear truncated. Rarely, you may see '???' as the name, which means
116 was unable to determine the source or destination of the message.
118 The MsgID is a unique identifier for each mach message. A mach message has exactly one sender, and one receiver. However, a sending process may send several messages to a receiver before any are received. The MsgID allows disambiguation of exact message send and receipt time.
120 If this field is set, it shows the id of the voucher being carried by the mach message. Note that in some cases, the sender will show no voucher, but the receiver will have a voucher. This is the kernel providing a voucher for a process sending "old style" importance to a process that wants to receive vouchers.
122 This is the time it took to deliver the message, in uS. If the time cannot be calculated, it will show as '-'.
124 The FLAGS field will indicate various mach message behaviors:
125 .Bl -tag -width -indent
127 This message cannot be replied to
128 .It MSGH_BITS_RAISED_IMPORTANCE
129 This message carries "old style" importance
131 The message carried a voucher, and the receiver refused to accept it
136 .Bl -tag -width -indent
137 .It Here are several examples of usage:
138 .Bl -tag -width -indent
140 This will show live boost/unboost behavior. Useful for watching what UI interactions will cause boosting.
141 .It msa | grep -e APP-NAME -e DAEMON-NAME -e OTHER-DAEMON-NAME
142 This will restrict output to only events dealing with an app and targetted daemons. This is useful to reduce the amount of data you need to watch.
143 .It trace -L /tmp/temp.trace; msa /tmp/temp.trace
144 This uses trace to capture a trace file for later analysis by msa.
148 .\" List links in ascending order by section, alphabetically within a section.
149 .\" Please do not reference files that do not exist without filing a bug report
153 .\" .Sh BUGS \" Document known, unremedied bugs
154 .\" .Sh HISTORY \" Document history if command behaves in a unique manner