Skip to content
  • jim warner's avatar
    top: provide -E command line switch for memory scaling · fb48b5d9
    jim warner authored
    In their 3.2.7 version of top, Redhat introduced an -M
    switch to automatically scale Summary Area memory data
    to avoid truncation (and the resulting '+' indicator).
    
    The procps-ng top does not employ suffixes with memory
    data nor does it allow for different scaling with each
    separate value. Rather, scaling appears at line start.
    
    If built without ./configure --disable-modern-top, the
    Summary Area memory will be scaled at GiB which should
    lessen chance of truncation. Otherwise KiB was used to
    reflect such memory, increasing the truncation chance.
    
    And while 'W' can be used to preserve some appropriate
    scaling value, there are arguments against such rcfile
    approaches as cited in the issue and bug report below.
    
    So this commit will bump the Summary Area memory scale
    factor from KiB to MiB when using --disable-modern-top
    as a concession to that Redhat bug report noted below.
    
    And it also introduces a new command line switch which
    can force any desired scaling regardless of the rcfile
    or which ./configure option might have been specified.
    
    [ for top's help text we'll show 'E' as if it were a ]
    [ switch without arguments in order to keep the help ]
    [ text displayable without wrap in an 80x24 terminal ]
    
    [ the man page, however, will show all k-e arguments ]
    
    Reference(s):
    #53
    https://bugzilla.redhat.com/show_bug.cgi?id=1034466
    
    
    
    Signed-off-by: default avatarJim Warner <james.warner@comcast.net>
    fb48b5d9