From 7ab1ccc6d88aa350dda4c6c4a0c8142e0c26b092 Mon Sep 17 00:00:00 2001 From: Fabian Keil Date: Thu, 10 Aug 2017 14:20:25 +0200 Subject: [PATCH 162/310] 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 57208a0744db..448c327d366f 100644 --- a/sys/geom/nop/g_nop.c +++ b/sys/geom/nop/g_nop.c @@ -266,6 +266,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); @@ -445,6 +448,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; TAILQ_INIT(&sc->sc_head_delay); @@ -896,6 +900,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; } @@ -967,6 +972,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 b8f086c56781..b0c149c348e5 100644 --- a/sys/geom/nop/g_nop.h +++ b/sys/geom/nop/g_nop.h @@ -72,6 +72,7 @@ struct g_nop_softc { uintmax_t sc_cmd1s; uintmax_t sc_cmd2s; uintmax_t sc_speedups; + uintmax_t sc_zone_cmds; uintmax_t sc_readbytes; uintmax_t sc_wrotebytes; char *sc_physpath; -- 2.37.1