Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

cpc_event(3cpc) [opensolaris man page]

cpc_event(3CPC) 				    CPU Performance Counters Library Functions					   cpc_event(3CPC)

NAME
cpc_event - data structure to describe CPU performance counters SYNOPSIS
#include <libcpc.h> DESCRIPTION
The libcpc interfaces manipulate CPU performance counters using the cpc_event_t data structure. This structure contains several fields that are common to all processors, and some that are processor-dependent. These structures can be declared by a consumer of the API, thus the size and offsets of the fields and the entire data structure are fixed per processor for any particular version of the library. See cpc_version(3CPC) for details of library versioning. SPARC For UltraSPARC, the structure contains the following members: typedef struct { int ce_cpuver; hrtime_t ce_hrt; uint64_t ce_tick; uint64_t ce_pic[2]; uint64_t ce_pcr; } cpc_event_t; x86 For Pentium, the structure contains the following members: typedef struct { int ce_cpuver; hrtime_t ce_hrt; uint64_t ce_tsc; uint64_t ce_pic[2]; uint32_t ce_pes[2]; #define ce_cesr ce_pes[0] } cpc_event_t; The APIs are used to manipulate the highly processor-dependent control registers (the ce_pcr, ce_cesr, and ce_pes fields); the programmer is strongly advised not to reference those fields directly in portable code. The ce_pic array elements contain 64-bit accumulated counter values. The hardware registers are virtualized to 64-bit quantities even though the underlying hardware only supports 32-bits (UltraSPARC) or 40-bits (Pentium) before overflow. The ce_hrt field is a high resolution timestamp taken at the time the counters were sampled by the kernel. This uses the same timebase as gethrtime(3C). On SPARC V9 machines, the number of cycles spent running on the processor is computed from samples of the processor-dependent %tick regis- ter, and placed in the ce_tick field. On Pentium processors, the processor-dependent time-stamp counter register is similarly sampled and placed in the ce_tsc field. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Interface Stability |Evolving | +-----------------------------+-----------------------------+ SEE ALSO
gethrtime(3C), cpc(3CPC), cpc_version(3CPC), libcpc(3LIB), attributes(5) SunOS 5.11 12 May 2003 cpc_event(3CPC)

Check Out this Related Man Page

cpc_event_diff(3CPC)				    CPU Performance Counters Library Functions				      cpc_event_diff(3CPC)

NAME
cpc_event_diff, cpc_event_accum - simple difference and accumulate operations SYNOPSIS
cc [ flag... ] file... -lcpc [ library... ] #include <libcpc.h> void cpc_event_accum(cpc_event_t *accum, cpc_event_t *event); void cpc_event_diff(cpc_event_t *diff, cpc_event_t *after, cpc_event_t *before); DESCRIPTION
The cpc_event_accum() and cpc_event_diff() functions perform common accumulate and difference operations on cpc_event(3CPC) data struc- tures. Use of these functions increases program portability, since structure members are not referenced directly . cpc_event_accum() The cpc_event_accum() function adds the ce_pic fields of event into the corresponding fields of accum. The ce_hrt field of accum is set to the later of the times in event and accum. SPARC: The function adds the contents of the ce_tick field of event into the corresponding field of accum. x86: The function adds the contents of the ce_tsc field of event into the corresponding field of accum. cpc_event_diff() The cpc_event_diff() function places the difference between the ce_pic fields of after and before and places them in the corresponding field of diff. The ce_hrt field of diff is set to the ce_hrt field of after. SPARC: Additionally, the function computes the difference between the ce_tick fields of after and before, and places it in the corresponding field of diff. x86: Additionally, the function computes the difference between the ce_tsc fields of after and before, and places it in the corresponding field of diff. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Interface Stability |Obsolete | +-----------------------------+-----------------------------+ |MT-Level |MT-Safe | +-----------------------------+-----------------------------+ SEE ALSO
cpc(3CPC), cpc_buf_add(3CPC), cpc_buf_sub(3CPC), cpc_event(3CPC), libcpc(3LIB), attributes(5) NOTES
The cpc_event_accum() and cpc_event_diff() functions exist for binary compatibility only. Source containing these functions will not com- pile. These functions are obsolete and might be removed in a future release. Applications should use cpc_buf_add(3CPC) and cpc_buf_sub(3CPC) instead. SunOS 5.11 28 Mar 2005 cpc_event_diff(3CPC)
Man Page