)
AM_CONDITIONAL(EXAMPLE_FILES, test "x$enable_examples" = xyes)
-AC_ARG_ENABLE([oomem],
- AS_HELP_STRING([--enable-oomem], [add out-of-memory fields to the library and top]),
- [], [enable_oomem=no]
-)
-if test "x$enable_oomem" = xyes; then
- AC_DEFINE(OOMEM_ENABLE, 1, [add out-of-memory fields to the library and top])
-fi
-
AC_ARG_ENABLE([sigwinch],
AS_HELP_STRING([--enable-sigwinch], [reduce impact of x-windows resize operations on top]),
[], [enable_sigwinch=no]
}
///////////////////////////////////////////////////////////////////////
-#ifdef OOMEM_ENABLE
static void oomscore2proc(const char* S, proc_t *restrict P)
{
sscanf(S, "%d", &P->oom_score);
{
sscanf(S, "%d", &P->oom_adj);
}
-#endif
///////////////////////////////////////////////////////////////////////
static const char *ns_names[] = {
} else
p->cgroup = NULL;
-#ifdef OOMEM_ENABLE
if (unlikely(flags & PROC_FILLOOM)) {
if (likely(file2str(path, "oom_score", &ub) != -1))
oomscore2proc(ub.buf, p);
if (likely(file2str(path, "oom_adj", &ub) != -1))
oomadj2proc(ub.buf, p);
}
-#endif
if (unlikely(flags & PROC_FILLNS)) // read /proc/#/ns/*
ns2proc(path, p);
}
#endif
-#ifdef OOMEM_ENABLE
if (unlikely(flags & PROC_FILLOOM)) {
if (likely(file2str(path, "oom_score", &ub) != -1))
oomscore2proc(ub.buf, t);
if (likely(file2str(path, "oom_adj", &ub) != -1))
oomadj2proc(ub.buf, t);
}
-#endif
if (unlikely(flags & PROC_FILLNS)) // read /proc/#/task/#/ns/*
ns2proc(path, t);
tpgid, // stat terminal process group id
exit_signal, // stat might not be SIGCHLD
processor; // stat current (or most recent?) CPU
-#ifdef OOMEM_ENABLE
int
oom_score, // oom_score (badness for OOM killer)
oom_adj; // oom_adj (adjustment to OOM score)
-#endif
long
ns[NUM_NS]; // (ns subdir) inode number of namespaces
char
{ -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
#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...
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';
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...
//#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 */
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,
#define JOB_FIELDS "¥¦¹·º(³´Ä»½@<§Å)*+,-./012568>?ABCFGHIJKLMNOPQRSTUVWXYZ[" RCF_PLUS_H
#define MEM_FIELDS "¥º»<½¾¿ÀÁMBNÃD34·Å&'()*+,-./0125689FGHIJKLOPQRSTUVWXYZ[" RCF_PLUS_H
#define USR_FIELDS "¥¦§¨ª°¹·ºÄÅ)+,-./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 { \
/* 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