diff --git a/sys/geom/bde/g_bde_lock.c b/sys/geom/bde/g_bde_lock.c index 75aa40b51b99..e625f51fe382 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 8fc905a9a7a6..dfb582b159de 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 ce18892c1770..0e695449e704 100644 --- a/sys/geom/geom_enc.c +++ b/sys/geom/geom_enc.c @@ -59,6 +59,7 @@ #include #include #endif +#include #include uint16_t