Red Hat Bugzilla – Bug 430424
Redeem "vmstat.c" source.
Last modified: 2008-03-10 05:26:17 EDT
Description of problem:
procps-3.2.3-8.9 "vmstat.c" code has a few style problems.
Patch provided. This patch includes the Red Hat "procps-3.2.3-vmstat-pgpg.patch"
which transforms "unsigned long" to "unsigned long long" in some cases.
What is fixed:
Changed the usage output fully - hopefully made clearer, added '-f' explanation
which was missing.
Output "-s" displays "KB", "KiB", "MB", "MiB" instead of "k", "K", "m", "M",
which is nicer but may break some programs which parse the output of vmstat.
The "unit selectors" (dataUnit,szDataUnit) are transformed from global vars to
local var passed as arguments.
The "number of updates" (num_updates) is transformed from global var to local
var passed as argument.
The "display forks since boot" mode is implemented as a mode, not as a call and
The "display active/inactive pages" (a_option) is transformed from global var to
local var passed as argument.
Added function count32Bits() to check whether user requested more than one mode.
Removed the "FIXME" remark for that.
unitConvert() has a special case for SLABSTAT mode which never occurs. Commented
Used "strncpy" instead of "strcpy" to read partition name form argument line.
In main(), "argc" was horribly recycled as "counter of integer arguments". Fixed.
The printf() call for the vmstat results has been rearranged to always used
"delta" values; it's just clearer.
Some variables have been renamed; this makes the diff messy but the code nicer.
Created attachment 293088 [details]
Unified diff for vmstat.c
Thank you for the patch. However I don't wish to include patches that don't
have bugzillas associated and are not present in the upstream version. Have you
sent the patch upstream?
No, I haven't ... yet. Where do I post it? Wat about the Red Hat patch which
transforms some "long" to "long long" (and also affects other files)? Do I
The procps upstream maintainer is Albert Cahalan <firstname.lastname@example.org>. Update
your patch according to the latest CVS version and send it to him (a good
starting point is the project homepage: http://procps.sourceforge.net/).
It is up to the Product Management to decide what patch is to be included in
RHEL. I'm afraid that code cleanup that doesn't fix any bug is really not a
good adept for RHEL inclusion. Even more: as you noted changing the output
format may cause incompatibilities -- this is simply unacceptable (in RHEL)
without any further justification.
Hope I made clearer...
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux maintenance release. Product Management has requested
further review of this request by Red Hat Engineering, for potential
inclusion in a Red Hat Enterprise Linux Update release for currently deployed
products. This request is not yet committed for inclusion in an Update
Development Management has reviewed and declined this request. You may appeal
this decision by reopening this request.