aboutsummaryrefslogtreecommitdiff
path: root/src/sysmon
diff options
context:
space:
mode:
authorMatthias Wachs <wachs@net.in.tum.de>2012-11-28 14:33:09 +0000
committerMatthias Wachs <wachs@net.in.tum.de>2012-11-28 14:33:09 +0000
commit127cb0ece2351d1022039cc0423b077c631bf0c5 (patch)
treecc1ab1e9f5315af91739ac23780494ccba6aab00 /src/sysmon
parenta9e642e2aebea492ab5bd56cebae6cc22832482b (diff)
downloadgnunet-127cb0ece2351d1022039cc0423b077c631bf0c5.tar.gz
gnunet-127cb0ece2351d1022039cc0423b077c631bf0c5.zip
changes
Diffstat (limited to 'src/sysmon')
-rw-r--r--src/sysmon/test_glibtop.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/sysmon/test_glibtop.c b/src/sysmon/test_glibtop.c
index 24bfe8230..b5deb8c53 100644
--- a/src/sysmon/test_glibtop.c
+++ b/src/sysmon/test_glibtop.c
@@ -30,6 +30,7 @@
30#include <glibtop/proclist.h> 30#include <glibtop/proclist.h>
31#include <glibtop/procstate.h> 31#include <glibtop/procstate.h>
32#include <glibtop/procargs.h> 32#include <glibtop/procargs.h>
33#include <glibtop/procmem.h>
33#include <glib.h> 34#include <glib.h>
34 35
35static int ret; 36static int ret;
@@ -40,9 +41,8 @@ static void print_pids(guint64 which, guint64 arg)
40 unsigned i; 41 unsigned i;
41 glibtop_proclist proc_list; 42 glibtop_proclist proc_list;
42 glibtop_proc_args proc_args; 43 glibtop_proc_args proc_args;
44 glibtop_proc_mem proc_mem;
43 char *argss; 45 char *argss;
44 char **argv;
45 int argc;
46 46
47 /* get process list */ 47 /* get process list */
48 pids = glibtop_get_proclist(&proc_list, which, arg); 48 pids = glibtop_get_proclist(&proc_list, which, arg);
@@ -66,8 +66,15 @@ static void print_pids(guint64 which, guint64 arg)
66 ret = 1; 66 ret = 1;
67 return; 67 return;
68 } 68 }
69 printf (" argument string: %s\n", argss); 69 printf ("\targument string: %s\n", argss);
70 g_free (argss); 70 g_free (argss);
71
72 glibtop_get_proc_mem (&proc_mem, pids[i]);
73 printf ("\t%-50s: %lu\n", "total # of pages of memory", proc_mem.size);
74 printf ("\t%-50s: %lu\n", "number of pages of virtual memory",proc_mem.vsize);
75 printf ("\t%-50s: %lu\n", "number of resident set", proc_mem.resident);
76 printf ("\t%-50s: %lu\n", "number of pages of shared (mmap'd) memory", proc_mem.share);
77 printf ("\t%-50s: %lu\n", "resident set size", proc_mem.rss);
71 } 78 }
72 79
73 if (NULL != pids) 80 if (NULL != pids)