FreeBSD Bugzilla – Attachment 153982 Details for
Bug 198405
[PATCH] gnop: Count all BIO types
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
gnop-all-bios.patch (text/plain), 3.24 KB, created by
fullermd
on 2015-03-07 23:33:16 UTC
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
fullermd
Created:
2015-03-07 23:33:16 UTC
Size:
3.24 KB
patch
obsolete
>Index: sbin/geom/class/nop/gnop.8 >=================================================================== >--- sbin/geom/class/nop/gnop.8 (revision 279210) >+++ sbin/geom/class/nop/gnop.8 (working copy) >@@ -70,8 +70,8 @@ > 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. >+It also gathers the following statistics: number of read, write, delete, >+getattr, flush, and other requests, and number of bytes read and written. > In addition, it can be used as a good starting point for implementing new GEOM > classes. > .Pp >Index: sys/geom/nop/g_nop.c >=================================================================== >--- sys/geom/nop/g_nop.c (revision 279210) >+++ sys/geom/nop/g_nop.c (working copy) >@@ -119,6 +119,24 @@ > 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) { >@@ -224,6 +242,12 @@ > 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); >@@ -566,6 +590,12 @@ > 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; > } >@@ -623,6 +653,12 @@ > sbuf_printf(sb, "%s<Error>%d</Error>\n", indent, sc->sc_error); > sbuf_printf(sb, "%s<Reads>%ju</Reads>\n", indent, sc->sc_reads); > sbuf_printf(sb, "%s<Writes>%ju</Writes>\n", indent, sc->sc_writes); >+ sbuf_printf(sb, "%s<Deletes>%ju</Deletes>\n", indent, sc->sc_deletes); >+ sbuf_printf(sb, "%s<Getattrs>%ju</Getattrs>\n", indent, sc->sc_getattrs); >+ sbuf_printf(sb, "%s<Flushes>%ju</Flushes>\n", indent, sc->sc_flushes); >+ sbuf_printf(sb, "%s<Cmd0s>%ju</Cmd0s>\n", indent, sc->sc_cmd0s); >+ sbuf_printf(sb, "%s<Cmd1s>%ju</Cmd1s>\n", indent, sc->sc_cmd1s); >+ sbuf_printf(sb, "%s<Cmd2s>%ju</Cmd2s>\n", indent, sc->sc_cmd2s); > sbuf_printf(sb, "%s<ReadBytes>%ju</ReadBytes>\n", indent, > sc->sc_readbytes); > sbuf_printf(sb, "%s<WroteBytes>%ju</WroteBytes>\n", indent, >Index: sys/geom/nop/g_nop.h >=================================================================== >--- sys/geom/nop/g_nop.h (revision 279210) >+++ sys/geom/nop/g_nop.h (working copy) >@@ -63,6 +63,12 @@ > 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;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 198405
: 153982