diff options
author | Paul Dagnelie <pcd@delphix.com> | 2017-04-07 13:44:08 -0700 |
---|---|---|
committer | Matthew Ahrens <mahrens@delphix.com> | 2017-04-07 14:38:45 -0700 |
commit | 2a81eaec72260a1cb69e31ca02b09bfab50555ff (patch) | |
tree | f92148a4925ad4744e41b2af9d3f65ff3be10687 /usr/src | |
parent | 313ae1e182df6e6a04b56c4b73ded33e11b75666 (diff) | |
download | illumos-gate-2a81eaec72260a1cb69e31ca02b09bfab50555ff.tar.gz |
8020 Fix iostat on the EC2 instances
Reviewed by: Matt Ahrens <mahrens@delphix.com>
Reviewed by: Dan Kimmel <dan.kimmel@delphix.com>
Reviewed by: Robert Mustacchi <rm@joyent.com>
Approved by: Dan McDonald <danmcd@omniti.com>
Diffstat (limited to 'usr/src')
-rw-r--r-- | usr/src/uts/common/xen/io/xdf.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/usr/src/uts/common/xen/io/xdf.c b/usr/src/uts/common/xen/io/xdf.c index 4a71be3341..40404317ae 100644 --- a/usr/src/uts/common/xen/io/xdf.c +++ b/usr/src/uts/common/xen/io/xdf.c @@ -638,11 +638,20 @@ xdf_kstat_exit(xdf_t *vdp, buf_t *bp) if (vdp->xdf_xdev_iostat == NULL) return; + if ((vreq != NULL) && vreq->v_runq) { kstat_runq_exit(KSTAT_IO_PTR(vdp->xdf_xdev_iostat)); } else { kstat_waitq_exit(KSTAT_IO_PTR(vdp->xdf_xdev_iostat)); } + + if (bp->b_flags & B_READ) { + KSTAT_IO_PTR(vdp->xdf_xdev_iostat)->reads++; + KSTAT_IO_PTR(vdp->xdf_xdev_iostat)->nread += bp->b_bcount; + } else if (bp->b_flags & B_WRITE) { + KSTAT_IO_PTR(vdp->xdf_xdev_iostat)->writes++; + KSTAT_IO_PTR(vdp->xdf_xdev_iostat)->nwritten += bp->b_bcount; + } } static void @@ -3364,7 +3373,7 @@ xdf_attach(dev_info_t *dip, ddi_attach_cmd_t cmd) HVMPV_XDF_VERS)) cmn_err(CE_WARN, "xdf: couldn't write version\n"); -#else /* !XPV_HVM_DRIVER */ +#endif /* XPV_HVM_DRIVER */ /* create kstat for iostat(1M) */ if (xdf_kstat_create(dip, "xdf", instance) != 0) { @@ -3373,7 +3382,6 @@ xdf_attach(dev_info_t *dip, ddi_attach_cmd_t cmd) goto errout1; } -#endif /* !XPV_HVM_DRIVER */ ddi_report_dev(dip); DPRINTF(DDI_DBG, ("xdf@%s: attached\n", vdp->xdf_addr)); |