Bug 430424 - Redeem "vmstat.c" source.
Redeem "vmstat.c" source.
Status: CLOSED WONTFIX
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: procps (Show other bugs)
4.6
All Linux
low Severity low
: rc
: ---
Assigned To: Tomas Smetana
Brian Brock
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2008-01-27 17:53 EST by David Tonhofer
Modified: 2008-03-10 05:26 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2008-03-10 05:26:17 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Unified diff for vmstat.c (24.76 KB, patch)
2008-01-27 17:53 EST, David Tonhofer
no flags Details | Diff

  None (edit)
Description David Tonhofer 2008-01-27 17:53:59 EST
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:

Most important: 

Changed the usage output fully - hopefully made clearer, added '-f' explanation
which was missing.

Most problematic:

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.

Style fixes:

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
exit().

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
out.

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.
Comment 1 David Tonhofer 2008-01-27 17:53:59 EST
Created attachment 293088 [details]
Unified diff for vmstat.c
Comment 2 Tomas Smetana 2008-01-28 01:49:26 EST
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?
Comment 3 David Tonhofer 2008-01-28 08:17:01 EST
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
include it?

Comment 4 Tomas Smetana 2008-01-28 08:42:58 EST
The procps upstream maintainer is Albert Cahalan <albert@users.sf.net>.  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...
Comment 6 RHEL Product and Program Management 2008-03-05 05:08:09 EST
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
release.
Comment 8 RHEL Product and Program Management 2008-03-10 05:26:17 EDT
Development Management has reviewed and declined this request.  You may appeal
this decision by reopening this request. 

Note You need to log in before you can comment on or make changes to this bug.