summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIgor Sobrado <sobrado@cvs.openbsd.org>2007-10-26 14:15:26 +0000
committerIgor Sobrado <sobrado@cvs.openbsd.org>2007-10-26 14:15:26 +0000
commitea4e74d813ecc71042431759fc2c4ff720c77086 (patch)
tree4a52023aee2cb79e948fb4f0f828430b615ee248
parentcc7254de33541eaa51e449f6474e6ca8402dcd75 (diff)
patch to improve vmstat(8) output:
- the "fre" column width is increased - adds a whitespace between the "avm" and "fre" columns - aligns the "memory" and "traps" labels with their column sets ok millert@
-rw-r--r--usr.bin/vmstat/vmstat.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/usr.bin/vmstat/vmstat.c b/usr.bin/vmstat/vmstat.c
index 7ddf7bd5ac0..7cd6a5fe74f 100644
--- a/usr.bin/vmstat/vmstat.c
+++ b/usr.bin/vmstat/vmstat.c
@@ -1,5 +1,5 @@
/* $NetBSD: vmstat.c,v 1.29.4.1 1996/06/05 00:21:05 cgd Exp $ */
-/* $OpenBSD: vmstat.c,v 1.105 2007/09/13 22:30:51 cloder Exp $ */
+/* $OpenBSD: vmstat.c,v 1.106 2007/10/26 14:15:25 sobrado Exp $ */
/*
* Copyright (c) 1980, 1986, 1991, 1993
@@ -40,7 +40,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)vmstat.c 8.1 (Berkeley) 6/6/93";
#else
-static const char rcsid[] = "$OpenBSD: vmstat.c,v 1.105 2007/09/13 22:30:51 cloder Exp $";
+static const char rcsid[] = "$OpenBSD: vmstat.c,v 1.106 2007/10/26 14:15:25 sobrado Exp $";
#endif
#endif /* not lint */
@@ -416,9 +416,9 @@ dovmstat(u_int interval, int reps)
total.t_rq - 1, total.t_dw + total.t_pw, total.t_sw);
#define rate(x) (((x) + halfuptime) / uptime) /* round */
#define pgtok(a) ((a) * ((unsigned int)uvmexp.pagesize >> 10))
- (void)printf("%7u%7u ",
+ (void)printf("%7u %7u ",
pgtok(total.t_avm), pgtok(total.t_free));
- (void)printf("%5u ", rate(uvmexp.faults - ouvmexp.faults));
+ (void)printf("%4u ", rate(uvmexp.faults - ouvmexp.faults));
(void)printf("%3u ", rate(uvmexp.pdreact - ouvmexp.pdreact));
(void)printf("%3u ", rate(uvmexp.pageins - ouvmexp.pageins));
(void)printf("%3u %3u ",
@@ -450,16 +450,16 @@ printhdr(void)
{
int i;
- (void)printf(" procs memory page%*s", 20, "");
+ (void)printf(" procs memory page%*s", 20, "");
if (ndrives > 0)
- (void)printf("%s %*straps cpu\n",
+ (void)printf("%s %*straps cpu\n",
((ndrives > 1) ? "disks" : "disk"),
- ((ndrives > 1) ? ndrives * 4 - 4 : 0), "");
+ ((ndrives > 1) ? ndrives * 4 - 5 : 0), "");
else
- (void)printf("%*s traps cpu\n",
+ (void)printf("%*s traps cpu\n",
ndrives * 3, "");
- (void)printf(" r b w avm fre flt re pi po fr sr ");
+ (void)printf(" r b w avm fre flt re pi po fr sr ");
for (i = 0; i < dk_ndrive; i++)
if (dk_select[i])
(void)printf("%c%c%c ", dr_name[i][0],