Date: Thu, 22 Aug 2002 11:16:13 -0500 (CDT) From: Dan Nelson <dnelson@allantgroup.com> To: FreeBSD-gnats-submit@FreeBSD.org Subject: bin/41902: [PATCH] Add queue depth to systat -v disk table Message-ID: <200208221616.g7MGGDMm072702@dan.emsphone.com>
next in thread | raw e-mail | index | archive | help
>Number: 41902
>Category: bin
>Synopsis: [PATCH] Add queue depth to systat -v disk table
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: change-request
>Submitter-Id: current-users
>Arrival-Date: Thu Aug 22 09:20:02 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator: Dan Nelson
>Release: FreeBSD 5.0-CURRENT i386
>Organization:
The Allant Group
>Environment:
System: FreeBSD dan.emsphone.com 5.0-CURRENT FreeBSD 5.0-CURRENT #181: Thu Jul 25 14:15:12 CDT 2002 zsh@dan.emsphone.com:/usr/src/sys/i386/compile/DANSMP i386
It's often useful to know the CTQ depth of your drives when they're
being used. The following patch adds that to systat -v output.
Disks da0 cd0 cd1 fd0 pass0 pass1 pass2 intrn
KB/t 5.92 0.00 0.00 0.00 0.00 0.00 0.00 114064 buf
tps 102 0 0 0 0 0 0 809 dirtybuf
MB/s 0.59 0.00 0.00 0.00 0.00 0.00 0.00 65950 desiredvnodes
% busy 40 0 0 0 0 0 0 65978 numvnodes
queued 11 0 0 0 0 0 0 37194 freevnodes
Index: vmstat.c
===================================================================
RCS file: /home/ncvs/src/usr.bin/systat/vmstat.c,v
retrieving revision 1.52
diff -u -p -r1.52 vmstat.c
--- vmstat.c 6 Jun 2002 23:01:50 -0000 1.52
+++ vmstat.c 22 Aug 2002 15:47:05 -0000
@@ -337,12 +337,7 @@ labelkre()
mvprintw(DISKROW + 2, DISKCOL, "tps");
mvprintw(DISKROW + 3, DISKCOL, "MB/s");
mvprintw(DISKROW + 4, DISKCOL, "%% busy");
- /*
- * For now, we don't support a fourth disk statistic. So there's
- * no point in providing a label for it. If someone can think of a
- * fourth useful disk statistic, there is room to add it.
- */
- /* mvprintw(DISKROW + 4, DISKCOL, " msps"); */
+ mvprintw(DISKROW + 5, DISKCOL, "queued");
j = 0;
for (i = 0; i < num_devices && j < MAXDRIVES; i++)
if (dev_select[i].selected) {
@@ -848,6 +843,7 @@ dinfo(dn, lc, now, then)
long double transfers_per_second;
long double kb_per_transfer, mb_per_second;
long double elapsed_time, device_busy;
+ long double busy_count;
int di;
di = dev_select[dn].position;
@@ -859,6 +855,8 @@ dinfo(dn, lc, now, then)
then ? then->dinfo->devices[di].busy_time :
now->dinfo->devices[di].dev_creation_time);
+ busy_count = now->dinfo->devices[di].busy_count;
+
if (devstat_compute_statistics(&now->dinfo->devices[di], then ?
&then->dinfo->devices[di] : NULL, elapsed_time,
DSM_KB_PER_TRANSFER, &kb_per_transfer, DSM_TRANSFERS_PER_SECOND,
@@ -881,4 +879,5 @@ dinfo(dn, lc, now, then)
putlongdouble(transfers_per_second, DISKROW + 2, lc, 5, 0, 0);
putlongdouble(mb_per_second, DISKROW + 3, lc, 5, 2, 0);
putlongdouble(device_busy * 100 / elapsed_time, DISKROW + 4, lc, 5, 0, 0);
+ putlongdouble(busy_count, DISKROW + 5, lc, 5, 0, 0);
}
>Description:
>How-To-Repeat:
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200208221616.g7MGGDMm072702>
