bin/135893: [patch] vmstat(8): 'vmstat -s -M core' is broken
John Baldwin
jhb at FreeBSD.org
Thu Oct 29 17:40:03 UTC 2009
The following reply was made to PR bin/135893; it has been noted by GNATS.
From: John Baldwin <jhb at FreeBSD.org>
To: bug-followup at freebsd.org,
to.my.trociny at gmail.com
Cc:
Subject: Re: bin/135893: [patch] vmstat(8): 'vmstat -s -M core' is broken
Date: Thu, 29 Oct 2009 13:20:46 -0400
This looks good in general. Some suggestions:
In fill_pcpu():
- Use 'kvm_getmaxcpu' instead of 'kvm_getcptime' in error message.
- I think it's ok to just drop the maxcpu == 0 check.
- I would just use 'calloc(maxcpu, sizeof(struct pcpu *))' and
have the error just say that calloc() failed w/o including the
size.
- C doesn't require a cast for void * pointers, so you can remove
the cast from calloc().
- Always use a space after 'if' and let the first { of a function
start on a new line.
- I would probably use 'pcpu' instead of 'ppcpup' as the variable
name.
These are fairly minor nits though. I can probably fix these things and test
it today.
--
John Baldwin
More information about the freebsd-bugs
mailing list