vmstat - Adapt memory limit field for bigger sizes.
authorAntonio Huete Jimenez <tuxillo@quantumachine.net>
Sun, 6 Nov 2011 10:52:24 +0000 (11:52 +0100)
committerAntonio Huete Jimenez <tuxillo@quantumachine.net>
Sun, 6 Nov 2011 10:58:02 +0000 (11:58 +0100)
For some types like filesystem inodes the limit is raised up to
KvaSize, which can be larger than the actual display field size,
so enlarge it a bit.

usr.bin/vmstat/vmstat.c

index ac5cbb3..bae5d1d 100644 (file)
@@ -820,11 +820,11 @@ domem(void)
        printf(
            "\nMemory statistics by type                          Type  Kern\n");
        printf(
        printf(
            "\nMemory statistics by type                          Type  Kern\n");
        printf(
-"              Type   InUse  MemUse HighUse   Limit  Requests  Limit Limit\n");
+"              Type   InUse  MemUse HighUse       Limit  Requests  Limit Limit\n");
        for (i = 0, ks = &kmemstats[0]; i < nkms; i++, ks++) {
                if (ks->ks_calls == 0)
                        continue;
        for (i = 0, ks = &kmemstats[0]; i < nkms; i++, ks++) {
                if (ks->ks_calls == 0)
                        continue;
-               printf("%19s%7ld%7ldK%7ldK%8zdK%10jd%5u%6u",
+               printf("%19s%7ld%7ldK%7ldK%11zdK%10jd%5u%6u",
                    ks->ks_shortdesc,
                    cpuagg(ks->ks_inuse), (cpuagg(ks->ks_memuse) + 1023) / 1024,
                    (ks->ks_maxused + 1023) / 1024,
                    ks->ks_shortdesc,
                    cpuagg(ks->ks_inuse), (cpuagg(ks->ks_memuse) + 1023) / 1024,
                    (ks->ks_maxused + 1023) / 1024,