diff options
author | Alexander Motin <mav@FreeBSD.org> | 2015-09-20 21:06:37 +0000 |
---|---|---|
committer | Alexander Motin <mav@FreeBSD.org> | 2015-09-20 21:06:37 +0000 |
commit | 2eb293b99688c2fbf88f98fb04f8da374d769eac (patch) | |
tree | eae8cd25c519ce61c6c6e1d189a98fd9441413d4 /usr.bin/ctlstat | |
parent | d9556fb15d71425e258b196ad8f29b0f97f2aba3 (diff) | |
download | src-2eb293b99688c2fbf88f98fb04f8da374d769eac.tar.gz src-2eb293b99688c2fbf88f98fb04f8da374d769eac.zip |
Output times as normal microseconds, rather then in bintime format.
Notes
Notes:
svn path=/head/; revision=288043
Diffstat (limited to 'usr.bin/ctlstat')
-rw-r--r-- | usr.bin/ctlstat/ctlstat.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/usr.bin/ctlstat/ctlstat.c b/usr.bin/ctlstat/ctlstat.c index f12dd4372359..7b828d12a45f 100644 --- a/usr.bin/ctlstat/ctlstat.c +++ b/usr.bin/ctlstat/ctlstat.c @@ -326,8 +326,8 @@ compute_stats(struct ctl_lun_io_stats *cur_stats, */ #define PRINT_BINTIME(prefix, bt) \ - printf("%s %jd s %ju frac\n", prefix, (intmax_t)(bt).sec, \ - (uintmax_t)(bt).frac) + printf("%s %jd.%06ju\n", prefix, (intmax_t)(bt).sec, \ + (uintmax_t)(((bt).frac >> 32) * 1000000 >> 32)) static const char *iotypes[] = {"NO IO", "READ", "WRITE"}; static void @@ -360,9 +360,8 @@ ctlstat_dump(struct ctlstat_context *ctx) { } #define JSON_BINTIME(prefix, bt) \ - printf("\"%s\":{\"sec\":%jd,\"frac\":%ju},", \ - prefix, (intmax_t)(bt).sec, (uintmax_t)(bt).frac) - + printf("\"%s\":%jd.%06ju,", prefix, (intmax_t)(bt).sec, \ + (uintmax_t)(((bt).frac >> 32) * 1000000 >> 32)) static void ctlstat_json(struct ctlstat_context *ctx) { int iotype, lun, port; |