summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2004-06-09 19:44:44 +0000
committerphk <phk@FreeBSD.org>2004-06-09 19:44:44 +0000
commite6a8fb50df7df24d4a19173cd8d92ef29425f515 (patch)
treeb8675546db33812fa756e070bd7857e8a7d8911f /sys
parent1edc23feaad96fde62e176b34b55074f2c42f1c4 (diff)
downloadFreeBSD-src-e6a8fb50df7df24d4a19173cd8d92ef29425f515.zip
FreeBSD-src-e6a8fb50df7df24d4a19173cd8d92ef29425f515.tar.gz
Make the sysctl kern.geom.collectstats more granular.
Bit 0 controls statistics collection on GEOM providers. Bit 1 controls statistics collection on GEOM consumers. Default value is 1. Prodded by: scottl
Diffstat (limited to 'sys')
-rw-r--r--sys/geom/geom_io.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/sys/geom/geom_io.c b/sys/geom/geom_io.c
index 3c32972..7b5b115 100644
--- a/sys/geom/geom_io.c
+++ b/sys/geom/geom_io.c
@@ -248,12 +248,12 @@ g_io_request(struct bio *bp, struct g_consumer *cp)
bp->bio_error = 0;
bp->bio_completed = 0;
- if (g_collectstats) {
- devstat_start_transaction_bio(cp->stat, bp);
+ if (g_collectstats & 1)
devstat_start_transaction_bio(pp->stat, bp);
- }
- cp->nstart++;
pp->nstart++;
+ if (g_collectstats & 2)
+ devstat_start_transaction_bio(cp->stat, bp);
+ cp->nstart++;
/* Pass it on down. */
g_trace(G_T_BIO, "bio_request(%p) from %p(%s) to %p(%s) cmd %d",
@@ -289,11 +289,11 @@ g_io_deliver(struct bio *bp, int error)
(intmax_t)bp->bio_offset, (intmax_t)bp->bio_length);
bp->bio_bcount = bp->bio_length;
- if (g_collectstats) {
- bp->bio_resid = bp->bio_bcount - bp->bio_completed;
- devstat_end_transaction_bio(cp->stat, bp);
+ bp->bio_resid = bp->bio_bcount - bp->bio_completed;
+ if (g_collectstats & 1)
devstat_end_transaction_bio(pp->stat, bp);
- }
+ if (g_collectstats & 2)
+ devstat_end_transaction_bio(cp->stat, bp);
cp->nend++;
pp->nend++;
OpenPOWER on IntegriCloud