|CPC_EVENT_DIFF(3CPC)||CPU Performance Counters Library Functions||CPC_EVENT_DIFF(3CPC)|
cpc_event_diff, cpc_event_accum - simple difference and accumulate operations
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,
The cpc_event_accum() and cpc_event_diff() functions perform common accumulate and difference operations on cpc_event(3CPC) data structures. Use of these functions increases program portability, since structure members are not referenced directly .
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.
The function adds the contents of the ce_tick field of event into the corresponding field of accum.
The function adds the contents of the ce_tsc field of event into the corresponding field of accum.
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.
Additionally, the function computes the difference between the ce_tick fields of after and before, and places it in the corresponding field of diff.
Additionally, the function computes the difference between the ce_tsc fields of after and before, and places it in the corresponding field of diff.
See attributes(7) for descriptions of the following attributes:
|ATTRIBUTE TYPE||ATTRIBUTE VALUE|
The cpc_event_accum() and cpc_event_diff() functions exist for binary compatibility only. Source containing these functions will not compile. 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.
|March 28, 2005||OmniOS|