diff options
author | Benoît Dejean <bdejean@src.gnome.org> | 2006-02-27 08:14:12 +0000 |
---|---|---|
committer | Benoît Dejean <bdejean@src.gnome.org> | 2006-02-27 08:14:12 +0000 |
commit | e71023b362be5640367f3048fa1c1f4dcfc1cc46 (patch) | |
tree | 1f79a22260959763f2a021d6bc7eaf8f0bf1df38 /examples/pprint.c | |
parent | 89f9c1d43a899f7419b62c06359ed93742ae0143 (diff) | |
download | libgtop-e71023b362be5640367f3048fa1c1f4dcfc1cc46.tar.gz |
Added proc_mem example.
* pprint.c: (pprint_get_proc_mem), (main):
Added proc_mem example.
Diffstat (limited to 'examples/pprint.c')
-rw-r--r-- | examples/pprint.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/examples/pprint.c b/examples/pprint.c index 31dfdb0a..9a2f04c8 100644 --- a/examples/pprint.c +++ b/examples/pprint.c @@ -268,6 +268,24 @@ static void pprint_get_proc_kernel(pid_t pid) } +static void pprint_get_proc_mem(pid_t pid) +{ + glibtop_proc_mem buf; + + glibtop_get_proc_mem(&buf, pid); + + HEADER_PPRINT(glibtop_get_proc_mem); + PPRINT(flags, "%#llx"); + PPRINT(size, "%llu"); + PPRINT(vsize, "%llu"); + PPRINT(resident, "%llu"); + PPRINT(share, "%llu"); + PPRINT(rss, "%llu"); + PPRINT(rss_rlim, "%llu"); + FOOTER_PPRINT(); +} + + int main() { @@ -298,6 +316,7 @@ int main() pprint_get_uptime(); pprint_get_proc_kernel(getpid()); + pprint_get_proc_mem(getpid()); glibtop_close(); |