dt_aggregate.c revision 6e0bee749e9081c846d305caa233c222da771831
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * CDDL HEADER START
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * The contents of this file are subject to the terms of the
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * Common Development and Distribution License (the "License").
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * You may not use this file except in compliance with the License.
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * See the License for the specific language governing permissions
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * and limitations under the License.
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * When distributing Covered Code, include this CDDL HEADER in each
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * If applicable, add the following below this CDDL HEADER, with the
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * fields enclosed by brackets "[]" replaced with your own identifying
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * information: Portions Copyright [yyyy] [name of copyright owner]
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * CDDL HEADER END
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * Use is subject to license terms.
9512fe850e98fdd448c638ca63fdd92a8a510255ahl#pragma ident "%Z%%M% %I% %E% SMI"
static int dt_revsort;
static int dt_keysort;
static int dt_keypos;
return (DT_LESSTHAN);
return (DT_GREATERTHAN);
return (DT_LESSTHAN);
return (DT_GREATERTHAN);
return (DT_LESSTHAN);
return (DT_GREATERTHAN);
static int64_t
return (lquanta[0]);
if (base != 0)
return (DT_LESSTHAN);
return (DT_GREATERTHAN);
return (DT_LESSTHAN);
return (DT_GREATERTHAN);
for (i = 0; i < nbuckets; i++) {
if (bucketval == 0) {
return (DT_LESSTHAN);
return (DT_GREATERTHAN);
return (DT_LESSTHAN);
return (DT_GREATERTHAN);
struct ps_prochandle *P;
struct ps_prochandle *P;
static dtrace_aggvarid_t
int i, j, rval;
dt_ahashent_t *h;
return (rval);
hashval = 0;
case DTRACEACT_USYM:
case DTRACEACT_UMOD:
case DTRACEACT_SYM:
case DTRACEACT_MOD:
goto hashnext;
goto bufnext;
free(h);
(void) dt_aggregate_aggvarid(h);
free(h);
for (j = 0; j < max_cpus; j++) {
free(h);
if (j == cpu) {
case DTRACEAGG_MIN:
case DTRACEAGG_MAX:
case DTRACEAGG_LQUANTIZE:
case DTRACEAGG_COUNT:
case DTRACEAGG_SUM:
case DTRACEAGG_AVG:
case DTRACEAGG_STDDEV:
case DTRACEAGG_QUANTIZE:
int i, rval;
return (rval);
return (DT_LESSTHAN);
return (DT_GREATERTHAN);
return (DT_LESSTHAN);
return (DT_GREATERTHAN);
return (rval);
return (DT_LESSTHAN);
return (DT_GREATERTHAN);
case sizeof (uint64_t):
case sizeof (uint32_t):
case sizeof (uint16_t):
case sizeof (uint8_t):
case DTRACEACT_UMOD:
case DTRACEACT_UADDR:
case DTRACEACT_USYM:
return (DT_LESSTHAN);
return (DT_GREATERTHAN);
return (DT_LESSTHAN);
return (DT_GREATERTHAN);
return (DT_LESSTHAN);
return (DT_GREATERTHAN);
int rval, i;
return (rval);
return (DT_GREATERTHAN);
return (DT_LESSTHAN);
return (DT_LESSTHAN);
return (DT_GREATERTHAN);
return (DT_LESSTHAN);
return (DT_GREATERTHAN);
case DTRACEAGG_AVG:
case DTRACEAGG_STDDEV:
case DTRACEAGG_QUANTIZE:
case DTRACEAGG_LQUANTIZE:
case DTRACEAGG_COUNT:
case DTRACEAGG_SUM:
case DTRACEAGG_MIN:
case DTRACEAGG_MAX:
assert(0);
return (rval);
int rval;
return (rval);
int rval;
return (rval);
int rval;
return (rval);
int rval;
return (rval);
int rval;
return (rval);
int i, rval;
if (dt_keysort) {
assert(i != 0);
return (rval);
if (dt_keysort)
assert(i != 0);
return (rval);
int rval, i;
switch (rval) {
case DTRACE_AGGWALK_NEXT:
case DTRACE_AGGWALK_CLEAR: {
case DTRACE_AGGWALK_ERROR:
case DTRACE_AGGWALK_ABORT:
case DTRACE_AGGWALK_NORMALIZE:
case DTRACE_AGGWALK_REMOVE: {
for (i = 0; i < max_cpus; i++)
free(h);
int (*compar)(const void *, const void *))
dt_keypos = 0;
if (!dt_keysort) {
int (*sfunc)(const void *, const void *))
nentries++;
sorted[i++] = h;
for (i = 0; i < nentries; i++) {
h = sorted[i];
sortpos = 0;
for (i = 0; i < naggvars; i++) {
goto out;
for (i = 0; i < naggvars; i++) {
goto out;
int ndx;
nentries++;
if (nentries == 0) {
rval = 0;
goto out;
for (i = 0; i < naggvars; i++) {
for (j = 0; j < naggvars; j++) {
for (i = 0; i < naggvars; i++) {
for (j = i; j < naggvars; j++)
goto out;
goto out;
sorted[i++] = h;
if (i < nentries &&
goto out;
for (j = start; j < i; j++) {
for (j = 0; j < naggvars; j++) {
start = i;
for (i = 0; i < nbundles; i++) {
for (j = 0; j < naggvars; j++)
for (j = 0; j < naggvars; j++) {
if (ndx < 0)
for (j = 0; j < naggvars; j++)
goto out;
rval = 0;
out:
for (i = 0; i < nbundles; i++)
for (i = 0; i < naggvars; i++)
return (rval);
dt_ahashent_t *h;
for (i = 0; i < max_cpus; i++)
for (i = 0; i < max_cpus; i++)
free(h);