|
Procster
0.1
Procster-ViewProcessesovertheweb
|
Transform a linear process list into a process tree. More...

Functions | |
| void | free_data (gpointer data) |
| void | key_free (void *k) |
| void | val_free (void *v) |
| Merely show hastable iteration. More... | |
| proc_t * | proc_tree (void) |
| Populate a tree of (proc_t) processes. More... | |
| void | proc_htab_free (GHashTable *ht) |
Transform a linear process list into a process tree.
On Ubuntu / Debian:
sudo apt-get install libprocps6 libprocps-dev libglib2.0-dev libjansson4 libjansson-dev
gcc `pkg-config --cflags glib-2.0` foo.c `pkg-config --libs glib-2.0` gcc foo.c `pkg-config --cflags --libs glib-2.0` gcc -o proc proc.c -I/usr/include/glib-2.0 -lprocps `pkg-config --cflags --libs glib-2.0`
Special flags for passing extras to openproc()
less /usr/include/proc/readproc.h Notes on start_time: Ubuntu 18.04: start_time; // stat start time of process – seconds since 1-1-70 Gitlab (2021): start_time;// stat start time of process – seconds since system boot
| void free_data | ( | gpointer | data | ) |
| void key_free | ( | void * | k | ) |
| void proc_htab_free | ( | GHashTable * | ht | ) |
| proc_t* proc_tree | ( | void | ) |
Populate a tree of (proc_t) processes.
Because of intricate linkages of process tree - and not wanting them broken or incomplete - we do not support partial or filtered process trees (although the implementation contains some bulletproofing for this).
References g_slist_free(), main(), par_add_child(), proc_chn_init, PROC_FLAGS_DEFAULT, and ptree_dump().
Referenced by answer_to_connection0(), and proc_list_json2().
| void val_free | ( | void * | v | ) |
Merely show hastable iteration.
Intent is not to free this way as the process nodes are still used within tree structure (Hashtable was only a temporary index to assist in building of the tree).