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
register, 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.
|