Sun Microsystems, Inc.
spacerspacer
spacer   www.sun.com docs.sun.com | | |  
spacer
black dot
   
A   B   C   D   E   F   G   H   I   J   K   L   M   N   O   P   Q   R   S   T   U   V   W   X   Y   Z
    
 
CPU Performance Counters Library Functionscpc_pctx_bind_event(3CPC)


NAME

 cpc_pctx_bind_event, cpc_pctx_take_sample, cpc_pctx_rele, cpc_pctx_invalidate - access CPU performance counters in other processes

SYNOPSIS

 
cc [ flag... ] file... -lcpc -lpctx [ library... ]
#include <libpctx.h>
#include <libcpc.h>
int cpc_pctx_bind_event(pctx_t *pctx, id_t lwpid, cpc_event_t *event, int flags);
 int cpc_pctx_take_sample(pctx_t *pctx, id_t lwpid, cpc_event_t *event);
 int cpc_pctx_rele(pctx_t *pctx, id_t lwpid);
 int cpc_pctx_invalidate(pctx_t *pctx, id_t lwpid);

DESCRIPTION

 

These functions are designed to be run in the context of an event handler created using the libpctx(3LIB) family of functions that allow the caller, also known as the controlling process, to manipulate the performance counters in the context of a controlled process. The controlled process is described by the pctx argument, which must be obtained from an invocation of pctx_capture(3CPC) or pctx_create(3CPC) and passed to the functions described on this page in the context of an event handler.

The semantics of the functions cpc_pctx_bind_event(), cpc_pctx_take_sample(), and cpc_pctx_rele() are directly analogous to those of cpc_bind_event(), cpc_take_sample(), and cpc_rele() described on the cpc_bind_event(3CPC) manual page.

The cpc_pctx_invalidate() function allows the performance context to be invalidated in an LWP in the controlled process.

RETURN VALUES

 

These functions return 0 on success. On failure, they return -1 and set errno to indicate the error.

ERRORS

 

The cpc_pctx_bind_event(), cpc_pctx_take_sample(), and cpc_pctx_rele() functions return the same errno values the analogous functions described on the cpc_bind_event(3CPC) manual page. In addition, these function may fail if:

ESRCH
The value of the lwpid argument is invalid in the context of the controlled process.

ATTRIBUTES

 

See attributes(5) for descriptions of the following attributes:

ATTRIBUTE TYPEATTRIBUTE VALUE
MT-LevelUnsafe
AvailabilitySUNWcpcu (32-bit)
 SUNWcpcux (64-bit)
Interface StabilityEvolving

SEE ALSO

 

cpc(3CPC), cpc_bind_event(3CPC), pctx_capture(3CPC), pctx_create(3CPC), attributes(5).

NOTES

 

The capability to create and analyze overflow events in other processes is not available, though it may be made available in a future version of this API. In the current implementation, the flags field must be specified as 0.


SunOS 5.9Go To TopLast Changed 14 Sep 1999

 
      
      
Copyright 2002 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.