build, library & top: make OOMEM options unconditional
It was probably always wrong to have a variable length proc_t structure. This patch takes all remaining oomem former suse only options and makes them unconditional. Signed-off-by: Jim Warner <james.warner@comcast.net>
This commit is contained in:
12
top/top.c
12
top/top.c
@@ -1583,12 +1583,8 @@ static struct {
|
||||
{ -1, -1, A_left, 0, 0, PROCPS_PIDS_SUPGIDS }, // str EU_SGD
|
||||
{ -1, -1, A_left, 0, 0, PROCPS_PIDS_SUPGROUPS }, // str EU_SGN
|
||||
{ 0, -1, A_right, 0, 0, PROCPS_PIDS_ID_TGID }, // s_int EU_TGD
|
||||
#ifdef OOMEM_ENABLE
|
||||
#define L_oom PROC_FILLOOM
|
||||
{ 3, -1, A_right, 0, 0, PROCPS_PIDS_OOM_ADJ }, // s_int EU_OOA
|
||||
{ 8, -1, A_right, 0, 0, PROCPS_PIDS_OOM_SCORE }, // s_int EU_OOM
|
||||
#undef L_oom
|
||||
#endif
|
||||
{ -1, -1, A_left, 0, 0, PROCPS_PIDS_ENVIRON }, // str EU_ENV
|
||||
{ 3, -1, A_right, 0, 0, PROCPS_PIDS_FLT_MAJ_DELTA }, // ul_int EU_FV1
|
||||
{ 3, -1, A_right, 0, 0, PROCPS_PIDS_FLT_MIN_DELTA }, // ul_int EU_FV2
|
||||
@@ -3012,11 +3008,7 @@ static int config_cvt (WIN_t *q) {
|
||||
#undef old_Show_THREAD
|
||||
};
|
||||
static const char fields_src[] = CVT_FIELDS;
|
||||
#ifdef OOMEM_ENABLE
|
||||
char fields_dst[PFLAGSSIZ], *p1, *p2;
|
||||
#else
|
||||
char fields_dst[PFLAGSSIZ];
|
||||
#endif
|
||||
int i, j, x;
|
||||
|
||||
// first we'll touch up this window's winflags...
|
||||
@@ -3035,14 +3027,12 @@ static int config_cvt (WIN_t *q) {
|
||||
if (j > CVT_FLDMAX)
|
||||
return 1;
|
||||
strcpy(fields_dst, fields_src);
|
||||
#ifdef OOMEM_ENABLE
|
||||
/* all other fields represent the 'on' state with a capitalized version
|
||||
of a particular qwerty key. for the 2 additional suse out-of-memory
|
||||
fields it makes perfect sense to do the exact opposite, doesn't it?
|
||||
in any case, we must turn them 'off' temporarily... */
|
||||
if ((p1 = strchr(q->rc.fieldscur, '['))) *p1 = '{';
|
||||
if ((p2 = strchr(q->rc.fieldscur, '\\'))) *p2 = '|';
|
||||
#endif
|
||||
for (i = 0; i < j; i++) {
|
||||
int c = q->rc.fieldscur[i];
|
||||
x = tolower(c) - 'a';
|
||||
@@ -3052,11 +3042,9 @@ static int config_cvt (WIN_t *q) {
|
||||
if (isupper(c))
|
||||
FLDon(fields_dst[i]);
|
||||
}
|
||||
#ifdef OOMEM_ENABLE
|
||||
// if we turned any suse only fields off, turn 'em back on OUR way...
|
||||
if (p1) FLDon(fields_dst[p1 - q->rc.fieldscur]);
|
||||
if (p2) FLDon(fields_dst[p2 - q->rc.fieldscur]);
|
||||
#endif
|
||||
strcpy(q->rc.fieldscur, fields_dst);
|
||||
|
||||
// lastly, we must adjust the old sort field enum...
|
||||
|
14
top/top.h
14
top/top.h
@@ -28,7 +28,6 @@
|
||||
//#define BOOST_PERCNT /* enable extra precision for two % fields */
|
||||
//#define NOBOOST_MEMS /* disable extra precision for mem fields */
|
||||
//#define NUMA_DISABLE /* disable summary area NUMA/Nodes display */
|
||||
//#define OOMEM_ENABLE /* enable the SuSE out-of-memory additions */
|
||||
//#define ORIG_TOPDEFS /* with no rcfile retain original defaults */
|
||||
//#define SIGNALS_LESS /* favor reduced signal load over response */
|
||||
|
||||
@@ -181,9 +180,7 @@ enum pflag {
|
||||
EU_FL1, EU_FL2, EU_DRT,
|
||||
EU_STA, EU_CMD, EU_WCH, EU_FLG, EU_CGR,
|
||||
EU_SGD, EU_SGN, EU_TGD,
|
||||
#ifdef OOMEM_ENABLE
|
||||
EU_OOA, EU_OOM,
|
||||
#endif
|
||||
EU_ENV,
|
||||
EU_FV1, EU_FV2,
|
||||
EU_USE,
|
||||
@@ -531,16 +528,11 @@ typedef struct WIN_t {
|
||||
#define JOB_FIELDS "<22><><EFBFBD><EFBFBD><EFBFBD>(<28><>Ļ<EFBFBD>@<<3C><>)*+,-./012568>?ABCFGHIJKLMNOPQRSTUVWXYZ[" RCF_PLUS_H
|
||||
#define MEM_FIELDS "<22><><EFBFBD><<3C><><EFBFBD><EFBFBD><EFBFBD>MBN<42>D34<33><34>&'()*+,-./0125689FGHIJKLOPQRSTUVWXYZ[" RCF_PLUS_H
|
||||
#define USR_FIELDS "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)+,-./1234568;<=>?@ABCFGHIJKLMNOPQRSTUVWXYZ[" RCF_PLUS_H
|
||||
#ifdef OOMEM_ENABLE
|
||||
// the suse old top fields ( 'a'-'z' + '{|' ) in positions 0-27
|
||||
// ( the extra chars above represent the 'off' state )
|
||||
// old top fields ( 'a'-'z' ) in positions 0-25
|
||||
// other suse old top fields ( '{|' ) in positions 26-27
|
||||
#define CVT_FIELDS "%&*'(-0346789:;<=>?@ACDEFGML)+,./125BHIJKNOPQRSTUVWXYZ["
|
||||
#define CVT_FLDMAX 28
|
||||
#else
|
||||
// other old top fields ( 'a'-'z' ) in positions 0-25
|
||||
#define CVT_FIELDS "%&*'(-0346789:;<=>?@ACDEFG)+,./125BHIJKLMNOPQRSTUVWXYZ["
|
||||
#define CVT_FLDMAX 26
|
||||
#endif
|
||||
|
||||
|
||||
/* The default values for the local config file */
|
||||
#define DEF_RCFILE { \
|
||||
|
@@ -237,14 +237,12 @@ static void build_two_nlstabs (void) {
|
||||
/* Translation Hint: maximum 'TGID' = 5 */
|
||||
Head_nlstab[EU_TGD] = _("TGID");
|
||||
Desc_nlstab[EU_TGD] = _("Thread Group Id");
|
||||
#ifdef OOMEM_ENABLE
|
||||
/* Translation Hint: maximum 'Adj' = 3 */
|
||||
Head_nlstab[EU_OOA] = _("Adj");
|
||||
Desc_nlstab[EU_OOA] = _("oom_adjustment (2^X)");
|
||||
/* Translation Hint: maximum 'Badness' = 7 */
|
||||
Head_nlstab[EU_OOM] = _("Badness");
|
||||
Desc_nlstab[EU_OOM] = _("oom_score (badness)");
|
||||
#endif
|
||||
/* Translation Hint: maximum 'ENVIRON' = 7 */
|
||||
Head_nlstab[EU_ENV] = _("ENVIRON");
|
||||
/* Translation Hint: the abbreviation 'vars' below is shorthand for
|
||||
|
Reference in New Issue
Block a user