]> git.saurik.com Git - apple/system_cmds.git/blame - msa/msa.1
system_cmds-643.30.1.tar.gz
[apple/system_cmds.git] / msa / msa.1
CommitLineData
bd6521f0
A
1.Dd 3/7/14\r
2.Dt msa 1\r
3.Os Darwin\r
4.Sh NAME\r
5.Nm msa\r
6.Nd Mach spy agency. Shows mach ipc, vouchers, importance boosts, etc.\r
7.Sh SYNOPSIS \" Section Header - required - don't modify\r
8.Nm\r
9.Op Fl ho\r
10.Op Fl -help\r
11.Op Fl -verbose\r
12.Op Fl -version\r
13.Op Fl -lifecycle Ar all | user | none\r
14.Op Fl -mach-msg Ar all | user | voucher | none\r
15.Op Fl -ouput Ar file\r
16.Op Fl -raw-timestamps\r
17.Op Fl -mach-absolute-time\r
18.Op Fl -event-index\r
19.Op Ar\r
20.Sh DESCRIPTION\r
21The\r
22.Nm\r
23command is used to observe voucher and importance propagation.\r
24.Nm\r
25displays mach message senders and receivers, message state (voucher, importance, reply expected, etc.) and receiver behavior such as refusing a voucher.\r
26.Nm\r
27shows process & thread lifecycle events, adoption & clearing of vouchers by threads, process importance count changes, and process DarwinBG state.\r
28.Nm\r
29uses the kernel trace facility and can be run live or against saved trace files.\r
30.Pp\r
31Options are as follows:\r
32.Pp\r
33\r
34.Bl -tag -width -indent\r
35.It Fl h, -help\r
36Print help.\r
37.It Fl -verbose\r
38Print additional details and output.\r
39.It Fl -version\r
40Print version info.\r
41.It Fl -lifecycle Ar all | user | none\r
42Set the process and thread lifecycle filter level. The default is "user".\r
43.Bl -tag -width -indent\r
44.It all\r
45Show kernel & userspace process and thread events\r
46.It user\r
47Show userspace process and thread events\r
48.It none\r
49Show no process and thread events\r
50.El\r
51.It Fl -mach-msg Ar all | user | voucher | none\r
52Set the mach message sender/receiver filter level. The default is "voucher".\r
53.Bl -tag -width -indent\r
54.It all\r
55Show all mach message senders/receivers\r
56.It user\r
57Show mach message senders/receivers where both the sender and receiver are in userspace\r
58.It voucher\r
59Show "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.\r
60.It none\r
61Show no mach message senders/receivers\r
62.El\r
63.It Fl o, -output Ar file\r
64Write output to \r
65.Ar file\r
66.It Fl -raw-timestamps\r
67Do not show time as a delta from the first trace event, print the actual time offsets.\r
68.It Fl -mach-absolute-time\r
69Do not translate time from mach absolute units to nanoseconds.\r
70.It Fl -event-index\r
71Print the index of each event.\r
72.El\r
73.Sh OUTPUT\r
74.Nm\r
75displays 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):\r
76\r
77 Time(uS) Type Thread ThreadVoucher Process ;; Message-From/To MsgID MsgVoucher DeliveryTime FLAGS\r
78 9304.56 send 8C2 - coreaudiod (236) ;; -> coreaudiod (236) 2 - - ONEWAY \r
79 9346.52 impdelv 8A6 - coreaudiod (236) ;; linked to coreaudiod (236)'s live importance chain\r
80 9349.02 recv 8A6 - coreaudiod (236) ;; <- coreaudiod (236) 2 5EBD6CB68FF6401F 44.46 \r
81 9361.50 adopt 8A6 5EBD6CB68FF6401F coreaudiod (236) ;;\r
82\r
83.Bl -tag -width -indent\r
84.It The column headers have the following meanings:\r
85.Bl -tag -width -indent\r
86.It Time\r
87The Time column displays the number of microseconds elapsed since\r
88.Nm\r
89started, or since the first event in the trace file. This value may be modified by\r
90.Fl -raw-timestamps\r
91or\r
92.Fl -mach-absolute-time.\r
93You might set these flags in order to correlate timestamps with output from another process that was printing mach_absolute_time() based timestamps.\r
94.It Type\r
95This describes the type of event being reported. Information to the right of the ';;' will vary based on this type.\r
96.It Thread\r
97The Thread column shows the thread id of the thread that generated the event. This is the thread id as displayed by\r
98.Xr trace 1\r
99and\r
100.Xr kdprof 1\r
101and 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.\r
102.It ThreadVoucher\r
103The ThreadVoucher column shows the id of any voucher currently adopted by the thread. This voucher id is the same identifier as shown by\r
104.Xr lsmp 1 .\r
105A '-' means that\r
106.Nm\r
107has not yet seen a voucher adopt for the thread. A NULL voucher is displayed as '0'.\r
108.It Process\r
109The Process column shows the name and pid of the process executing. The name is limited to 16 characters and may appear truncated.\r
110.El\r
111.It Mach message send/recv have the following additional column headers:\r
112.Bl -tag -width -indent\r
113.It Message-From/To\r
114This 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\r
115.Nm\r
116was unable to determine the source or destination of the message.\r
117.It MsgID\r
118The 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.\r
119.It MsgVoucher\r
120If 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.\r
121.It DeliveryTime\r
122This is the time it took to deliver the message, in uS. If the time cannot be calculated, it will show as '-'.\r
123.It FLAGS\r
124The FLAGS field will indicate various mach message behaviors:\r
125.Bl -tag -width -indent\r
126.It ONEWAY\r
127This message cannot be replied to\r
128.It MSGH_BITS_RAISED_IMPORTANCE\r
129This message carries "old style" importance\r
130.It VOUCHER-REFUSED\r
131The message carried a voucher, and the receiver refused to accept it\r
132.El\r
133.El\r
134.El\r
135.Sh EXAMPLES\r
136.Bl -tag -width -indent\r
137.It Here are several examples of usage:\r
138.Bl -tag -width -indent\r
139.It msa | grep BOOST\r
140This will show live boost/unboost behavior. Useful for watching what UI interactions will cause boosting.\r
141.It msa | grep -e APP-NAME -e DAEMON-NAME -e OTHER-DAEMON-NAME\r
142This 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.\r
143.It trace -L /tmp/temp.trace; msa /tmp/temp.trace\r
144This uses trace to capture a trace file for later analysis by msa.\r
145.El\r
146.El\r
147.Sh SEE ALSO \r
148.\" List links in ascending order by section, alphabetically within a section.\r
149.\" Please do not reference files that do not exist without filing a bug report\r
150.Xr kdprof 1 ,\r
151.Xr lsmp 1,\r
152.Xr trace 1\r
153.\" .Sh BUGS \" Document known, unremedied bugs\r
154.\" .Sh HISTORY \" Document history if command behaves in a unique manner