/*
* 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 <fmd_ustat.h>
#include <fmd_alloc.h>
#include <fmd_subr.h>
#include <fmd_string.h>
#include <fmd_error.h>
#include <fmd.h>
static fmd_ustat_chunk_t *
{
return (cp);
}
static void
{
}
static void
{
/*
* Note that any strings pointed to by FMD_TYPE_STRING stats
* are freed one-by-one before releasing the chunk. So here
* we can just free the chunk and not worry about its content.
*/
}
}
fmd_ustat_create(void)
{
return (usp);
}
void
{
uint_t i;
for (i = 0; i < usp->us_hashlen; i++) {
}
}
}
int
{
uint_t i;
return (fmd_set_errno(EFMD_STAT_NOMEM));
}
for (i = 0; i < usp->us_hashlen; i++) {
sp++;
}
}
return (0);
}
static void
{
for (; n-- != 0; sp++) {
else
break;
}
continue; /* silently ignore unregistered entries */
}
}
{
uint_t i;
int has_str = 0;
int err = 0;
if (flags & FMD_USTAT_ALLOC) {
} else
if (flags & FMD_USTAT_ALLOC)
else
for (i = 0; i < n; i++, sp++) {
uint_t h;
/*
* Since a module may be passing in this statistic and our
* names are represented by a fixed-size array, scan fmds_name
* to ensure it has a \0 somewhere before we attempt strcmps.
*/
if (*p == '\0')
break;
}
if (p == q)
q[-1] = '\0'; /* nul-terminate for subsequent message */
break;
}
break;
}
has_str++; /* flag for second pass; see below */
break;
}
break;
}
}
/*
* If an error occurred, delete all the stats inserted by successful
* iterations of the loop [0 .. i-1]. If 'epp' is non-NULL, store a
* copy of the input stat pointer that caused the error there. When
* the delete is done, if we allocated a chunk, there should be only
* one reference remaining (from the initial fmd_ustat_chunk_init()).
*/
if (err != 0) {
} else if (has_str) {
/*
* If no error occurred and one or more string stats are being
* inserted, make a second pass through 'stats' duplicating any
*/
}
}
}
}
void
{
}
/*
* Delete all statistics that are references to external memory (that is, all
* statistics inserted with FMD_STAT_NOALLOC), i.e. a NULL ep->use_chunk.
*/
void
{
uint_t i;
for (i = 0; i < usp->us_hashlen; i++) {
continue;
}
}
}
}