From 92d3176303b267cc8d08fe47d2eeff561886cb14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Dejean?= Date: Tue, 2 Aug 2005 04:39:13 +0000 Subject: Added pprint_get_proc_kernel(pid). Fixed prototypes. --- examples/ChangeLog | 10 ++++++++++ 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 + + * 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 * 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 +#include #include #include @@ -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; -- cgit v1.2.1