From 7725f875ee6dfe22fb59724e6d2ecdc34e3335d2 Mon Sep 17 00:00:00 2001 From: Poul-Henning Kamp Date: Fri, 7 Feb 2003 21:43:34 +0000 Subject: [PATCH] Add the new statistics structure, put one in consumers and providers. include as necessary. --- sys/geom/bde/g_bde_lock.c | 1 + sys/geom/geom.h | 26 ++++++++++++++++++++++++++ sys/geom/geom_enc.c | 1 + 3 files changed, 28 insertions(+) diff --git a/sys/geom/bde/g_bde_lock.c b/sys/geom/bde/g_bde_lock.c index 75aa40b51b9..e625f51fe38 100644 --- a/sys/geom/bde/g_bde_lock.c +++ b/sys/geom/bde/g_bde_lock.c @@ -41,6 +41,7 @@ #include #include #include +#include #include #ifdef _KERNEL diff --git a/sys/geom/geom.h b/sys/geom/geom.h index 8fc905a9a7a..dfb582b159d 100644 --- a/sys/geom/geom.h +++ b/sys/geom/geom.h @@ -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; }; /* diff --git a/sys/geom/geom_enc.c b/sys/geom/geom_enc.c index ce18892c177..0e695449e70 100644 --- a/sys/geom/geom_enc.c +++ b/sys/geom/geom_enc.c @@ -59,6 +59,7 @@ #include #include #endif +#include #include uint16_t