CPU Performance Counters Library Functions cpcevent(3CPC)
NAME
cpcevent - data structure to describe CPU performance
counters
SYNOPSIS
#include
DESCRIPTION
The libcpc interfaces manipulate CPU performance counters
using the cpceventt data structure. This structure con-
tains 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
cpcversion(3CPC) for details of library versioning.
SPARC
For UltraSPARC, the structure contains the following
members:
typedef struct {
int cecpuver;
hrtimet cehrt;
uint64t cetick;
uint64t cepic[2];
uint64t cepcr;
} cpceventt;
x86
For Pentium, the structure contains the following members:
typedef struct {
int cecpuver;
hrtimet cehrt;
uint64t cetsc;
uint64t cepic[2];
uint32t cepes[2];
#define cecesr cepes[0]
} cpceventt;
The APIs are used to manipulate the highly processor-
dependent control registers (the cepcr, cecesr, and cepes
fields); the programmer is strongly advised not to reference
those fields directly in portable code. The cepic 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
SunOS 5.11 Last change: 12 May 2003 1
CPU Performance Counters Library Functions cpcevent(3CPC)
(UltraSPARC) or 40-bits (Pentium) before overflow.
The cehrt 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 register, and placed in the cetick field.
On Pentium processors, the processor-dependent time-stamp
counter register is similarly sampled and placed in the
cetsc field.
ATRIBUTES
See attributes(5) for descriptions of the following attri-
butes:
ATRIBUTE TYPE ATRIBUTE VALUE
Interface Stability Evolving
SEE ALSO
gethrtime(3C), cpc(3CPC), cpcversion(3CPC), libcpc(3LIB),
attributes(5)
SunOS 5.11 Last change: 12 May 2003 2
|