2 .\" Copyright (c) 2007, Sun Microsystems, Inc. All Rights Reserved.
3 .\" 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.
4 .\" 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.
5 .\" 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]
6 .TH CPC_PCTX_BIND_EVENT 3CPC "Mar 05, 2007"
8 cpc_pctx_bind_event, cpc_pctx_take_sample, cpc_pctx_rele, cpc_pctx_invalidate
9 \- access CPU performance counters in other processes
13 cc [ \fIflag\fR... ] \fIfile\fR... \(milcpc \(milpctx [ \fIlibrary\fR... ]
17 \fBint\fR \fBcpc_pctx_bind_event\fR(\fBpctx_t *\fR\fIpctx\fR, \fBid_t\fR \fIlwpid\fR, \fBcpc_event_t *\fR\fIevent\fR,
18 \fBint\fR \fIflags\fR);
23 \fBint\fR \fBcpc_pctx_take_sample\fR(\fBpctx_t *\fR\fIpctx\fR, \fBid_t\fR \fIlwpid\fR, \fBcpc_event_t *\fR\fIevent\fR);
28 \fBint\fR \fBcpc_pctx_rele\fR(\fBpctx_t *\fR\fIpctx\fR, \fBid_t\fR \fIlwpid\fR);
33 \fBint\fR \fBcpc_pctx_invalidate\fR(\fBpctx_t *\fR\fIpctx\fR, \fBid_t\fR \fIlwpid\fR);
39 These functions are designed to be run in the context of an event handler
40 created using the \fBlibpctx\fR(3LIB) family of functions that allow the
41 caller, also known as the \fIcontrolling process\fR, to manipulate the
42 performance counters in the context of a \fIcontrolled process\fR. The
43 controlled process is described by the \fIpctx\fR argument, which must be
44 obtained from an invocation of \fBpctx_capture\fR(3CPC) or
45 \fBpctx_create\fR(3CPC) and passed to the functions described on this page in
46 the context of an event handler.
49 The semantics of the functions \fBcpc_pctx_bind_event()\fR,
50 \fBcpc_pctx_take_sample()\fR, and \fBcpc_pctx_rele()\fR are directly analogous
51 to those of \fBcpc_bind_event()\fR, \fBcpc_take_sample()\fR, and
52 \fBcpc_rele()\fR described on the \fBcpc_bind_event\fR(3CPC) manual page.
55 The \fBcpc_pctx_invalidate()\fR function allows the performance context to be
56 invalidated in an \fBLWP\fR in the controlled process.
60 These functions return \fB0\fR on success. On failure, they return \fB\(mi1\fR
61 and set \fBerrno\fR to indicate the error.
65 The \fBcpc_pctx_bind_event()\fR, \fBcpc_pctx_take_sample()\fR, and
66 \fBcpc_pctx_rele()\fR functions return the same \fBerrno\fR values the
67 analogous functions described on the \fBcpc_bind_event\fR(3CPC) manual page. In
68 addition, these function may fail if:
75 For \fBcpc_pctx_bind_event()\fR, access to the requested hypervisor event was
85 The value of the \fIlwpid\fR argument is invalid in the context of the
92 See \fBattributes\fR(5) for descriptions of the following attributes:
100 ATTRIBUTE TYPE ATTRIBUTE VALUE
104 Interface Stability Evolving
110 \fBcpc\fR(3CPC), \fBcpc_bind_event\fR(3CPC), \fBlibcpc\fR(3LIB),
111 \fBpctx_capture\fR(3CPC), \fBpctx_create\fR(3CPC), \fBattributes\fR(5)
115 The \fBcpc_pctx_bind_event()\fR, \fBcpc_pctx_invalidate()\fR,
116 \fBcpc_pctx_rele()\fR, and \fBcpc_pctx_take_sample()\fR functions exist for
117 binary compatibility only. Source containing these functions will not compile.
118 These functions are obsolete and might be removed in a future release.
119 Applications should use \fBcpc_bind_pctx\fR(3CPC), \fBcpc_unbind\fR(3CPC), and
120 \fBcpc_set_sample\fR(3CPC) instead.
123 The capability to create and analyze overflow events in other processes is not
124 available, though it may be made available in a future version of this API. In
125 the current implementation, the \fIflags\fR field must be specified as 0.