Add the new statistics structure, put one in consumers and providers.
include <sys/time.h> as necessary.
This commit is contained in:
parent
0d87d64253
commit
7a3625aca3
@ -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
|
||||
|
@ -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;
|
||||
};
|
||||
|
||||
/*
|
||||
|
@ -59,6 +59,7 @@
|
||||
#include <sys/malloc.h>
|
||||
#include <sys/systm.h>
|
||||
#endif
|
||||
#include <sys/time.h>
|
||||
#include <geom/geom.h>
|
||||
|
||||
uint16_t
|
||||
|
Loading…
x
Reference in New Issue
Block a user