diff options
author | phk <phk@FreeBSD.org> | 2003-03-15 21:59:06 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 2003-03-15 21:59:06 +0000 |
commit | f432014308d6b21386e15affbbca62043615671d (patch) | |
tree | c322a33c0275fefd9ca33cd377e3d6f459cb9a8c /usr.bin/systat/iostat.c | |
parent | d16675cd85efe1cde6bf077376276f3de06f0263 (diff) | |
download | FreeBSD-src-f432014308d6b21386e15affbbca62043615671d.zip FreeBSD-src-f432014308d6b21386e15affbbca62043615671d.tar.gz |
Run a revision of the devstat interface:
Kernel:
Change statistics to use the *uptime() timescale (ie: relative to
boottime) rather than the UTC aligned timescale. This makes the
device statistics code oblivious to clock steps.
Change timestamps to bintime format, they are cheaper.
Remove the "busy_count", and replace it with two counter fields:
"start_count" and "end_count", which are updated in the down and
up paths respectively. This removes the locking constraint on
devstat.
Add a timestamp argument to devstat_start_transaction(), this will
normally be a timestamp set by the *_bio() function in bp->bio_t0.
Use this field to calculate duration of I/O operations.
Add two timestamp arguments to devstat_end_transaction(), one is
the current time, a NULL pointer means "take timestamp yourself",
the other is the timestamp of when this transaction started (see
above).
Change calculation of busy_time to operate on "the salami principle":
Only when we are idle, which we can determine by the start+end
counts being identical, do we update the "busy_from" field in the
down path. In the up path we accumulate the timeslice in busy_time
and update busy_from.
Change the byte_* and num_* fields into two arrays: bytes[] and
operations[].
Userland:
Change the misleading "busy_time" name to be called "snap_time" and
make the time long double since that is what most users need anyway,
fill it using clock_gettime(CLOCK_MONOTONIC) to put it on the same
timescale as the kernel fields.
Change devstat_compute_etime() to operate on struct bintime.
Remove the version 2 legacy interface: the change to bintime makes
compatibility far too expensive.
Fix a bug in systat's "vm" page where boot relative busy times would
be bogus.
Bump __FreeBSD_version to 500107
Review & Collaboration by: ken
Diffstat (limited to 'usr.bin/systat/iostat.c')
-rw-r--r-- | usr.bin/systat/iostat.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/usr.bin/systat/iostat.c b/usr.bin/systat/iostat.c index ba39f3e..a54bb6d 100644 --- a/usr.bin/systat/iostat.c +++ b/usr.bin/systat/iostat.c @@ -148,8 +148,6 @@ fetchiostat() last.dinfo = cur.dinfo; cur.dinfo = tmp_dinfo; - last.busy_time = cur.busy_time; - /* * Here what we want to do is refresh our device stats. * getdevs() returns 1 when the device list has changed. @@ -322,7 +320,7 @@ devstats(row, _col, dn) di = dev_select[dn].position; - busy_seconds = devstat_compute_etime(cur.busy_time, last.busy_time); + busy_seconds = cur.snap_time - last.snap_time; if (devstat_compute_statistics(&cur.dinfo->devices[di], &last.dinfo->devices[di], busy_seconds, |