top: provide -E command line switch for memory scaling
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): https://gitlab.com/procps-ng/procps/issues/53 https://bugzilla.redhat.com/show_bug.cgi?id=1034466 [ this patch has been adapted from the master branch ] Signed-off-by: Jim Warner <james.warner@comcast.net>
This commit is contained in:
@@ -250,7 +250,7 @@ typedef long long SIC_t;
|
||||
| Show_HIBOLD | Show_HIROWS | Show_IDLEPS | Show_TASKON | Show_JRNUMS \
|
||||
| Qsrt_NORMAL )
|
||||
#define DEF_GRAPHS2 0, 0
|
||||
#define DEF_SCALES2 SK_Kb, SK_Kb
|
||||
#define DEF_SCALES2 SK_Mb, SK_Kb
|
||||
#define ALT_WINFLGS DEF_WINFLGS
|
||||
#define ALT_GRAPHS2 0, 0
|
||||
#else
|
||||
|
Reference in New Issue
Block a user