/*
* CDDL HEADER START
*
* 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
* 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 2010 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <errno.h>
#include <kstat.h>
#include "sdbc_stats.h"
#include "ii_stats.h"
#include "dsstat.h"
#include "common.h"
#include "report.h"
void ii_add_stat(iistat_t *);
int ii_vol_selected(kstat_t *);
/*
* ii_discover() - looks for new statistics to be monitored.
* Verifies that any statistics found are now already being
* monitored.
*
*/
int
{
static int validated = 0;
/* Loop on all kstats */
char *kname;
/* Search for II set */
continue;
continue;
/*
* Validate kstat structure
*/
if (! validated) {
if (ii_validate(ksp))
return (EINVAL);
validated++;
}
/*
* Duplicate check
*/
goto next;
}
/*
* Initialize new record
*/
/*
* Set kstat
*/
goto next;
/*
* Master kstat
*/
goto next;
/*
* Shadow kstat
*/
goto next;
/*
* Bitmap kstat
*/
goto next;
/*
* Overflow kstat
*/
goto next;
next:
/*
* Check if we got a complete set of stats
*/
continue;
(void) ii_del_stat(iistat);
continue;
}
/*
* Add to linked list
*/
}
return (EAGAIN);
return (0);
}
/*
* ii_update() - updates all of the statistics currently being monitored.
*
*/
int
{
char *kname;
/*
* Age off old stats
*/
}
}
/*
* Set kstat
*/
continue;
/*
* Validate set
*/
continue;
/*
* Master kstat
*/
continue;
/*
* Shadow kstat
*/
continue;
/*
* Bitmap kstat
*/
continue;
/*
* Overflow kstat
*/
}
}
continue;
}
continue;
} else {
continue;
}
}
return (0);
}
/*
* ii_report() - outputs statistics for the statistics currently being
* monitored. Deletes statistics for volumes that have been disabled.
*
*/
int
{
int padsz = 0;
return (0);
}
/* Create padding string for secondary report lines */
padsz += STAT_HDR_SIZE;
padsz += STAT_HDR_SIZE;
}
padsz += PCT_HDR_SIZE;
if (padsz) {
}
/* Check to see if this is this a complete */
char *c;
int offset;
/* notify user of set being disabled */
if (offset < 0)
offset = 0;
/* free memory and remove stat from list */
if (! pre)
else
continue;
}
/* Check to see if the user specified this volume */
goto next;
/* Check to see if zflag applies */
goto next;
/* Calculate flags */
char c[STAT_HDR_SIZE];
if (*flags & DSW_GOLDEN)
(void) strcpy(c, II_INDEPENDENT);
else
(void) strcpy(c, II_DEPENDENT);
if (*flags & DSW_COPYINGP)
(void) strcpy(c, II_COPYING);
else
}
/* Calculate sync needed precentage */
float pct;
cpybits =
shdbits =
volsize =
}
/* Master statistics */
char *c;
int offset;
if (offset < 0)
offset = 0;
header();
if (*flags & DSW_MSTOFFLINE) {
(void) printf(" <<offline>>");
linesout++;
} else {
}
(void) printf("\n");
if (first) {
first = 0;
}
}
/* Shadow statistics */
char *c;
int offset;
if (offset < 0)
offset = 0;
header();
if (*flags & DSW_SHDOFFLINE) {
(void) printf(" <<offline>>");
linesout++;
} else {
}
(void) printf("\n");
if (first) {
first = 0;
}
}
/* Bitmap statistics */
char *c;
int offset;
if (offset < 0)
offset = 0;
header();
if (*flags & DSW_BMPOFFLINE) {
(void) printf(" <<offline>>");
linesout++;
} else {
}
(void) printf("\n");
if (first) {
first = 0;
}
}
/* Overflow statistics */
char *c;
int offset;
if (offset < 0)
offset = 0;
header();
linesout++;
goto next;
}
if (*flags & DSW_OVROFFLINE) {
(void) printf(" <<offline>>");
linesout++;
} else {
}
(void) printf("\n");
if (first) {
first = 0;
}
}
next:
}
return (0);
}
/*
* ii_add_stat() - adds a fully populated iistat_t structure
* to the linked list of currently monitored kstats. The structure
* will be added in alphabetical order, using the volume name of
* the shadow volume as the key.
*
*/
void
{
return;
}
/*
* If we get to the last item in the list, then just
* add this one to the end
*/
return;
}
return;
}
} else {
return;
}
}
}
/*
* ii_del_stat() - deallocate memory for the structure being
* passed in.
*
* parameters
* iistat_t *iistat - structure to be deallocated
*
* returns
* iistat_t * - pointer to the "next" structures in the
* linked list. May be NULL if we are removing the last
* structure in the linked list.
*
*/
iistat_t *
{
return (next);
}
int
{
return (1);
return (1);
}
return (1);
}
return (1);
}
return (1);
}
}
return (0);
}
int
{
return (1);
return (0);
}
int
{
char *vn;
int off = 0;
off = 0;
}
break;
}
}
return (0);
} else {
return (1);
}
}