]> granicus.if.org Git - procps-ng/commitdiff
top: correct comments & code regarding sysinfo_refresh
authorJim Warner <james.warner@comcast.net>
Fri, 9 Sep 2016 08:33:33 +0000 (03:33 -0500)
committerCraig Small <csmall@enc.com.au>
Sat, 10 Sep 2016 23:31:05 +0000 (09:31 +1000)
This commit just brings some comments plus identifiers
into agreement with the current newlib implementation.

Signed-off-by: Jim Warner <james.warner@comcast.net>
top/top.c
top/top.h

index d29d8f4d64077cd45ecfd596e1235b905cdd4aff..79c9e7f74cef2bef96419e66c1b0993160dfc343 100644 (file)
--- a/top/top.c
+++ b/top/top.c
@@ -2092,8 +2092,6 @@ static void zap_fieldstab (void) {
       once = 1;
    }
 
-   /*** hotplug_acclimated ***/
-
    Fieldstab[EU_CPN].width = 1;
    if (1 < (digits = (unsigned)snprintf(buf, sizeof(buf), "%u", (unsigned)Cpu_cnt))) {
       if (5 < digits) error_exit(N_txt(FAIL_widecpu_txt));
@@ -2227,22 +2225,20 @@ static void procs_refresh (void) {
 
 
         /*
-         * This serves as our interface to the memory & cpu count (sysinfo)
-         * portion of libproc.  In support of those hotpluggable resources,
-         * the sampling frequencies are reduced so as to minimize overhead. */
+         * This serves as our interface to the memory portion of libprocps.
+         * The sampling frequency is reduced in order to minimize overhead. */
 static void sysinfo_refresh (int forced) {
-   static time_t mem_secs, cpu_secs;
+   static time_t sav_secs;
    time_t cur_secs;
 
    if (forced)
-      mem_secs = cpu_secs = 0;
+      sav_secs = 0;
    cur_secs = time(NULL);
 
-   /*** hotplug_acclimated ***/
-   if (3 <= cur_secs - mem_secs) {
+   if (3 <= cur_secs - sav_secs) {
       if (!(Mem_stack = procps_meminfo_select(Mem_ctx, Mem_items, MAXTBL(Mem_items))))
          error_exit(fmtmk(N_fmt(LIB_errormem_fmt),__LINE__));
-      mem_secs = cur_secs;
+      sav_secs = cur_secs;
    }
 } // end: sysinfo_refresh
 \f
index 5ad6f665916c3969fa5f1a940bce6633d5409d96..8674d1219ba9662f618ec800fd16f087dd16e383 100644 (file)
--- a/top/top.h
+++ b/top/top.h
 
 /*######  Notes, etc.  ###################################################*/
 
-        /* The following convention is used to identify those areas where
-           adaptations for hotplugging are to be found ...
-              *** hotplug_acclimated ***
-           ( hopefully libproc will also be supportive of our efforts ) */
-
         /* For introducing inaugural cgroup support, thanks to:
               Jan Gorig <jgorig@redhat.com> - April, 2011 */