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
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
|
'\" te
.\" Copyright (c) 2008, Sun Microsystems, Inc. All Rights Reserved
.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License. You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.
.\" See the License for the specific language governing permissions and limitations under the License. When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with
.\" the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
.TH CTSTAT 1 "Jun 16, 2009"
.SH NAME
ctstat \- display active system contracts
.SH SYNOPSIS
.LP
.nf
\fB/usr/bin/ctstat\fR [\fB-a\fR] [\fB-i\fR \fIcontractid...\fR] [\fB-t\fR \fItype...\fR] [\fB-v\fR]
[\fB-T\fR u | d ] [\fIinterval\fR [\fIcount\fR]]
.fi
.SH DESCRIPTION
.sp
.LP
The \fBctstat\fR utility allows a user to observe the contracts active on a
system.
.sp
.LP
Unless you specify the \fB-i\fR or \fB-t\fR option, \fBctstat\fR displays
statistics on all contracts in the system.
.SH OPTIONS
.sp
.LP
The following options are supported:
.sp
.ne 2
.na
\fB\fB-a\fR\fR
.ad
.sp .6
.RS 4n
Display all contracts regardless of state. By default, only those contracts
which are in the owned, inherited, or orphan states are displayed.
.RE
.sp
.ne 2
.na
\fB\fB-i\fR \fIcontractid\fR...\fR
.ad
.sp .6
.RS 4n
Request status on the specified contracts, identified by their numeric contract
identifier (\fIcontract_id\fR).
.sp
This option accepts lists as arguments . Items in the list can be separated by
commas, or enclosed in quotes and separated by commas or spaces.
.RE
.sp
.ne 2
.na
\fB\fB-T\fR \fBu\fR | \fBd\fR\fR
.ad
.sp .6
.RS 4n
Display a time stamp.
.sp
Specify \fBu\fR for a printed representation of the internal representation of
time. See \fBtime\fR(2). Specify \fBd\fR for standard date format. See
\fBdate\fR(1).
.RE
.sp
.ne 2
.na
\fB\fB-t\fR \fItype\fR...\fR
.ad
.sp .6
.RS 4n
Request status on contracts of the specified type (\fItype\fR).
.sp
This option accepts lists as arguments. Items in the list can be separated by
commas, or enclosed in quotes and separated by commas or spaces.
.sp
The following types are supported:
.sp
.ne 2
.na
\fB\fBprocess\fR\fR
.ad
.sp .6
.RS 4n
Process contracts
.RE
.RE
.sp
.ne 2
.na
\fB\fB-v\fR\fR
.ad
.sp .6
.RS 4n
Verbose output.
.RE
.SH OPERANDS
.sp
.LP
The following operands are supported:
.sp
.ne 2
.na
\fB\fIinterval\fR\fR
.ad
.sp .6
.RS 4n
Report once each \fIinterval\fR seconds.
.RE
.sp
.ne 2
.na
\fB\fIcount\fR\fR
.ad
.sp .6
.RS 4n
Print only \fIcount\fR reports.
.RE
.SH OUTPUT
.sp
.LP
The following list defines the column headings and the meanings of a
\fBctstat\fR report:
.sp
.ne 2
.na
\fBCTID\fR
.ad
.sp .6
.RS 4n
The contract \fBID\fR of the contract.
.RE
.sp
.ne 2
.na
\fBZONEID\fR
.ad
.sp .6
.RS 4n
The zone ID of the contract's creator.
.RE
.sp
.ne 2
.na
\fBTYPE\fR
.ad
.sp .6
.RS 4n
The contract type.
.RE
.sp
.ne 2
.na
\fBSTATE\fR
.ad
.sp .6
.RS 4n
The state of the contract:
.sp
.ne 2
.na
\fBowned\fR
.ad
.sp .6
.RS 4n
Contract is owned by a process.
.RE
.sp
.ne 2
.na
\fBinherited\fR
.ad
.sp .6
.RS 4n
The contract owner has exited abnormally and the contract has been inherited by
the owner's process contract.
.RE
.sp
.ne 2
.na
\fBorphan\fR
.ad
.sp .6
.RS 4n
The contract owner has abandoned the contract, the contract owner exited
abnormally and the contract was not inherited by the owner's process contract,
or the process contract which had inherited the contract was abandoned by its
owner.
.RE
.sp
.ne 2
.na
\fBdead\fR
.ad
.sp .6
.RS 4n
The contract is no longer active. It is removed from the system automatically
when all references to it (open file descriptors, contract templates, and
events) have been released.
.RE
.RE
.sp
.ne 2
.na
\fBHOLDER\fR
.ad
.sp .6
.RS 4n
If the contract is in the \fBowned\fR state, the pid of the process that owns
the contract. If the contract is in the \fBinherited\fR state, the id of the
regent process contract.
.RE
.sp
.ne 2
.na
\fBEVENTS\fR
.ad
.sp .6
.RS 4n
The number of unacknowledged critical events pending.
.RE
.sp
.ne 2
.na
\fBQTIME\fR
.ad
.sp .6
.RS 4n
The time until quantum ends, or \fB-\fR if no negotiation is in progress.
.RE
.sp
.ne 2
.na
\fBNTIME\fR
.ad
.sp .6
.RS 4n
The time until negotiation ends, or \fB-\fR if no negotiation is in progress.
.RE
.SH EXAMPLES
.LP
\fBExample 1 \fRReporting on all Contracts in the System
.sp
.LP
The following example reports on all contracts in the system:
.sp
.in +2
.nf
example% ctstat -a
CTID TYPE STATE HOLDER EVENTS QTIME NTIME
1 process owned 100579 0 - -
2 process dead - 1 - -
3 process inherit 1 3 - -
4 process orphan - 0 - -
.fi
.in -2
.sp
.LP
\fBExample 2 \fRObtaining a Verbose Report of All Contracts in the System
.sp
.LP
The following example obtains a verbose report of all contracts in the system:
.sp
.in +2
.nf
example% ctstat -av
CTID TYPE STATE HOLDER EVENTS QTIME NTIME
1 process owned 100579 0 - -
informative event set: none
critical event set: hwerr core
fatal event set: hwerr
parameter set: none
member processes: 100600 100601
inherited ctids: none
service fmri: svc:/system/init:default
svc_fmri ctid: 1
creator: sched
aux:
2 process dead - 1 - -
informative event set: none
critical event set: none
fatal event set: hwerr core
parameter set: pgrponly
member processes: none
inherited ctids: none
service fmri: svc:/system/power:default
svc_fmri ctid: 19
creator: svc.startd
aux: start
.fi
.in -2
.sp
.SH EXIT STATUS
.sp
.LP
The following exit values are returned:
.sp
.ne 2
.na
\fB\fB0\fR\fR
.ad
.sp .6
.RS 4n
Successful completion.
.RE
.sp
.ne 2
.na
\fB\fB1\fR\fR
.ad
.sp .6
.RS 4n
An error occurred.
.RE
.sp
.ne 2
.na
\fB\fB2\fR\fR
.ad
.sp .6
.RS 4n
Invalid arguments.
.RE
.SH FILES
.sp
.LP
\fB/system/contract/*\fR
.SH ATTRIBUTES
.sp
.LP
See \fBattributes\fR(5) for descriptions of the following attributes:
.sp
.sp
.TS
box;
c | c
l | l .
ATTRIBUTE TYPE ATTRIBUTE VALUE
_
Interface Stability See below.
.TE
.sp
.LP
The human readable output is Uncommitted. The invocation is Committed.
.SH SEE ALSO
.sp
.LP
\fBctrun\fR(1), \fBctwatch\fR(1), \fBcontract\fR(4), \fBprocess\fR(4),
\fBattributes\fR(5)
|