Add the new statistics structure, put one in consumers and providers.

include <sys/time.h> as necessary.
This commit is contained in:
Poul-Henning Kamp 2003-02-07 21:43:34 +00:00
parent 936cc4614b
commit 7725f875ee
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=110518
3 changed files with 28 additions and 0 deletions

View File

@ -41,6 +41,7 @@
#include <sys/stdint.h>
#include <sys/lock.h>
#include <sys/mutex.h>
#include <sys/time.h>
#include <sys/md5.h>
#ifdef _KERNEL

View File

@ -135,6 +135,30 @@ struct g_bioq {
int bio_queue_length;
};
/*
* A g_stat contains the statistics we collect on consumers and
* providers.
*/
struct g_stat {
void *id;
uint64_t nop;
uint64_t nend;
struct bintime it;
struct bintime wentidle;
struct {
uint64_t nop;
uint64_t nbyte;
uint64_t nmem;
uint64_t nerr;
struct bintime dt;
} ops[5];
#define G_STAT_IDX_READ 0
#define G_STAT_IDX_WRITE 2
#define G_STAT_IDX_DELETE 3
#define G_STAT_IDX_GETATTR 4
#define G_STAT_IDX_SETATTR 5
};
/*
* A g_consumer is an attachment point for a g_provider. One g_consumer
* can only be attached to one g_provider, but multiple g_consumers
@ -152,6 +176,7 @@ struct g_consumer {
int biocount;
int spoiled;
struct g_stat stat;
};
/*
@ -170,6 +195,7 @@ struct g_provider {
u_int index;
off_t mediasize;
u_int sectorsize;
struct g_stat stat;
};
/*

View File

@ -59,6 +59,7 @@
#include <sys/malloc.h>
#include <sys/systm.h>
#endif
#include <sys/time.h>
#include <geom/geom.h>
uint16_t