top: change number of emulated cpus from four to eight

With the addition of NUMA/Node support and the ability
to emulate such support even in the absence of libnuma
and numa.h, the maximum number of cpus top can emulate
was increased to make numa emulation more interesting.

( whew, that's an awful lot of "emulates", me thinks )

Reference(s):
commit 8d989c68c0

Signed-off-by: Jim Warner <james.warner@comcast.net>
This commit is contained in:
Jim Warner 2013-04-14 00:00:00 -05:00 committed by Craig Small
parent 53fd7dd1ed
commit 3ac09447e5
2 changed files with 6 additions and 6 deletions

View File

@ -2363,7 +2363,7 @@ static CPU_t *cpus_refresh (CPU_t *cpus) {
#else #else
for (i = 0; i < sumSLOT && i < Screen_rows; i++) { for (i = 0; i < sumSLOT && i < Screen_rows; i++) {
#endif #endif
#ifdef PRETEND4CPUS #ifdef PRETEND8CPUS
rewind(fp); rewind(fp);
fgets(buf, sizeof(buf), fp); fgets(buf, sizeof(buf), fp);
#endif #endif
@ -2384,7 +2384,7 @@ static CPU_t *cpus_refresh (CPU_t *cpus) {
// this is for symmetry only, it's not currently required // this is for symmetry only, it's not currently required
cpus[i].cur.tot = cpus[sumSLOT].cur.tot; cpus[i].cur.tot = cpus[sumSLOT].cur.tot;
#endif #endif
#ifdef PRETEND4CPUS #ifdef PRETEND8CPUS
cpus[i].id = i; cpus[i].id = i;
#endif #endif
#ifdef NUMA_ENABLED #ifdef NUMA_ENABLED
@ -2631,7 +2631,7 @@ static void sysinfo_refresh (int forced) {
meminfo(); meminfo();
mem_secs = cur_secs; mem_secs = cur_secs;
} }
#ifndef PRETEND4CPUS #ifndef PRETEND8CPUS
/*** hotplug_acclimated ***/ /*** hotplug_acclimated ***/
if (300 <= cur_secs - cpu_secs) { if (300 <= cur_secs - cpu_secs) {
cpuinfo(); cpuinfo();
@ -3202,8 +3202,8 @@ static void before (char *me) {
initialize_nls(); initialize_nls();
// establish cpu particulars // establish cpu particulars
#ifdef PRETEND4CPUS #ifdef PRETEND8CPUS
smp_num_cpus = 4; smp_num_cpus = 8;
#endif #endif
Cpu_faux_tot = smp_num_cpus; Cpu_faux_tot = smp_num_cpus;
Cpu_States_fmts = N_unq(STATE_lin2x4_fmt); Cpu_States_fmts = N_unq(STATE_lin2x4_fmt);

View File

@ -43,7 +43,7 @@
//#define OFF_HST_HASH /* use BOTH qsort+bsrch vs. hashing scheme */ //#define OFF_HST_HASH /* use BOTH qsort+bsrch vs. hashing scheme */
//#define OFF_STDIOLBF /* disable our own stdout _IOFBF override */ //#define OFF_STDIOLBF /* disable our own stdout _IOFBF override */
//#define PRETEND2_5_X /* pretend we're linux 2.5.x (for IO-wait) */ //#define PRETEND2_5_X /* pretend we're linux 2.5.x (for IO-wait) */
//#define PRETEND4CPUS /* pretend we're smp with 4 ticsers (sic) */ //#define PRETEND8CPUS /* pretend we're smp with 8 ticsers (sic) */
//#define PRETENDNOCAP /* use a terminal without essential caps */ //#define PRETENDNOCAP /* use a terminal without essential caps */
//#define PRETEND_NUMA /* pretend we've got some linux NUMA Nodes */ //#define PRETEND_NUMA /* pretend we've got some linux NUMA Nodes */
//#define RCFILE_NOERR /* rcfile errs silently default, vs. fatal */ //#define RCFILE_NOERR /* rcfile errs silently default, vs. fatal */