diff --git a/configure.ac b/configure.ac index 19a8f260..08474b1b 100644 --- a/configure.ac +++ b/configure.ac @@ -195,6 +195,14 @@ if test "x$enable_sigwinch" = xyes; then AC_DEFINE(SIGNALS_LESS, 1, [reduce impact of x-windows resize operations on top]) fi +AC_ARG_ENABLE([wide-percent], + AS_HELP_STRING([--enable-wide-percent], [provide extra precision under %CPU and %MEM for top]), + [enable_wide_percent=yes], [] +) +if test "x$enable_wide_percent" = xyes; then + AC_DEFINE(BOOST_PERCNT, 1, [provide extra precision under %CPU and %MEM for top]) +fi + DL_LIB= AC_ARG_ENABLE([numa], AS_HELP_STRING([--disable-numa], [disable NUMA/Node support in top]), diff --git a/top/top.c b/top/top.c index 042e5fe7..4caf6580 100644 --- a/top/top.c +++ b/top/top.c @@ -1564,7 +1564,7 @@ static const char *scale_pcnt (float num, int width, int justr) { buf[0] = '\0'; if (Rc.zero_suppress && 0 >= num) goto end_justifies; -#ifndef NOBOOST_PCNT +#ifdef BOOST_PERCNT if (width >= snprintf(buf, sizeof(buf), "%#.3f", num)) goto end_justifies; if (width >= snprintf(buf, sizeof(buf), "%#.2f", num)) @@ -1699,7 +1699,7 @@ static FLD_t Fieldstab[] = { { 0, -1, A_right, SF(CPU), L_stat }, { 6, -1, A_right, SF(TME), L_stat }, { 9, -1, A_right, SF(TME), L_stat }, // P_TM2 slot -#ifndef NOBOOST_PCNT +#ifdef BOOST_PERCNT { 5, -1, A_right, SF(RES), L_statm }, // P_MEM slot #else { 4, -1, A_right, SF(RES), L_statm }, // P_MEM slot @@ -2238,7 +2238,7 @@ static void zap_fieldstab (void) { Fieldstab[P_CPN].width = digits; } -#ifndef NOBOOST_PCNT +#ifdef BOOST_PERCNT Cpu_pmax = 99.9; Fieldstab[P_CPU].width = 5; if (Rc.mode_irixps && smp_num_cpus > 1 && !Thread_mode) { diff --git a/top/top.h b/top/top.h index 01434ed0..f327cfdb 100644 --- a/top/top.h +++ b/top/top.h @@ -23,6 +23,7 @@ #include "../proc/readproc.h" /* Defines represented in configure.ac ----------------------------- */ +//#define BOOST_PERCNT /* enable extra precision for two % fields */ //#define NUMA_DISABLE /* disable summary area NUMA/Nodes display */ //#define OOMEM_ENABLE /* enable the SuSE out-of-memory additions */ //#define SIGNALS_LESS /* favor reduced signal load over response */ @@ -39,7 +40,6 @@ //#define INSP_SAVEBUF /* preserve 'Insp_buf' contents in a file */ //#define INSP_SLIDE_1 /* when scrolling left/right don't move 8 */ //#define NOBOOST_MEMS /* disable extra precision for mem fields */ -//#define NOBOOST_PCNT /* disable extra precision for % fields */ //#define OFF_HST_HASH /* use BOTH qsort+bsrch vs. hashing scheme */ //#define OFF_STDIOLBF /* disable our own stdout _IOFBF override */ //#define PRETEND2_5_X /* pretend we're linux 2.5.x (for IO-wait) */