Implemented size, vsize, resident and rss.

* procmem.c: Implemented size, vsize, resident and rss.
This commit is contained in:
Drazen Kacar
1999-05-07 20:38:13 +00:00
parent 83bc7b831d
commit 217a1e92c6
2 changed files with 17 additions and 1 deletions

View File

@@ -1,3 +1,7 @@
1999-05-07 Drazen Kacar <dave@srce.hr>
* procmem.c: Implemented size, vsize, resident and rss.
1999-05-06 Drazen Kacar <dave@srce.hr> 1999-05-06 Drazen Kacar <dave@srce.hr>
* siglist.c: Fixed, valid for Solaris 2.6 & 7. * siglist.c: Fixed, valid for Solaris 2.6 & 7.

View File

@@ -24,7 +24,9 @@
#include <glibtop.h> #include <glibtop.h>
#include <glibtop/procmem.h> #include <glibtop/procmem.h>
static const unsigned long _glibtop_sysdeps_proc_mem = 0; static const unsigned long _glibtop_sysdeps_proc_mem =
(1L << GLIBTOP_PROC_MEM_SIZE) + (1L << GLIBTOP_PROC_MEM_VSIZE) +
(1L << GLIBTOP_PROC_MEM_RESIDENT) + (1L << GLIBTOP_PROC_MEM_RSS);
/* Init function. */ /* Init function. */
@@ -40,5 +42,15 @@ void
glibtop_get_proc_mem_s (glibtop *server, glibtop_proc_mem *buf, glibtop_get_proc_mem_s (glibtop *server, glibtop_proc_mem *buf,
pid_t pid) pid_t pid)
{ {
struct psinfo psinfo;
memset (buf, 0, sizeof (glibtop_proc_mem)); memset (buf, 0, sizeof (glibtop_proc_mem));
if(glibtop_get_proc_data_psinfo_s(server, &psinfo, pid))
return;
buf->size = buf->vsize = psinfo.pr_size;
buf->resident = buf->rss = psinfo.pr_rssize;
buf->flags = _glibtop_sysdeps_proc_mem;
} }