diff --git a/proc/diskstats.c b/proc/diskstats.c index 93b9abbf..8a56e945 100644 --- a/proc/diskstats.c +++ b/proc/diskstats.c @@ -769,7 +769,8 @@ PROCPS_EXPORT int procps_diskstats_new ( /* do a priming read here for the following potential benefits: | 1) ensure there will be no problems with subsequent access | - 2) make delta results potentially useful, even if 1st time | */ + 2) make delta results potentially useful, even if 1st time | + 3) elimnate need for history distortions 1st time 'switch' | */ if ((rc = diskstats_read_failed(p))) { procps_diskstats_unref(&p); return rc; diff --git a/proc/meminfo.c b/proc/meminfo.c index cfcf5b02..9d7363ce 100644 --- a/proc/meminfo.c +++ b/proc/meminfo.c @@ -109,7 +109,6 @@ struct stacks_extent { struct meminfo_info { int refcount; int meminfo_fd; - int meminfo_was_read; int dirty_stacks; struct mem_hist hist; int numitems; @@ -644,11 +643,6 @@ static int meminfo_read_failed ( if (mHr(SwapFree) < mHr(SwapTotal)) mHr(derived_swap_used) = mHr(SwapTotal) - mHr(SwapFree); - // let's not distort the deltas the first time thru ... - if (!info->meminfo_was_read) { - memcpy(&info->hist.old, &info->hist.new, sizeof(struct meminfo_data)); - info->meminfo_was_read = 1; - } return 0; #undef mHr } // end: meminfo_read_failed @@ -751,7 +745,8 @@ PROCPS_EXPORT int procps_meminfo_new ( /* do a priming read here for the following potential benefits: | 1) ensure there will be no problems with subsequent access | - 2) make delta results potentially useful, even if 1st time | */ + 2) make delta results potentially useful, even if 1st time | + 3) elimnate need for history distortions 1st time 'switch' | */ if ((rc = meminfo_read_failed(p))) { procps_meminfo_unref(&p); return rc; diff --git a/proc/slabinfo.c b/proc/slabinfo.c index 921ec601..4dd28b85 100644 --- a/proc/slabinfo.c +++ b/proc/slabinfo.c @@ -121,7 +121,6 @@ struct fetch_support { struct slabinfo_info { int refcount; FILE *slabinfo_fp; - int slabinfo_was_read; int nodes_alloc; /* nodes alloc()ed */ int nodes_used; /* nodes using alloced memory */ struct slabs_node *nodes; /* first slabnode of this list */ @@ -495,10 +494,6 @@ static int read_slabinfo_failed ( else return -ERANGE; - if (!info->slabinfo_was_read) { - memcpy(&info->slabs.old, &info->slabs.new, sizeof(struct slabs_summ)); - info->slabinfo_was_read = 1; - } return retval; } // end: read_slabinfo_failed @@ -814,7 +809,8 @@ PROCPS_EXPORT int procps_slabinfo_new ( /* do a priming read here for the following potential benefits: | 1) see if that caller's permissions were sufficient (root) | - 2) make delta results potentially useful, even if 1st time | */ + 2) make delta results potentially useful, even if 1st time | + 3) elimnate need for history distortions 1st time 'switch' | */ if ((rc = read_slabinfo_failed(p))) { procps_slabinfo_unref(&p); return rc; diff --git a/proc/stat.c b/proc/stat.c index 452860f6..758d983a 100644 --- a/proc/stat.c +++ b/proc/stat.c @@ -118,7 +118,6 @@ struct reap_support { struct stat_info { int refcount; int stat_fd; - int stat_was_read; // is stat file history valid? struct hist_sys sys_hist; // SYS type management struct hist_tic cpu_hist; // TIC type management for cpu summary struct reap_support cpus; // TIC type management for real cpus @@ -617,9 +616,6 @@ static int stat_read_failed ( , &sum_ptr->new.guest, &sum_ptr->new.gnice)) return -1; stat_derive_unique(sum_ptr); - // let's not distort the deltas the first time thru ... - if (!info->stat_was_read) - memcpy(&sum_ptr->old, &sum_ptr->new, sizeof(struct stat_jifs)); i = 0; reap_em_again: @@ -645,9 +641,6 @@ reap_em_again: break; // we must tolerate cpus taken offline } stat_derive_unique(cpu_ptr); - // let's not distort the deltas the first time thru ... - if (!info->stat_was_read) - memcpy(&cpu_ptr->old, &cpu_ptr->new, sizeof(struct stat_jifs)); ++i; ++cpu_ptr; } while (i < info->cpus.hist.n_alloc); @@ -695,11 +688,6 @@ reap_em_again: sscanf(b, "procs_running %llu", &llnum); info->sys_hist.new.procs_running = llnum; - // let's not distort the deltas the first time thru ... - if (!info->stat_was_read) { - memcpy(&info->sys_hist.old, &info->sys_hist.new, sizeof(struct stat_data)); - info->stat_was_read = 1; - } return 0; } // end: stat_read_failed @@ -939,7 +927,8 @@ PROCPS_EXPORT int procps_stat_new ( /* do a priming read here for the following potential benefits: | 1) ensure there will be no problems with subsequent access | - 2) make delta results potentially useful, even if 1st time | */ + 2) make delta results potentially useful, even if 1st time | + 3) elimnate need for history distortions 1st time 'switch' | */ if ((rc = stat_read_failed(p))) { procps_stat_unref(&p); return rc; diff --git a/proc/vmstat.c b/proc/vmstat.c index 32671ebb..28bf624f 100644 --- a/proc/vmstat.c +++ b/proc/vmstat.c @@ -182,7 +182,6 @@ struct stacks_extent { struct vmstat_info { int refcount; int vmstat_fd; - int vmstat_was_read; int dirty_stacks; struct vmstat_hist hist; int numitems; @@ -1029,11 +1028,6 @@ static int vmstat_read_failed ( head = tail + 1; } - // let's not distort the deltas the first time thru ... - if (!info->vmstat_was_read) { - memcpy(&info->hist.old, &info->hist.new, sizeof(struct vmstat_data)); - info->vmstat_was_read = 1; - } return 0; } // end: vmstat_read_failed @@ -1135,7 +1129,8 @@ PROCPS_EXPORT int procps_vmstat_new ( /* do a priming read here for the following potential benefits: | 1) ensure there will be no problems with subsequent access | - 2) make delta results potentially useful, even if 1st time | */ + 2) make delta results potentially useful, even if 1st time | + 3) elimnate need for history distortions 1st time 'switch' | */ if ((rc = vmstat_read_failed(p))) { procps_vmstat_unref(&p); return rc;