From f06f3f06adcecee38b58bf1c987618622fbca908 Mon Sep 17 00:00:00 2001 From: Fabian Keil Date: Thu, 10 Aug 2017 14:20:25 +0200 Subject: [PATCH 177/325] geom_nop(4): Include BIO_ZONE commands in the statistics Obtained from: ElectroBSD --- sys/geom/nop/g_nop.c | 6 ++++++ sys/geom/nop/g_nop.h | 1 + 2 files changed, 7 insertions(+) diff --git a/sys/geom/nop/g_nop.c b/sys/geom/nop/g_nop.c index 238a3f6b753c..cd0e3983e628 100644 --- a/sys/geom/nop/g_nop.c +++ b/sys/geom/nop/g_nop.c @@ -153,6 +153,9 @@ g_nop_start(struct bio *bp) case BIO_CMD2: sc->sc_cmd2s++; break; + case BIO_ZONE: + sc->sc_zone_cmds++; + break; } mtx_unlock(&sc->sc_lock); if (failprob > 0) { @@ -282,6 +285,7 @@ g_nop_create(struct gctl_req *req, struct g_class *mp, struct g_provider *pp, sc->sc_cmd0s = 0; sc->sc_cmd1s = 0; sc->sc_cmd2s = 0; + sc->sc_zone_cmds = 0; sc->sc_readbytes = 0; sc->sc_wrotebytes = 0; mtx_init(&sc->sc_lock, "gnop lock", NULL, MTX_DEF); @@ -659,6 +663,7 @@ g_nop_ctl_reset(struct gctl_req *req, struct g_class *mp) sc->sc_cmd0s = 0; sc->sc_cmd1s = 0; sc->sc_cmd2s = 0; + sc->sc_zone_cmds = 0; sc->sc_readbytes = 0; sc->sc_wrotebytes = 0; } @@ -722,6 +727,7 @@ g_nop_dumpconf(struct sbuf *sb, const char *indent, struct g_geom *gp, sbuf_printf(sb, "%s%ju\n", indent, sc->sc_cmd0s); sbuf_printf(sb, "%s%ju\n", indent, sc->sc_cmd1s); sbuf_printf(sb, "%s%ju\n", indent, sc->sc_cmd2s); + sbuf_printf(sb, "%s%ju\n", indent, sc->sc_zone_cmds); sbuf_printf(sb, "%s%ju\n", indent, sc->sc_readbytes); sbuf_printf(sb, "%s%ju\n", indent, diff --git a/sys/geom/nop/g_nop.h b/sys/geom/nop/g_nop.h index 353e5c5b8c09..66d7d2010277 100644 --- a/sys/geom/nop/g_nop.h +++ b/sys/geom/nop/g_nop.h @@ -78,6 +78,7 @@ struct g_nop_softc { uintmax_t sc_cmd0s; uintmax_t sc_cmd1s; uintmax_t sc_cmd2s; + uintmax_t sc_zone_cmds; uintmax_t sc_readbytes; uintmax_t sc_wrotebytes; char* sc_physpath; -- 2.32.0