2 .\" Copyright (c) 2005, Sun Microsystems, Inc.
3 .\" All Rights Reserved.
4 .\" 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.
5 .\" 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.
6 .\" 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]
7 .TH CPC_ACCESS 3CPC "Mar 28, 2005"
9 cpc_access \- test access CPU performance counters
13 cc [ \fIflag\fR... ] \fIfile\fR... \(milcpc [ \fIlibrary\fR... ]
16 \fBint\fR \fBcpc_access\fR(\fBvoid\fR);
22 Access to CPU performance counters is possible only on systems where the
23 appropriate hardware exists and is correctly configured. The \fBcpc_access()\fR
24 function \fBmust\fR be used to determine if the hardware exists and is
25 accessible on the platform before any of the interfaces that use the counters
29 When the hardware is available, access to the per-process counters is always
30 allowed to the process itself, and allowed to other processes mediated using
31 the existing security mechanisms of \fB/proc\fR.
35 Upon successful completion, \fBcpc_access()\fR returns \fB0\fR. Otherwise, it
36 returns \fB\(mi1\fR and sets \fBerrno\fR to indicate the error.
39 By default, two common \fBerrno\fR values are decoded and cause the library to
40 print an error message using its reporting mechanism. See
41 \fBcpc_seterrfn\fR(3CPC) for a description of how this behavior can be
46 The \fBcpc_access()\fR function will fail if:
53 Another process may be sampling system-wide CPU statistics.
62 CPU performance counters are inaccessible on this machine. This error can occur
63 when the machine supports CPU performance counters, but some software
64 components are missing. Check to see that all CPU Performance Counter packages
65 have been correctly installed.
71 See \fBattributes\fR(5) for descriptions of the following attributes:
79 ATTRIBUTE TYPE ATTRIBUTE VALUE
83 Interface Stability Obsolete
89 \fBcpc\fR(3CPC), \fBcpc_open\fR(3CPC), \fBcpc_seterrfn\fR(3CPC),
90 \fBlibcpc\fR(3LIB), \fBproc\fR(4), \fBattributes\fR(5)
94 The \fBcpc_access()\fR function exists for binary compatibility only. Source
95 containing this function will not compile. This function is obsolete and might
96 be removed in a future release. Applications should use \fBcpc_open\fR(3CPC)