Page MenuHomeFreeBSD

Add more stats to gnop(8).
ClosedPublic

Authored by trasz on Sep 16 2015, 12:10 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mar 19 2024, 3:28 PM
Unknown Object (File)
Mar 19 2024, 3:18 PM
Unknown Object (File)
Mar 16 2024, 12:27 AM
Unknown Object (File)
Jan 21 2024, 8:25 AM
Unknown Object (File)
Dec 31 2023, 7:59 AM
Unknown Object (File)
Dec 31 2023, 7:59 AM
Unknown Object (File)
Dec 19 2023, 11:48 PM
Unknown Object (File)
Nov 11 2023, 8:59 AM
Subscribers

Details

Summary

gnop(8) already stores up and shows stats for the number of BIO_READ
and BIO_WRITE calls that pass through it. Counting the other types
as well makes it more useful for testing other stuff.

PR: kern/198405
Submitted by: Matthew D. Fuller <fullermd at over-yonder dot net>

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

trasz retitled this revision from to Add more stats to gnop(8)..
trasz updated this object.
trasz edited the test plan for this revision. (Show Details)

I have no objections, but think it could look better if made an array.

Ok, so, the problem with making it an array is that bio_cmd flags are defined like this:

#define BIO_READ 0x01 /* Read I/O data */
#define BIO_WRITE 0x02 /* Write I/O data */
#define BIO_DELETE 0x04 /* TRIM or free blocks, i.e. mark as unused */
#define BIO_GETATTR 0x08 /* Get GEOM attributes of object */
#define BIO_FLUSH 0x10 /* Commit outstanding I/O now */
#define BIO_CMD0 0x20 /* Available for local hacks */
#define BIO_CMD1 0x40 /* Available for local hacks */
#define BIO_CMD2 0x80 /* Available for local hacks */

Ie, it's not an enum, so we can't just do "sc->sc_cmds[bp->bio_cmd]++". And without it, making it an array doesn't really improve much.

wblock added inline comments.
sbin/geom/class/nop/gnop.8
75 ↗(On Diff #8784)
It also gathers statistics on the number of read, write, delete,
76 ↗(On Diff #8784)
getattr, flush, and other requests, and the number of bytes read and written.
77 ↗(On Diff #8784)
.Nm
can also be used as a good starting point for implementing new GEOM
This revision was automatically updated to reflect the committed changes.