2003-02-08 13:03:57 +00:00
|
|
|
/*-
|
|
|
|
* Copyright (c) 2002 Poul-Henning Kamp
|
|
|
|
*
|
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted provided that the following conditions
|
|
|
|
* are met:
|
|
|
|
* 1. Redistributions of source code must retain the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer.
|
|
|
|
* 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer in the
|
|
|
|
* documentation and/or other materials provided with the distribution.
|
|
|
|
* 3. The names of the authors may not be used to endorse or promote
|
|
|
|
* products derived from this software without specific prior written
|
|
|
|
* permission.
|
|
|
|
*
|
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
|
|
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
|
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
|
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
|
|
|
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
|
|
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
|
|
|
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
|
|
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
|
|
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|
|
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
|
|
* SUCH DAMAGE.
|
|
|
|
*
|
|
|
|
* $FreeBSD$
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _GEOM_GEOM_STATS_H_
|
|
|
|
#define _GEOM_GEOM_STATS_H_
|
|
|
|
|
2003-02-08 14:50:27 +00:00
|
|
|
#define GEOM_STATS_DEVICE "geom.stats"
|
|
|
|
|
2003-02-08 13:03:57 +00:00
|
|
|
/*
|
2003-02-09 17:04:57 +00:00
|
|
|
* A g_stat contains the statistics the kernel collect on consumers and
|
|
|
|
* providers. See libgeom(3) for how to get hold of these.
|
2003-02-08 13:03:57 +00:00
|
|
|
*/
|
|
|
|
struct g_stat {
|
2003-02-11 11:01:26 +00:00
|
|
|
int seq0;
|
2003-02-09 17:04:57 +00:00
|
|
|
/*
|
2003-02-11 11:01:26 +00:00
|
|
|
* Sequence number, used with seq1 to determine
|
|
|
|
* if snapshot is consistent.
|
2003-02-09 17:04:57 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
void *id;
|
|
|
|
/* GEOM-identifier for the consumer/provider */
|
|
|
|
|
|
|
|
uint64_t nop;
|
|
|
|
/* Number of requests started */
|
|
|
|
|
|
|
|
uint64_t nend;
|
|
|
|
/* Number of requests completed */
|
|
|
|
|
|
|
|
struct bintime bt;
|
|
|
|
/* Accumulated busy time */
|
|
|
|
|
|
|
|
struct bintime wentbusy;
|
|
|
|
/* Busy time accounted for until here */
|
2003-02-08 13:03:57 +00:00
|
|
|
struct {
|
|
|
|
uint64_t nop;
|
2003-02-09 17:04:57 +00:00
|
|
|
/* Number of requests completed */
|
|
|
|
|
2003-02-08 13:03:57 +00:00
|
|
|
uint64_t nbyte;
|
2003-02-09 17:04:57 +00:00
|
|
|
/* Number of bytes completed */
|
|
|
|
|
2003-02-08 13:03:57 +00:00
|
|
|
uint64_t nmem;
|
2003-02-09 17:04:57 +00:00
|
|
|
/* Number of ENOMEM request errors */
|
|
|
|
|
2003-02-08 13:03:57 +00:00
|
|
|
uint64_t nerr;
|
2003-02-09 17:04:57 +00:00
|
|
|
/* Number of other request errors */
|
|
|
|
|
2003-02-08 13:03:57 +00:00
|
|
|
struct bintime dt;
|
2003-02-09 17:04:57 +00:00
|
|
|
/* Accumulated request processing time */
|
|
|
|
|
2003-02-08 13:03:57 +00:00
|
|
|
} ops[3];
|
2003-02-09 17:04:57 +00:00
|
|
|
|
2003-02-08 13:03:57 +00:00
|
|
|
#define G_STAT_IDX_READ 0
|
|
|
|
#define G_STAT_IDX_WRITE 1
|
|
|
|
#define G_STAT_IDX_DELETE 2
|
2003-02-09 17:04:57 +00:00
|
|
|
|
2003-02-11 11:01:26 +00:00
|
|
|
int seq1;
|
|
|
|
/* See seq0 */
|
2003-02-08 13:03:57 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* _GEOM_GEOM_STATS_H_ */
|