xref: /titanic_50/usr/src/man/man3cpc/cpc_event_diff.3cpc (revision fba40a479337f3eb612fb77d692257a45d282023)
te
Copyright (c) 2005, Sun Microsystems, Inc. All Rights Reserved.
The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
CPC_EVENT_DIFF 3CPC "Mar 28, 2005"
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 structures. 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 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.