Author: mav
Date: Mon Oct  5 10:48:14 2015
New Revision: 288783
URL: https://svnweb.freebsd.org/changeset/base/288783

Log:
  MFC r288043:
  Output times as normal microseconds, rather then in bintime format.

Modified:
  stable/10/usr.bin/ctlstat/ctlstat.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/usr.bin/ctlstat/ctlstat.c
==============================================================================
--- stable/10/usr.bin/ctlstat/ctlstat.c Mon Oct  5 10:47:18 2015        
(r288782)
+++ stable/10/usr.bin/ctlstat/ctlstat.c Mon Oct  5 10:48:14 2015        
(r288783)
@@ -326,8 +326,8 @@ compute_stats(struct ctl_lun_io_stats *c
  */
 
 #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;
_______________________________________________
svn-src-stable-10@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-stable-10
To unsubscribe, send any mail to "svn-src-stable-10-unsubscr...@freebsd.org"

Reply via email to