From e63e0ff456c422f2dd004a188dbc5b84f9dde5f0 Mon Sep 17 00:00:00 2001 From: Doug MacEachern Date: Sat, 4 Mar 2006 02:48:58 +0000 Subject: [PATCH] remove proc_mem.{rss,vsize} --- ChangeLog | 6 ++++++ include/sigar.h | 2 -- src/os/aix/aix_sigar.c | 6 ++---- src/os/darwin/darwin_sigar.c | 16 ++++++---------- src/os/hpux/hpux_sigar.c | 11 +---------- src/os/linux/linux_sigar.c | 2 -- src/os/osf1/osf1_sigar.c | 5 +---- src/os/solaris/solaris_sigar.c | 4 +--- src/os/stub/stub_sigar.c | 2 -- src/os/win32/win32_sigar.c | 4 ---- 10 files changed, 17 insertions(+), 41 deletions(-) diff --git a/ChangeLog b/ChangeLog index 399e2c79..e607fccb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2006-03-03 Doug MacEachern + + * Removed proc_mem.vsize (same as proc_mem.size) + + * Removed proc_mem.rss (same as proc_mem.resident) + 2006-03-01 Doug MacEachern * 1.1.28 released diff --git a/include/sigar.h b/include/sigar.h index be6b9ca4..98847012 100644 --- a/include/sigar.h +++ b/include/sigar.h @@ -205,10 +205,8 @@ SIGAR_DECLARE(int) sigar_proc_stat_get(sigar_t *sigar, typedef struct { sigar_uint64_t size, - vsize, resident, share, - rss, minor_faults, major_faults, page_faults; diff --git a/src/os/aix/aix_sigar.c b/src/os/aix/aix_sigar.c index 3f11f3f4..0c0470db 100644 --- a/src/os/aix/aix_sigar.c +++ b/src/os/aix/aix_sigar.c @@ -1082,11 +1082,9 @@ int sigar_proc_mem_get(sigar_t *sigar, sigar_pid_t pid, return status; } - procmem->size = PAGESHIFT(pinfo->pi_size); - procmem->vsize = PAGESHIFT(pinfo->pi_dvm); + procmem->size = PAGESHIFT(pinfo->pi_size); /* XXX fold in pi_dvm ? */ procmem->share = PAGESHIFT(pinfo->pi_sdsize); - procmem->rss = PAGESHIFT(pinfo->pi_drss + pinfo->pi_trss); - procmem->resident = procmem->rss; + procmem->resident = PAGESHIFT(pinfo->pi_drss + pinfo->pi_trss); procmem->minor_faults = pinfo->pi_minflt; procmem->major_faults = pinfo->pi_majflt; diff --git a/src/os/darwin/darwin_sigar.c b/src/os/darwin/darwin_sigar.c index 8199ba47..166d9e32 100644 --- a/src/os/darwin/darwin_sigar.c +++ b/src/os/darwin/darwin_sigar.c @@ -758,7 +758,7 @@ int sigar_proc_mem_get(sigar_t *sigar, sigar_pid_t pid, task_basic_info_data_t info; task_events_info_data_t events; mach_msg_type_number_t count; - vm_size_t vsize, resident, private, vprivate, shared; + vm_size_t vsize, private, vprivate, shared; shared_table table; vm_address_t address = 0; int i, split = 0; @@ -776,7 +776,6 @@ int sigar_proc_mem_get(sigar_t *sigar, sigar_pid_t pid, } vsize = info.virtual_size; - resident = info.resident_size; count = TASK_EVENTS_INFO_COUNT; status = task_info(task, TASK_EVENTS_INFO, (task_info_t)&events, &count); @@ -879,11 +878,9 @@ int sigar_proc_mem_get(sigar_t *sigar, sigar_pid_t pid, mach_port_deallocate(self, task); } - procmem->size = vprivate; - procmem->rss = private; - procmem->share = shared; - procmem->vsize = vsize; - procmem->resident = resident; + procmem->size = info.virtual_size; + procmem->resident = info.resident_size; + procmem->share = shared; return SIGAR_OK; #else @@ -894,11 +891,10 @@ int sigar_proc_mem_get(sigar_t *sigar, sigar_pid_t pid, return status; } - procmem->size = procmem->vsize = + procmem->size = (pinfo->KI_TSZ + pinfo->KI_DSZ + pinfo->KI_SSZ) * sigar->pagesize; - procmem->resident = procmem->rss = - pinfo->KI_RSS * sigar->pagesize; + procmem->resident = pinfo->KI_RSS * sigar->pagesize; procmem->share = SIGAR_FIELD_NOTIMPL; diff --git a/src/os/hpux/hpux_sigar.c b/src/os/hpux/hpux_sigar.c index 526de7ae..8719857c 100644 --- a/src/os/hpux/hpux_sigar.c +++ b/src/os/hpux/hpux_sigar.c @@ -262,16 +262,7 @@ int sigar_proc_mem_get(sigar_t *sigar, sigar_pid_t pid, procmem->size *= pagesize; - procmem->vsize = - pinfo->pst_vtsize + /* text */ - pinfo->pst_vdsize + /* data */ - pinfo->pst_vssize; /* stack */ - - procmem->vsize *= pagesize; - - procmem->rss = pinfo->pst_rssize * pagesize; - - procmem->resident = procmem->rss; + procmem->resident = pinfo->pst_rssize * pagesize; procmem->share = pinfo->pst_shmsize * pagesize; diff --git a/src/os/linux/linux_sigar.c b/src/os/linux/linux_sigar.c index 5b64f6f2..22aeb1d8 100644 --- a/src/os/linux/linux_sigar.c +++ b/src/os/linux/linux_sigar.c @@ -733,8 +733,6 @@ int sigar_proc_mem_get(sigar_t *sigar, sigar_pid_t pid, int status = proc_stat_read(sigar, pid); linux_proc_stat_t *pstat = &sigar->last_proc_stat; - procmem->vsize = pstat->vsize; - procmem->rss = pstat->rss; procmem->minor_faults = pstat->minor_faults; procmem->major_faults = pstat->major_faults; procmem->page_faults = diff --git a/src/os/osf1/osf1_sigar.c b/src/os/osf1/osf1_sigar.c index b2d010bf..8ab8ddfa 100644 --- a/src/os/osf1/osf1_sigar.c +++ b/src/os/osf1/osf1_sigar.c @@ -214,8 +214,7 @@ int sigar_proc_mem_get(sigar_t *sigar, sigar_pid_t pid, } procmem->resident = taskinfo.resident_size; - procmem->rss = taskinfo.resident_size; - procmem->vsize = taskinfo.virtual_size; + procmem->size = taskinfo.virtual_size; status = table(TBL_UAREA, pid, &s_user, 1, sizeof(s_user)); @@ -225,8 +224,6 @@ int sigar_proc_mem_get(sigar_t *sigar, sigar_pid_t pid, } procmem->share = s_user.u_ru.ru_ixrss; - /*XXX*/ - procmem->size = 1; /* 1 == let ant test pass for now */ procmem->page_faults = SIGAR_FIELD_NOTIMPL; procmem->minor_faults = SIGAR_FIELD_NOTIMPL; diff --git a/src/os/solaris/solaris_sigar.c b/src/os/solaris/solaris_sigar.c index 95f5ab4a..9bbd089f 100644 --- a/src/os/solaris/solaris_sigar.c +++ b/src/os/solaris/solaris_sigar.c @@ -536,9 +536,7 @@ int sigar_proc_mem_get(sigar_t *sigar, sigar_pid_t pid, } procmem->size = pinfo->pr_size << 10; - procmem->rss = pinfo->pr_rssize << 10; - procmem->resident = procmem->rss; - procmem->vsize = SIGAR_FIELD_NOTIMPL; + procmem->resident = pinfo->pr_rssize << 10; procmem->share = SIGAR_FIELD_NOTIMPL; if (sigar_proc_usage_get(sigar, &usage, pid) == SIGAR_OK) { diff --git a/src/os/stub/stub_sigar.c b/src/os/stub/stub_sigar.c index 6dee8a61..cc80a59c 100644 --- a/src/os/stub/stub_sigar.c +++ b/src/os/stub/stub_sigar.c @@ -97,9 +97,7 @@ int sigar_proc_mem_get(sigar_t *sigar, sigar_pid_t pid, sigar_proc_mem_t *procmem) { procmem->size = -1; - procmem->vsize = -1; procmem->share = -1; - procmem->rss = -1; procmem->resident = -1; procmem->page_faults = -1; procmem->minor_faults = -1; diff --git a/src/os/win32/win32_sigar.c b/src/os/win32/win32_sigar.c index b1285a51..a5e58d78 100644 --- a/src/os/win32/win32_sigar.c +++ b/src/os/win32/win32_sigar.c @@ -850,10 +850,6 @@ SIGAR_DECLARE(int) sigar_proc_mem_get(sigar_t *sigar, sigar_pid_t pid, procmem->minor_faults = SIGAR_FIELD_NOTIMPL; procmem->major_faults = SIGAR_FIELD_NOTIMPL; - /* deprecated */ - procmem->vsize = pinfo->size; - procmem->rss = pinfo->resident; - return SIGAR_OK; }