Print this page
XXX Remove nawk(1)


 218 .LP
 219 Once an instance of the \fBcpustat\fR utility is running, further attempts to
 220 run \fBcputrack\fR will fail until all instances of \fBcpustat\fR terminate.
 221 .sp
 222 .LP
 223 Sometimes \fBcputrack\fR provides sufficient flexibility and prints sufficient
 224 statistics to make adding the observation code to an application unnecessary.
 225 However, more control is occasionally desired. Because the same performance
 226 counter context is used by both the application itself and by the agent LWP
 227 injected into the application by \fBcputrack\fR, it is possible for an
 228 application to interact with the counter context to achieve some interesting
 229 capabilities. See \fBcpc_enable\fR(3CPC).
 230 .sp
 231 .LP
 232 The processor cycle counts enabled by the \fB-t\fR option always apply to both
 233 user and system modes, regardless of the settings applied to the performance
 234 counter registers.
 235 .sp
 236 .LP
 237 The output of \fBcputrack\fR is designed to be readily parseable by
 238 \fBnawk\fR(1) and \fBperl\fR(1), thereby allowing performance tools to be
 239 composed by embedding \fBcputrack\fR in scripts. Alternatively, tools may be
 240 constructed directly using the same \fBAPI\fRs that \fBcputrack\fR is built
 241 upon, using the facilities of \fBlibcpc\fR(3LIB) and \fBlibpctx\fR(3LIB). See
 242 \fBcpc\fR(3CPC).
 243 .sp
 244 .LP
 245 Although \fBcputrack\fR uses performance counter context to maintain separate
 246 performance counter values for each LWP, some of the events that can be counted
 247 will inevitably be impacted by other activities occurring on the system,
 248 particularly for limited resources that are shared between processes (for
 249 example, cache miss rates). For such events, it may also be interesting to
 250 observe overall system behavior with \fBcpustat\fR(1M).
 251 .sp
 252 .LP
 253 For the \fB-T\fR \fIinterval\fR option, if \fIinterval\fR is specified as zero,
 254 no periodic sampling is performed. The performance counters are only sampled
 255 when the process creates or destroys an \fBLWP\fR, or it invokes \fBfork\fR(2),
 256 \fBexec\fR(2), or \fBexit\fR(2).
 257 .SH EXAMPLES
 258 .SS "SPARC"


 394 If a short interval is requested, \fBcputrack\fR may not be able to keep up
 395 with the desired sample rate. In this case, some samples may be dropped.
 396 .SH ATTRIBUTES
 397 .sp
 398 .LP
 399 See \fBattributes\fR(5) for descriptions of the following attributes:
 400 .sp
 401 
 402 .sp
 403 .TS
 404 box;
 405 c | c
 406 l | l .
 407 ATTRIBUTE TYPE  ATTRIBUTE VALUE
 408 Interface Stability     Evolving
 409 .TE
 410 
 411 .SH SEE ALSO
 412 .sp
 413 .LP
 414 \fBnawk\fR(1), \fBperl\fR(1), \fBproc\fR(1), \fBtruss\fR(1), \fBprstat\fR(1M),
 415 \fBcpustat\fR(1M), \fBexec\fR(2), \fBexit\fR(2), \fBfork\fR(2),
 416 \fBsetuid\fR(2), \fBvfork\fR(2), \fBgethrtime\fR(3C), \fBstrtoll\fR(3C),
 417 \fBcpc\fR(3CPC), \fBcpc_bind_pctx\fR(3CPC), \fBcpc_enable\fR(3CPC),
 418 \fBcpc_open\fR(3CPC), \fBlibcpc\fR(3LIB), \fBlibpctx\fR(3LIB), \fBproc\fR(4),
 419 \fBattributes\fR(5)


 218 .LP
 219 Once an instance of the \fBcpustat\fR utility is running, further attempts to
 220 run \fBcputrack\fR will fail until all instances of \fBcpustat\fR terminate.
 221 .sp
 222 .LP
 223 Sometimes \fBcputrack\fR provides sufficient flexibility and prints sufficient
 224 statistics to make adding the observation code to an application unnecessary.
 225 However, more control is occasionally desired. Because the same performance
 226 counter context is used by both the application itself and by the agent LWP
 227 injected into the application by \fBcputrack\fR, it is possible for an
 228 application to interact with the counter context to achieve some interesting
 229 capabilities. See \fBcpc_enable\fR(3CPC).
 230 .sp
 231 .LP
 232 The processor cycle counts enabled by the \fB-t\fR option always apply to both
 233 user and system modes, regardless of the settings applied to the performance
 234 counter registers.
 235 .sp
 236 .LP
 237 The output of \fBcputrack\fR is designed to be readily parseable by
 238 \fBawk\fR(1) and \fBperl\fR(1), thereby allowing performance tools to be
 239 composed by embedding \fBcputrack\fR in scripts. Alternatively, tools may be
 240 constructed directly using the same \fBAPI\fRs that \fBcputrack\fR is built
 241 upon, using the facilities of \fBlibcpc\fR(3LIB) and \fBlibpctx\fR(3LIB). See
 242 \fBcpc\fR(3CPC).
 243 .sp
 244 .LP
 245 Although \fBcputrack\fR uses performance counter context to maintain separate
 246 performance counter values for each LWP, some of the events that can be counted
 247 will inevitably be impacted by other activities occurring on the system,
 248 particularly for limited resources that are shared between processes (for
 249 example, cache miss rates). For such events, it may also be interesting to
 250 observe overall system behavior with \fBcpustat\fR(1M).
 251 .sp
 252 .LP
 253 For the \fB-T\fR \fIinterval\fR option, if \fIinterval\fR is specified as zero,
 254 no periodic sampling is performed. The performance counters are only sampled
 255 when the process creates or destroys an \fBLWP\fR, or it invokes \fBfork\fR(2),
 256 \fBexec\fR(2), or \fBexit\fR(2).
 257 .SH EXAMPLES
 258 .SS "SPARC"


 394 If a short interval is requested, \fBcputrack\fR may not be able to keep up
 395 with the desired sample rate. In this case, some samples may be dropped.
 396 .SH ATTRIBUTES
 397 .sp
 398 .LP
 399 See \fBattributes\fR(5) for descriptions of the following attributes:
 400 .sp
 401 
 402 .sp
 403 .TS
 404 box;
 405 c | c
 406 l | l .
 407 ATTRIBUTE TYPE  ATTRIBUTE VALUE
 408 Interface Stability     Evolving
 409 .TE
 410 
 411 .SH SEE ALSO
 412 .sp
 413 .LP
 414 \fBawk\fR(1), \fBperl\fR(1), \fBproc\fR(1), \fBtruss\fR(1), \fBprstat\fR(1M),
 415 \fBcpustat\fR(1M), \fBexec\fR(2), \fBexit\fR(2), \fBfork\fR(2),
 416 \fBsetuid\fR(2), \fBvfork\fR(2), \fBgethrtime\fR(3C), \fBstrtoll\fR(3C),
 417 \fBcpc\fR(3CPC), \fBcpc_bind_pctx\fR(3CPC), \fBcpc_enable\fR(3CPC),
 418 \fBcpc_open\fR(3CPC), \fBlibcpc\fR(3LIB), \fBlibpctx\fR(3LIB), \fBproc\fR(4),
 419 \fBattributes\fR(5)