summaryrefslogtreecommitdiffstats
path: root/usr.bin/vmstat
diff options
context:
space:
mode:
authorasmodai <asmodai@FreeBSD.org>2002-04-13 10:32:36 +0000
committerasmodai <asmodai@FreeBSD.org>2002-04-13 10:32:36 +0000
commitbb24e931b88e88f06b392d3c7125670a891397fc (patch)
tree28afa3fcd4c07e86886ace086838d933feac6dab /usr.bin/vmstat
parentf8ef670650dae95019a7862cac03ea1fd82f4043 (diff)
downloadFreeBSD-src-bb24e931b88e88f06b392d3c7125670a891397fc.zip
FreeBSD-src-bb24e931b88e88f06b392d3c7125670a891397fc.tar.gz
Fix a missed conversion of lld to llu for the uint64_t ks_calls and cast
to unsigned long long. Don't be too overzealous with the printing of ks_calls in the total statistics, cut back from 20 to 13 positions to print (which should last a couple of years easily (20 digits is enough for 3168 years of calls at a measly billion (10^9) calls per second.)). Submitted by: bde
Diffstat (limited to 'usr.bin/vmstat')
-rw-r--r--usr.bin/vmstat/vmstat.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/usr.bin/vmstat/vmstat.c b/usr.bin/vmstat/vmstat.c
index cc312c6..9b7edf5 100644
--- a/usr.bin/vmstat/vmstat.c
+++ b/usr.bin/vmstat/vmstat.c
@@ -787,11 +787,12 @@ domem()
for (i = 0, ks = &kmemstats[0]; i < nkms; i++, ks++) {
if (ks->ks_calls == 0)
continue;
- (void)printf("%13s%6ld%6ldK%7ldK%6ldK%9lld%5u%6u",
+ (void)printf("%13s%6ld%6ldK%7ldK%6ldK%9llu%5u%6u",
ks->ks_shortdesc,
ks->ks_inuse, (ks->ks_memuse + 1023) / 1024,
(ks->ks_maxused + 1023) / 1024,
- (ks->ks_limit + 1023) / 1024, (long long)ks->ks_calls,
+ (ks->ks_limit + 1023) / 1024,
+ (unsigned long long)ks->ks_calls,
ks->ks_limblocks, ks->ks_mapblocks);
first = 1;
for (j = 1 << MINBUCKET; j < 1 << (MINBUCKET + 16); j <<= 1) {
@@ -811,10 +812,10 @@ domem()
totuse += ks->ks_memuse;
totreq += ks->ks_calls;
}
- (void)printf("\nMemory Totals: In Use Free Requests\n");
- (void)printf(" %7ldK %6ldK %20llu\n",
- (totuse + 1023) / 1024,
- (totfree + 1023) / 1024, (unsigned long long)totreq);
+ (void)printf("\nMemory Totals: In Use Free Requests\n");
+ (void)printf(" %7ldK %6ldK %13llu\n",
+ (totuse + 1023) / 1024, (totfree + 1023) / 1024,
+ (unsigned long long)totreq);
}
void
OpenPOWER on IntegriCloud