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
This commit is contained in:
parent
f8ef670650
commit
bb24e931b8
@ -787,11 +787,12 @@ domem()
|
|||||||
for (i = 0, ks = &kmemstats[0]; i < nkms; i++, ks++) {
|
for (i = 0, ks = &kmemstats[0]; i < nkms; i++, ks++) {
|
||||||
if (ks->ks_calls == 0)
|
if (ks->ks_calls == 0)
|
||||||
continue;
|
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_shortdesc,
|
||||||
ks->ks_inuse, (ks->ks_memuse + 1023) / 1024,
|
ks->ks_inuse, (ks->ks_memuse + 1023) / 1024,
|
||||||
(ks->ks_maxused + 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);
|
ks->ks_limblocks, ks->ks_mapblocks);
|
||||||
first = 1;
|
first = 1;
|
||||||
for (j = 1 << MINBUCKET; j < 1 << (MINBUCKET + 16); j <<= 1) {
|
for (j = 1 << MINBUCKET; j < 1 << (MINBUCKET + 16); j <<= 1) {
|
||||||
@ -811,10 +812,10 @@ domem()
|
|||||||
totuse += ks->ks_memuse;
|
totuse += ks->ks_memuse;
|
||||||
totreq += ks->ks_calls;
|
totreq += ks->ks_calls;
|
||||||
}
|
}
|
||||||
(void)printf("\nMemory Totals: In Use Free Requests\n");
|
(void)printf("\nMemory Totals: In Use Free Requests\n");
|
||||||
(void)printf(" %7ldK %6ldK %20llu\n",
|
(void)printf(" %7ldK %6ldK %13llu\n",
|
||||||
(totuse + 1023) / 1024,
|
(totuse + 1023) / 1024, (totfree + 1023) / 1024,
|
||||||
(totfree + 1023) / 1024, (unsigned long long)totreq);
|
(unsigned long long)totreq);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
Loading…
x
Reference in New Issue
Block a user