summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJim Warner <james.warner@comcast.net>2022-10-25 05:05:05 -0500
committerCraig Small <csmall@dropbear.xyz>2022-10-30 21:18:30 +1100
commit2647eb57da100823ffdb2f8afffbfd59e2887e8f (patch)
tree842f76a5c9f17bc355bff0d66eca6a4b1ad64c60 /src
parent474e22eb0be520d2c748355ff7dd5a45753403cf (diff)
downloadprocps-ng-2647eb57da100823ffdb2f8afffbfd59e2887e8f.tar.gz
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 b89e3230b2baa5b82a2961b240731db95a887f26 Signed-off-by: Jim Warner <james.warner@comcast.net>
Diffstat (limited to 'src')
-rw-r--r--src/top/top.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/top/top.c b/src/top/top.c
index e595cd8..fae38bd 100644
--- a/src/top/top.c
+++ b/src/top/top.c
@@ -2734,9 +2734,10 @@ static void *cpus_refresh (void *unused) {
#endif
}
#ifdef PRETENDECORE
-{ int i;
- for (i = Cpu_cnt - (Cpu_cnt / 4); i < Cpu_cnt; i++)
- Stat_reap->cpus->stacks[i]->head[stat_COR_TYP].result.s_int = E_CORE;
+{ int i, x;
+ x = Cpu_cnt - (Cpu_cnt / 4);
+ 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
#ifdef THREADED_CPU