Date: Mon, 5 Oct 2015 10:48:14 +0000 (UTC) From: Alexander Motin <mav@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r288783 - stable/10/usr.bin/ctlstat Message-ID: <201510051048.t95AmEMp073514@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
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;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201510051048.t95AmEMp073514>