top: correct comments & code regarding sysinfo_refresh
This commit just brings some comments plus identifiers into agreement with the current newlib implementation. Signed-off-by: Jim Warner <james.warner@comcast.net>
This commit is contained in:
parent
6f8c101e2e
commit
793ada6ec5
16
top/top.c
16
top/top.c
@ -2092,8 +2092,6 @@ static void zap_fieldstab (void) {
|
|||||||
once = 1;
|
once = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*** hotplug_acclimated ***/
|
|
||||||
|
|
||||||
Fieldstab[EU_CPN].width = 1;
|
Fieldstab[EU_CPN].width = 1;
|
||||||
if (1 < (digits = (unsigned)snprintf(buf, sizeof(buf), "%u", (unsigned)Cpu_cnt))) {
|
if (1 < (digits = (unsigned)snprintf(buf, sizeof(buf), "%u", (unsigned)Cpu_cnt))) {
|
||||||
if (5 < digits) error_exit(N_txt(FAIL_widecpu_txt));
|
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)
|
* This serves as our interface to the memory portion of libprocps.
|
||||||
* portion of libproc. In support of those hotpluggable resources,
|
* The sampling frequency is reduced in order to minimize overhead. */
|
||||||
* the sampling frequencies are reduced so as to minimize overhead. */
|
|
||||||
static void sysinfo_refresh (int forced) {
|
static void sysinfo_refresh (int forced) {
|
||||||
static time_t mem_secs, cpu_secs;
|
static time_t sav_secs;
|
||||||
time_t cur_secs;
|
time_t cur_secs;
|
||||||
|
|
||||||
if (forced)
|
if (forced)
|
||||||
mem_secs = cpu_secs = 0;
|
sav_secs = 0;
|
||||||
cur_secs = time(NULL);
|
cur_secs = time(NULL);
|
||||||
|
|
||||||
/*** hotplug_acclimated ***/
|
if (3 <= cur_secs - sav_secs) {
|
||||||
if (3 <= cur_secs - mem_secs) {
|
|
||||||
if (!(Mem_stack = procps_meminfo_select(Mem_ctx, Mem_items, MAXTBL(Mem_items))))
|
if (!(Mem_stack = procps_meminfo_select(Mem_ctx, Mem_items, MAXTBL(Mem_items))))
|
||||||
error_exit(fmtmk(N_fmt(LIB_errormem_fmt),__LINE__));
|
error_exit(fmtmk(N_fmt(LIB_errormem_fmt),__LINE__));
|
||||||
mem_secs = cur_secs;
|
sav_secs = cur_secs;
|
||||||
}
|
}
|
||||||
} // end: sysinfo_refresh
|
} // end: sysinfo_refresh
|
||||||
|
|
||||||
|
@ -59,11 +59,6 @@
|
|||||||
|
|
||||||
/*###### Notes, etc. ###################################################*/
|
/*###### 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:
|
/* For introducing inaugural cgroup support, thanks to:
|
||||||
Jan Gorig <jgorig@redhat.com> - April, 2011 */
|
Jan Gorig <jgorig@redhat.com> - April, 2011 */
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user