top: also adapted to absent 'core id' in /proc/cpuinfo

Just as our library was made responsive to a potential
missing 'core id', the top program should also change.

That's because he has his own PRETENDECORE #define and
if that was activated on a platform without 'core id',
the 'CpP' notations would have otherwise been omitted.

Reference(s):
. Oct, 2022 - library fix for missing 'core id'
commit b89e3230b2

Signed-off-by: Jim Warner <james.warner@comcast.net>
This commit is contained in:
Jim Warner 2022-10-25 05:05:05 -05:00 committed by Craig Small
parent 474e22eb0b
commit 2647eb57da

View File

@ -2734,9 +2734,10 @@ static void *cpus_refresh (void *unused) {
#endif #endif
} }
#ifdef PRETENDECORE #ifdef PRETENDECORE
{ int i; { int i, x;
for (i = Cpu_cnt - (Cpu_cnt / 4); i < Cpu_cnt; i++) x = Cpu_cnt - (Cpu_cnt / 4);
Stat_reap->cpus->stacks[i]->head[stat_COR_TYP].result.s_int = E_CORE; for (i = 0; i < Cpu_cnt; i++)
Stat_reap->cpus->stacks[i]->head[stat_COR_TYP].result.s_int = (i < x) ? P_CORE : E_CORE;
} }
#endif #endif
#ifdef THREADED_CPU #ifdef THREADED_CPU