diff --git a/top/top.c b/top/top.c index 172507f8..8d24962e 100644 --- a/top/top.c +++ b/top/top.c @@ -3324,13 +3324,18 @@ static void summaryhlp (CPU_t *cpu, const char *pfx) { s_frme = TRIMz(cpu->cur.s - cpu->sav.s); n_frme = TRIMz(cpu->cur.n - cpu->sav.n); i_frme = TRIMz(cpu->cur.i - cpu->sav.i); - if ((u_frme == 0) && (i_frme == 0)) i_frme = 100; w_frme = TRIMz(cpu->cur.w - cpu->sav.w); x_frme = TRIMz(cpu->cur.x - cpu->sav.x); y_frme = TRIMz(cpu->cur.y - cpu->sav.y); z_frme = TRIMz(cpu->cur.z - cpu->sav.z); tot_frme = u_frme + s_frme + n_frme + i_frme + w_frme + x_frme + y_frme + z_frme; +#ifdef CPU_ZEROTICS if (1 > tot_frme) tot_frme = 1; +#else + if (tot_frme < ((smp_num_cpus * 10) * Rc.delay_time)) + tot_frme = u_frme = s_frme = n_frme = i_frme = w_frme = x_frme = y_frme = z_frme = 0; + if (1 > tot_frme) i_frme = tot_frme = 1; +#endif scale = 100.0 / (float)tot_frme; /* display some kinda' cpu state percentages diff --git a/top/top.h b/top/top.h index 0abf9552..c4daa1bb 100644 --- a/top/top.h +++ b/top/top.h @@ -27,6 +27,7 @@ //#define ATEOJ_RPTSTD /* report on misc stuff, at end-of-job */ //#define CASEUP_HEXES /* show any hex values in upper case */ //#define CASEUP_SUFIX /* show time/mem/cnts suffix in upper case */ +//#define CPU_ZEROTICS /* tolerate few tics when cpu off vs. idle */ //#define EQUCOLHDRYES /* yes, do equalize column header lengths */ //#define OFF_HST_HASH /* use BOTH qsort+bsrch vs. hashing scheme */ //#define OFF_STDIOLBF /* disable our own stdout _IOFBF override */