1cpc_access(3CPC) CPU Performance Counters Library Functions cpc_access(3CPC)
2
3
4
6 cpc_access - test access CPU performance counters
7
9 cc [ flag... ] file... −lcpc [ library... ]
10 #include <libcpc.h>
11
12 int cpc_access(void);
13
14
16 Access to CPU performance counters is possible only on systems where
17 the appropriate hardware exists and is correctly configured. The
18 cpc_access() function must be used to determine if the hardware exists
19 and is accessible on the platform before any of the interfaces that use
20 the counters are invoked.
21
22
23 When the hardware is available, access to the per-process counters is
24 always allowed to the process itself, and allowed to other processes
25 mediated using the existing security mechanisms of /proc.
26
28 Upon successful completion, cpc_access() returns 0. Otherwise, it
29 returns −1 and sets errno to indicate the error.
30
31
32 By default, two common errno values are decoded and cause the library
33 to print an error message using its reporting mechanism. See cpc_seter‐
34 rfn(3CPC) for a description of how this behavior can be modified.
35
37 The cpc_access() function will fail if:
38
39 EAGAIN Another process may be sampling system-wide CPU statistics.
40
41
42 ENOSYS CPU performance counters are inaccessible on this machine.
43 This error can occur when the machine supports CPU perfor‐
44 mance counters, but some software components are missing.
45 Check to see that all CPU Performance Counter packages have
46 been correctly installed.
47
48
50 See attributes(5) for descriptions of the following attributes:
51
52
53
54
55 ┌─────────────────────────────┬─────────────────────────────┐
56 │ATTRIBUTE TYPE │ATTRIBUTE VALUE │
57 ├─────────────────────────────┼─────────────────────────────┤
58 │MT-Level │MT-Safe │
59 ├─────────────────────────────┼─────────────────────────────┤
60 │Interface Stability │Obsolete │
61 └─────────────────────────────┴─────────────────────────────┘
62
64 cpc(3CPC), cpc_open(3CPC), cpc_seterrfn(3CPC), libcpc(3LIB), proc(4),
65 attributes(5)
66
68 The cpc_access() function exists for binary compatibility only. Source
69 containing this function will not compile. This function is obsolete
70 and might be removed in a future release. Applications should use
71 cpc_open(3CPC) instead.
72
73
74
75SunOS 5.11 28 Mar 2005 cpc_access(3CPC)