summaryrefslogtreecommitdiffstats
path: root/usr.bin
diff options
context:
space:
mode:
authormav <mav@FreeBSD.org>2015-10-05 10:48:14 +0000
committermav <mav@FreeBSD.org>2015-10-05 10:48:14 +0000
commit4add53bf3619c78de9cb9f0b804e5b9cf74da1aa (patch)
tree3a08393395f37b2d46e9ef24e9f19469f3856ebc /usr.bin
parent12a42fc40ce7d3d581868f50c38b0ad5abcbc75d (diff)
downloadFreeBSD-src-4add53bf3619c78de9cb9f0b804e5b9cf74da1aa.zip
FreeBSD-src-4add53bf3619c78de9cb9f0b804e5b9cf74da1aa.tar.gz
MFC r288043:
Output times as normal microseconds, rather then in bintime format.
Diffstat (limited to 'usr.bin')
-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