summaryrefslogtreecommitdiffstats
path: root/usr.bin/ctlstat/ctlstat.c
diff options
context:
space:
mode:
authormav <mav@FreeBSD.org>2015-09-20 21:06:37 +0000
committermav <mav@FreeBSD.org>2015-09-20 21:06:37 +0000
commit197901fa173500588a239ccc79cd004e1e7d531a (patch)
treeeae8cd25c519ce61c6c6e1d189a98fd9441413d4 /usr.bin/ctlstat/ctlstat.c
parent70a6c8c8928ba9597150fb86457416e600ed71f8 (diff)
downloadFreeBSD-src-197901fa173500588a239ccc79cd004e1e7d531a.zip
FreeBSD-src-197901fa173500588a239ccc79cd004e1e7d531a.tar.gz
Output times as normal microseconds, rather then in bintime format.
Diffstat (limited to 'usr.bin/ctlstat/ctlstat.c')
-rw-r--r--usr.bin/ctlstat/ctlstat.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/usr.bin/ctlstat/ctlstat.c b/usr.bin/ctlstat/ctlstat.c
index f12dd43..7b828d1 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;
OpenPOWER on IntegriCloud