Made all fields in default output be space separated. Run-together

columns confuse the heck out of other apps trying to parse vmstat output
(eg sscope). I made sure we're still <= 80 cols per line.
Fixed warnings about unused vars and printf %format mismatches.

Requested by:	Eugene Aleynikov <eugenea@infospace.com>
Reviewed by:	joerg (implicitly)
MFC after:	2 weeks
This commit is contained in:
Jens Schweikhardt 2001-06-19 17:59:40 +00:00
parent 5e331acd24
commit ca513e5e52
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=78474

View File

@ -165,7 +165,6 @@ main(argc, argv)
int reps;
char *memf, *nlistf;
char errbuf[_POSIX2_LINE_MAX];
char *err_str;
memf = nlistf = NULL;
interval = reps = todo = 0;
@ -318,9 +317,6 @@ char **
getdrivedata(argv)
char **argv;
{
register int i;
char buf[30];
if ((num_devices = getnumdevs()) < 0)
errx(1, "%s", devstat_errbuf);
@ -764,7 +760,6 @@ domem()
long totuse = 0, totfree = 0, totreq = 0;
const char *name;
struct malloc_type kmemstats[MAX_KMSTATS], *kmsp;
char *kmemnames[MAX_KMSTATS];
char buf[1024];
struct kmembuckets buckets[MINBUCKET + 16];
@ -795,7 +790,7 @@ domem()
(void)printf("%4d",size);
else
(void)printf("%3dK",size>>10);
(void)printf(" %8ld %6ld %10ld %7ld %10ld\n",
(void)printf(" %8ld %6ld %10lld %7ld %10ld\n",
kp->kb_total - kp->kb_totalfree,
kp->kb_totalfree, kp->kb_calls,
kp->kb_highwat, kp->kb_couldfree);
@ -841,7 +836,7 @@ domem()
for (i = 0, ks = &kmemstats[0]; i < nkms; i++, ks++) {
if (ks->ks_calls == 0)
continue;
(void)printf("%13s%6ld%6ldK%7ldK%6ldK%9ld%5u%6u",
(void)printf("%13s%6ld%6ldK%7ldK%6ldK%9lld%5u%6u",
ks->ks_shortdesc,
ks->ks_inuse, (ks->ks_memuse + 1023) / 1024,
(ks->ks_maxused + 1023) / 1024,