diff options
author | Benoît Dejean <bdejean@src.gnome.org> | 2005-08-02 04:39:13 +0000 |
---|---|---|
committer | Benoît Dejean <bdejean@src.gnome.org> | 2005-08-02 04:39:13 +0000 |
commit | 92d3176303b267cc8d08fe47d2eeff561886cb14 (patch) | |
tree | d3c99edc5929d41f01bec94cbb0a6bfd9025e64d | |
parent | e5c7f87f50af90527ab63c15198e38c7982f41fa (diff) | |
download | libgtop-92d3176303b267cc8d08fe47d2eeff561886cb14.tar.gz |
Added pprint_get_proc_kernel(pid).
Fixed prototypes.
-rw-r--r-- | examples/ChangeLog | 10 | ||||
-rw-r--r-- | examples/pprint.c | 34 |
2 files changed, 37 insertions, 7 deletions
diff --git a/examples/ChangeLog b/examples/ChangeLog index c03798e4..0941da80 100644 --- a/examples/ChangeLog +++ b/examples/ChangeLog @@ -1,3 +1,13 @@ +2005-08-02 Benoît Dejean <TazForEver@dlfp.org> + + * pprint.c: (pprint_get_cpu), (pprint_get_loadavg), + (pprint_get_mem), (pprint_get_msg_limits), (pprint_get_netlist), + (pprint_get_swap), (pprint_get_uptime), (pprint_get_proc_kernel), + (main): + + Added pprint_get_proc_kernel(pid). + Fixed prototypes. + 2005-01-22 Benoît Dejean <TazForEver@dlfp.org> * openfiles.c: (show_open_files): Updated. diff --git a/examples/pprint.c b/examples/pprint.c index 55afa92c..59e55476 100644 --- a/examples/pprint.c +++ b/examples/pprint.c @@ -2,6 +2,7 @@ #include <glibtop/union.h> +#include <unistd.h> #include <stdio.h> #include <stddef.h> @@ -28,7 +29,7 @@ printf(".%u = " FORMAT " }\n", SIZE - 1 , buf.ARRAY[SIZE - 1]); \ -static void pprint_get_cpu() +static void pprint_get_cpu(void) { glibtop_cpu buf; @@ -81,7 +82,7 @@ static void pprint_get_fsusage(const char *mountpoint) -static void pprint_get_loadavg() +static void pprint_get_loadavg(void) { glibtop_loadavg buf; @@ -98,7 +99,7 @@ static void pprint_get_loadavg() -static void pprint_get_mem() +static void pprint_get_mem(void) { glibtop_mem buf; @@ -156,7 +157,7 @@ static void pprint_get_mountlist(gboolean allfs) -static void pprint_get_msg_limits() +static void pprint_get_msg_limits(void) { glibtop_msg_limits buf; @@ -189,7 +190,7 @@ static void pprint_get_netload(const char *iface) } -static void pprint_get_netlist() +static void pprint_get_netlist(void) { glibtop_netlist buf; char **devices; @@ -211,7 +212,7 @@ static void pprint_get_netlist() -static void pprint_get_swap() +static void pprint_get_swap(void) { glibtop_swap buf; @@ -229,7 +230,7 @@ static void pprint_get_swap() -static void pprint_get_uptime() +static void pprint_get_uptime(void) { glibtop_uptime buf; @@ -246,6 +247,23 @@ static void pprint_get_uptime() +static void pprint_get_proc_kernel(pid_t pid) +{ + glibtop_proc_kernel buf; + + glibtop_get_proc_kernel(&buf, pid); + + HEADER_PPRINT(glibtop_get_proc_kernel); + PPRINT(flags, "%#llx"); + PPRINT(k_flags, "%llu"); + PPRINT(min_flt, "%llu"); + PPRINT(maj_flt, "%llu"); + PPRINT(cmin_flt, "%llu"); + PPRINT(cmaj_flt, "%llu"); + FOOTER_PPRINT(); +} + + int main() { @@ -275,6 +293,8 @@ int main() pprint_get_uptime(); + pprint_get_proc_kernel(getpid()); + glibtop_close(); return 0; |