From owner-svn-src-all@freebsd.org Tue Jan 12 09:27:03 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5A90DA6D07B; Tue, 12 Jan 2016 09:27:03 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 31FFC1797; Tue, 12 Jan 2016 09:27:03 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0C9R266018114; Tue, 12 Jan 2016 09:27:02 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0C9R1fe018111; Tue, 12 Jan 2016 09:27:01 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201601120927.u0C9R1fe018111@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Tue, 12 Jan 2016 09:27:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293738 - in stable/10: sbin/geom/class/nop sys/geom/nop X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jan 2016 09:27:03 -0000 Author: trasz Date: Tue Jan 12 09:27:01 2016 New Revision: 293738 URL: https://svnweb.freebsd.org/changeset/base/293738 Log: MFC r289110: Make geom_nop(4) collect statistics on all types of BIOs, not just reads and writes. PR: kern/198405 Submitted by: Matthew D. Fuller Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D3679 Modified: stable/10/sbin/geom/class/nop/gnop.8 stable/10/sys/geom/nop/g_nop.c stable/10/sys/geom/nop/g_nop.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sbin/geom/class/nop/gnop.8 ============================================================================== --- stable/10/sbin/geom/class/nop/gnop.8 Tue Jan 12 09:03:39 2016 (r293737) +++ stable/10/sbin/geom/class/nop/gnop.8 Tue Jan 12 09:27:01 2016 (r293738) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 15, 2015 +.Dd October 10, 2015 .Dt GNOP 8 .Os .Sh NAME @@ -72,9 +72,10 @@ The utility is used for setting up transparent providers on existing ones. Its main purpose is testing other GEOM classes, as it allows forced provider removal and I/O error simulation with a given probability. -It also gathers the following statistics: number of read requests, number of -write requests, number of bytes read and number of bytes written. -In addition, it can be used as a good starting point for implementing new GEOM +It also gathers statistics on the number of read, write, delete, +getattr, flush, and other requests, and the number of bytes read and written. +.Nm +can also be used as a good starting point for implementing new GEOM classes. .Pp The first argument to Modified: stable/10/sys/geom/nop/g_nop.c ============================================================================== --- stable/10/sys/geom/nop/g_nop.c Tue Jan 12 09:03:39 2016 (r293737) +++ stable/10/sys/geom/nop/g_nop.c Tue Jan 12 09:27:01 2016 (r293738) @@ -119,6 +119,24 @@ g_nop_start(struct bio *bp) sc->sc_wrotebytes += bp->bio_length; failprob = sc->sc_wfailprob; break; + case BIO_DELETE: + sc->sc_deletes++; + break; + case BIO_GETATTR: + sc->sc_getattrs++; + break; + case BIO_FLUSH: + sc->sc_flushes++; + break; + case BIO_CMD0: + sc->sc_cmd0s++; + break; + case BIO_CMD1: + sc->sc_cmd1s++; + break; + case BIO_CMD2: + sc->sc_cmd2s++; + break; } mtx_unlock(&sc->sc_lock); if (failprob > 0) { @@ -238,6 +256,12 @@ g_nop_create(struct gctl_req *req, struc sc->sc_wfailprob = wfailprob; sc->sc_reads = 0; sc->sc_writes = 0; + sc->sc_deletes = 0; + sc->sc_getattrs = 0; + sc->sc_flushes = 0; + sc->sc_cmd0s = 0; + sc->sc_cmd1s = 0; + sc->sc_cmd2s = 0; sc->sc_readbytes = 0; sc->sc_wrotebytes = 0; mtx_init(&sc->sc_lock, "gnop lock", NULL, MTX_DEF); @@ -602,6 +626,12 @@ g_nop_ctl_reset(struct gctl_req *req, st sc = pp->geom->softc; sc->sc_reads = 0; sc->sc_writes = 0; + sc->sc_deletes = 0; + sc->sc_getattrs = 0; + sc->sc_flushes = 0; + sc->sc_cmd0s = 0; + sc->sc_cmd1s = 0; + sc->sc_cmd2s = 0; sc->sc_readbytes = 0; sc->sc_wrotebytes = 0; } @@ -659,6 +689,12 @@ g_nop_dumpconf(struct sbuf *sb, const ch sbuf_printf(sb, "%s%d\n", indent, sc->sc_error); sbuf_printf(sb, "%s%ju\n", indent, sc->sc_reads); sbuf_printf(sb, "%s%ju\n", indent, sc->sc_writes); + sbuf_printf(sb, "%s%ju\n", indent, sc->sc_deletes); + sbuf_printf(sb, "%s%ju\n", indent, sc->sc_getattrs); + sbuf_printf(sb, "%s%ju\n", indent, sc->sc_flushes); + 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_readbytes); sbuf_printf(sb, "%s%ju\n", indent, Modified: stable/10/sys/geom/nop/g_nop.h ============================================================================== --- stable/10/sys/geom/nop/g_nop.h Tue Jan 12 09:03:39 2016 (r293737) +++ stable/10/sys/geom/nop/g_nop.h Tue Jan 12 09:27:01 2016 (r293738) @@ -65,6 +65,12 @@ struct g_nop_softc { u_int sc_wfailprob; uintmax_t sc_reads; uintmax_t sc_writes; + uintmax_t sc_deletes; + uintmax_t sc_getattrs; + uintmax_t sc_flushes; + uintmax_t sc_cmd0s; + uintmax_t sc_cmd1s; + uintmax_t sc_cmd2s; uintmax_t sc_readbytes; uintmax_t sc_wrotebytes; struct mtx sc_lock;