From owner-svn-src-all@freebsd.org Thu Nov 23 19:10:12 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AF7D0DF3C1F; Thu, 23 Nov 2017 19:10:12 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 975507709C; Thu, 23 Nov 2017 19:10:10 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vANJA943060003; Thu, 23 Nov 2017 19:10:09 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vANJA9gl060002; Thu, 23 Nov 2017 19:10:09 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201711231910.vANJA9gl060002@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 23 Nov 2017 19:10:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326139 - head/usr.bin/vmstat X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/usr.bin/vmstat X-SVN-Commit-Revision: 326139 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Nov 2017 19:10:13 -0000 Author: kib Date: Thu Nov 23 19:10:09 2017 New Revision: 326139 URL: https://svnweb.freebsd.org/changeset/base/326139 Log: vmstat: use 64-bit counters from struct vmtotal. Consistently print counters using unsigned intmax type. Submitted by: Pawel Biernacki Sponsored by: Mysterious Code Ltd. Differential revision: https://reviews.freebsd.org/D13199 Modified: head/usr.bin/vmstat/vmstat.c Modified: head/usr.bin/vmstat/vmstat.c ============================================================================== --- head/usr.bin/vmstat/vmstat.c Thu Nov 23 19:06:44 2017 (r326138) +++ head/usr.bin/vmstat/vmstat.c Thu Nov 23 19:10:09 2017 (r326139) @@ -817,7 +817,7 @@ dovmstat(unsigned int interval, int reps) total.t_rq - 1, total.t_dw + total.t_pw, total.t_sw); xo_close_container("processes"); xo_open_container("memory"); -#define vmstat_pgtok(a) ((a) * (sum.v_page_size >> 10)) +#define vmstat_pgtok(a) ((uintmax_t)(a) * (sum.v_page_size >> 10)) #define rate(x) (((x) * rate_adj + halfuptime) / uptime) /* round */ if (hflag) { xo_emit(""); @@ -829,10 +829,10 @@ dovmstat(unsigned int interval, int reps) xo_emit(" "); } else { xo_emit(" "); - xo_emit("{:available-memory/%7d}", + xo_emit("{:available-memory/%7ju}", vmstat_pgtok(total.t_avm)); xo_emit(" "); - xo_emit("{:free-memory/%7d}", + xo_emit("{:free-memory/%7ju}", vmstat_pgtok(total.t_free)); xo_emit(" "); } @@ -1555,9 +1555,9 @@ display_object(struct kinfo_vmobject *kvo) const char *str; xo_open_instance("object"); - xo_emit("{:resident/%5jd} ", (uintmax_t)kvo->kvo_resident); - xo_emit("{:active/%5jd} ", (uintmax_t)kvo->kvo_active); - xo_emit("{:inactive/%5jd} ", (uintmax_t)kvo->kvo_inactive); + xo_emit("{:resident/%5ju} ", (uintmax_t)kvo->kvo_resident); + xo_emit("{:active/%5ju} ", (uintmax_t)kvo->kvo_active); + xo_emit("{:inactive/%5ju} ", (uintmax_t)kvo->kvo_inactive); xo_emit("{:refcount/%3d} ", kvo->kvo_ref_count); xo_emit("{:shadowcount/%3d} ", kvo->kvo_shadow_count); switch (kvo->kvo_memattr) {