procps/procps-v3.3.4-large_pcpu.patch
2012-10-30 13:13:12 +00:00

41 lines
1.5 KiB
Diff

--- top/top.c
+++ top/top.c 2012-10-30 11:34:42.634844811 +0000
@@ -1910,8 +1910,15 @@ static void zap_fieldstab (void) {
Fieldstab[P_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[P_CPU].width = 8;
+ } else if (smp_num_cpus() > 100) {
+ if (Cpu_pmax > 999999.0) Cpu_pmax = 999999.0;
+ Fieldstab[P_CPU].width = 7;
+ } else if (smp_num_cpus() > 10) {
if (Cpu_pmax > 99999.0) Cpu_pmax = 99999.0;
+ Fieldstab[P_CPU].width = 6;
} else {
if (Cpu_pmax > 999.9) Cpu_pmax = 999.9;
}
@@ -1921,12 +1928,18 @@ static void zap_fieldstab (void) {
Fieldstab[P_CPU].width = 4;
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[P_CPU].width = 7;
+ } else if (smp_num_cpus() > 100) {
+ if (Cpu_pmax > 999999.0) Cpu_pmax = 999999.0;
+ Fieldstab[P_CPU].width = 6;
+ } else if (smp_num_cpus() > 10) {
if (Cpu_pmax > 99999.0) Cpu_pmax = 99999.0;
+ Fieldstab[P_CPU].width = 5;
} else {
if (Cpu_pmax > 999.9) Cpu_pmax = 999.9;
}
- Fieldstab[P_CPU].width = 5;
}
#endif