Mercurial > archived > louis > perso > liblxcstats
view probes/tests/memory.c @ 10:3a1977ecccc7
Add a configure script and fix various things
author | Louis Opter <kalessin@kalessin.fr> |
---|---|
date | Thu, 06 Jan 2011 00:59:06 +0100 |
parents | 6f2e13f5fcfd |
children |
line wrap: on
line source
#include <sys/types.h> #include <err.h> #include <stdlib.h> #include <stdio.h> #include "lxcstats.h" #include "_lxcstats.h" #include "probes/probes.h" int main(void) { lxcst_handle *hdl; struct lxcst *c; hdl = lxcst_open(); if (!hdl) err(EXIT_FAILURE, "lxcst_open failed"); c = _lxcst_container_new(hdl, "."); if (!c) err(EXIT_FAILURE, "cant create container"); if (_lxcst_probe_memory(c)) err(EXIT_FAILURE, "probe memory failed"); printf("used %ju\nmapped %ju\ncached %ju\nswapped %ju\n", c->memory.used, c->memory.mapped, c->memory.cached, c->memory.swapped); _lxcst_container_delete(c); lxcst_close(hdl); return (EXIT_SUCCESS); }