changes
[oweals/gnunet.git] / src / sysmon / test_glibtop.c
index 24bfe8230141e7043c6607260caefaec185d02fc..e05a46bd2a18a5333720e838fb0c5c000d3f36e3 100644 (file)
 */
 
 /**
- * @file sysmon/test_glibtop.c
+ * @file sysmon/test_glibtop_process.c
  * @brief a brief test for glibtop
  * @author Matthias Wachs
  */
 
 #include "platform.h"
-
 #include <glibtop.h>
-#include <glibtop/proclist.h>
-#include <glibtop/procstate.h>
-#include <glibtop/procargs.h>
-#include <glib.h>
 
 static int ret;
 
-static void print_pids(guint64 which, guint64 arg)
-{
-    pid_t *pids = NULL;
-    unsigned i;
-    glibtop_proclist proc_list;
-    glibtop_proc_args proc_args;
-    char *argss;
-    char **argv;
-    int argc;
-
-    /* get process list */
-    pids = glibtop_get_proclist(&proc_list, which, arg);
-    if (NULL == pids)
-    {
-      fprintf (stderr, "Could not retrieve process list!\n");
-      ret = 1;
-      return;
-    }
-
-    printf("Found %lu processes\n", (unsigned long) proc_list.number);
-    for (i = 0; i < proc_list.number; ++i)
-    {
-        printf("PID %u:\n", pids[i]);
-
-        /* get process args */
-        argss = glibtop_get_proc_args (&proc_args, pids[i], 1024);
-        if (NULL == argss)
-        {
-          fprintf (stderr, "Could not retrieve process args!\n");
-          ret = 1;
-          return;
-        }
-        printf (" argument string: %s\n", argss);
-        g_free (argss);
-    }
-
-    if (NULL != pids)
-    {
-      g_free(pids);
-      pids = NULL;
-    }
-}
-
 /**
  * The main function.
  *
@@ -93,12 +45,9 @@ main (int argc, char *const *argv)
     return 1;
   }
 
-  /* Print all processes */
-  print_pids(GLIBTOP_KERN_PROC_ALL, 0);
-
   glibtop_close();
   return ret;
 }
 
-/* end of test_glibtop.c */
+/* end of test_glibtop_process.c */