From: Jim Warner Date: Mon, 23 Aug 2021 05:00:00 +0000 (-0500) Subject: top: added a new #define to test absence of numa nodes X-Git-Tag: v4.0.3_rc1~33^2~113 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7a30fd0f51be8239bc19b768102f2107ff99493f;p=procps-ng top: added a new #define to test absence of numa nodes Catch-up with newlib, original commit message follows: ------------------------------------------------------ This new #define will produce top results identical to the results achieved for './configure --disable-numa'. However it keeps the change entirely local to our top. [ it has been introduced to test the following patch ] Signed-off-by: Jim Warner --- diff --git a/top/top.c b/top/top.c index bcd28f78..3d654b76 100644 --- a/top/top.c +++ b/top/top.c @@ -2853,7 +2853,9 @@ static void sysinfo_refresh (int forced) { #ifndef PRETEND48CPU cpuinfo(); #endif +#ifndef PRETEND0NUMA Numa_node_tot = numa_max_node() + 1; +#endif sav_secs = cur_secs; } } // end: sysinfo_refresh @@ -3696,7 +3698,9 @@ static void before (char *me) { #endif numa_init(); +#ifndef PRETEND0NUMA Numa_node_tot = numa_max_node() + 1; +#endif #ifndef SIGRTMAX // not available on hurd, maybe others too #define SIGRTMAX 32 diff --git a/top/top.h b/top/top.h index 4b8a9305..94816b73 100644 --- a/top/top.h +++ b/top/top.h @@ -44,6 +44,7 @@ //#define OFF_STDERROR /* disable our stderr buffering (redirect) */ //#define OFF_STDIOLBF /* disable our own stdout _IOFBF override */ //#define OFF_XTRAWIDE /* disable our extra wide multi-byte logic */ +//#define PRETEND0NUMA /* pretend that there ain't any numa nodes */ //#define PRETEND2_5_X /* pretend we're linux 2.5.x (for IO-wait) */ //#define PRETEND48CPU /* pretend we're smp with 48 ticsers (sic) */ //#define PRETENDNOCAP /* use a terminal without essential caps */