/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (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
* 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]
*
* CDDL HEADER END
*/
/*
* Copyright 2005 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <stddef.h>
#include <kstat.h>
#include "jkstat.h"
/*
* Class descriptors
*/
#define KSTAT_READ_EX_CLASS_DESC \
#define KSTAT_TNS_EX_CLASS_DESC \
/*
* Cached class, method, and field IDs.
*/
static jobject
{
int i;
return (NULL); /* OutOfMemoryError thrown */
return (NULL); /* OutOfMemoryError thrown */
/*
* Interpret the uint64_t as a 9-byte big-endian signed quantity
* suitable for constructing an UnsignedInt64 or BigInteger.
*/
for (i = 8; i >= 1; i--) {
value >>= 8;
}
bytes[0] = 0;
byteArray)))
return (NULL); /* exception thrown */
return (valueObj);
}
/*
* Return a Long object with the given value.
*/
static jobject
{
value)))
return (NULL); /* exception thrown */
return (valueObj);
}
/*
* Return a Double object with the given value.
*/
static jobject
{
value)))
return (NULL); /* exception thrown */
return (valueObj);
}
/*
* Returns the kctl_t * from kstat_open(3kstat).
*/
/*ARGSUSED*/
{
}
/*
* Invokes kstat_close(3kstat).
*/
/*ARGSUSED*/
{
if (kctl)
else
return (0);
}
/*
* Invoke kstat_read(3kstat) for the given Kstat object.
*/
{
return; /* exception thronw */
if (kid == -1) {
jclass e;
return; /* exception thrown */
}
}
/*
* Return a Kstat object corresponding to the result of
* kstat_lookup(3kstat).
*/
{
return (NULL);
goto done; /* exception thrown */
goto done; /* exception thrown */
if (ksp)
done:
if (name)
if (module)
return (kstatObject);
}
/*
* Returns the named value -- the value of the named kstat, or field in
* a raw kstat, as applicable, and available. Returns <i>null</i> if no
* such named kstat or field is available.
*
* Throws KstatTypeNotSupportedException if the raw kstat is not
* understood. (Presently, none are.)
*/
{
const char *name;
if (!nameObj)
return (NULL);
return (NULL); /* exception thrown */
return (NULL); /* exception thrown */
}
case KSTAT_TYPE_NAMED:
break;
case KSTAT_DATA_CHAR:
break;
case KSTAT_DATA_INT32:
break;
case KSTAT_DATA_UINT32:
break;
case KSTAT_DATA_INT64:
break;
case KSTAT_DATA_UINT64:
break;
case KSTAT_DATA_STRING:
break;
case KSTAT_DATA_FLOAT:
break;
case KSTAT_DATA_DOUBLE:
break;
default:
goto fail;
}
break;
default:
goto fail;
}
return (valueObj);
fail:
return (valueObj);
}
/*
* Given a Kstat object, return, as an HRTime object, its kstat_t's
* field at the given offset.
*/
static jobject
{
if (!ksp)
return (NULL); /* exception thrown */
sizeof (hrtime_t)))));
}
/*
* Given a Kstat object, return as an HRTime object its ks_snaptime
* field.
*/
{
}
/*
* Given a Kstat object, return as an HRTime object its ks_crtime
* field.
*/
{
}
/*
* Invoke kstat_chain_update(3kstat) for the kstat chain corresponding
* to the given KstatCtl object.
*/
{
(void) kstat_chain_update(kctl);
}
/*
* Cache class, method, and field IDs.
*/
/*ARGSUSED*/
{
return; /* exception thrown */
return; /* exception thrown */
"(D)V")))
return; /* exception thrown */
return; /* exception thrown */
return; /* exception thrown */
return; /* exception thrown */
return; /* exception thrown */
return; /* exception thrown */
"(JJ)V")))
return; /* exception thrown */
"J")))
return; /* exception thrown */
"J")))
return; /* exception thrown */
return; /* exception thrown */
return; /* exception thrown */
"kctl", "J")))
return; /* exception thrown */
return; /* exception thrown */
return; /* exception thrown */
"(J)V")))
return; /* exception thrown */
return; /* exception thrown */
return; /* exception thrown */
}