1cpc_open(3CPC) CPU Performance Counters Library Functions cpc_open(3CPC)
2
3
4
6 cpc_open, cpc_close - initialize the CPU Performance Counter library
7
9 cc [ flag... ] file... -lcpc [ library... ]
10 #include <libcpc.h>
11
12 cpc_t *cpc_open(int vers);
13
14
15 int cpc_close(cpc_t *cpc);
16
17
19 The cpc_open() function initializes libcpc(3LIB) and returns an identi‐
20 fier that must be used as the cpc argument in subsequent libcpc func‐
21 tion calls. The cpc_open() function takes an interface version as an
22 argument and returns NULL if that version of the interface is incompat‐
23 ible with the libcpc implementation present on the system. Usually, the
24 argument has the value of CPC_VER_CURRENT bound to the application when
25 it was compiled.
26
27
28 The cpc_close() function releases all resources associated with the cpc
29 argument. Any bound counters utilized by the process are unbound. All
30 entities of type cpc_set_t and cpc_buf_t are invalidated and destroyed.
31
33 If the version requested is supported by the implementation, cpc_open()
34 returns a cpc_t handle for use in all subsequent libcpc operations. If
35 the implementation cannot support the version needed by the applica‐
36 tion, cpc_open() returns NULL, indicating that the application at least
37 needs to be recompiled to operate correctly on the new platform and
38 might require further changes.
39
40
41 The cpc_close() function always returns 0.
42
44 These functions will fail if:
45
46 EINVAL The version requested by the client is incompatible with the
47 implementation.
48
49
51 See attributes(5) for descriptions of the following attributes:
52
53
54
55
56 ┌─────────────────────────────┬─────────────────────────────┐
57 │ ATTRIBUTE TYPE │ ATTRIBUTE VALUE │
58 ├─────────────────────────────┼─────────────────────────────┤
59 │Interface Stability │Evolving │
60 ├─────────────────────────────┼─────────────────────────────┤
61 │MT-Level │Safe │
62 └─────────────────────────────┴─────────────────────────────┘
63
65 libcpc(3LIB), attributes(5)
66
67
68
69SunOS 5.11 30 Jan 2004 cpc_open(3CPC)