44 lines
1.5 KiB
Diff
44 lines
1.5 KiB
Diff
---
|
|
top/top.c | 17 +++++++++++++++--
|
|
1 file changed, 15 insertions(+), 2 deletions(-)
|
|
|
|
--- top/top.c
|
|
+++ top/top.c 2016-07-11 13:14:56.681005709 +0000
|
|
@@ -2295,8 +2295,15 @@ static void zap_fieldstab (void) {
|
|
Fieldstab[EU_CPU].width = 5;
|
|
if (Rc.mode_irixps && smp_num_cpus > 1 && !Thread_mode) {
|
|
Cpu_pmax = 100.0 * smp_num_cpus;
|
|
- if (smp_num_cpus > 10) {
|
|
+ if (smp_num_cpus > 1000) {
|
|
+ if (Cpu_pmax > 9999999.0) Cpu_pmax = 9999999.0;
|
|
+ Fieldstab[EU_CPU].width = 8;
|
|
+ } else if (smp_num_cpus > 100) {
|
|
+ if (Cpu_pmax > 999999.0) Cpu_pmax = 999999.0;
|
|
+ Fieldstab[EU_CPU].width = 7;
|
|
+ } else if (smp_num_cpus > 10) {
|
|
if (Cpu_pmax > 99999.0) Cpu_pmax = 99999.0;
|
|
+ Fieldstab[EU_CPU].width = 6;
|
|
} else {
|
|
if (Cpu_pmax > 999.9) Cpu_pmax = 999.9;
|
|
}
|
|
@@ -2306,12 +2313,18 @@ static void zap_fieldstab (void) {
|
|
Fieldstab[EU_CPU].width = 4;
|
|
if (Rc.mode_irixps && smp_num_cpus > 1 && !Thread_mode) {
|
|
Cpu_pmax = 100.0 * smp_num_cpus;
|
|
+ if (smp_num_cpus > 1000) {
|
|
+ if (Cpu_pmax > 9999999.0) Cpu_pmax = 9999999.0;
|
|
+ Fieldstab[EU_CPU].width = 7;
|
|
+ } else if (smp_num_cpus > 100) {
|
|
+ if (Cpu_pmax > 999999.0) Cpu_pmax = 999999.0;
|
|
+ Fieldstab[EU_CPU].width = 6;
|
|
if (smp_num_cpus > 10) {
|
|
if (Cpu_pmax > 99999.0) Cpu_pmax = 99999.0;
|
|
+ Fieldstab[EU_CPU].width = 5;
|
|
} else {
|
|
if (Cpu_pmax > 999.9) Cpu_pmax = 999.9;
|
|
}
|
|
- Fieldstab[EU_CPU].width = 5;
|
|
}
|
|
#endif
|
|
|