From d447fc0e1d185b2430be20322ea142a97ba4e2c2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Manuel=20Luis=20Sanmart=C3=ADn=20Rozada?= Date: Wed, 5 Sep 2012 13:24:03 +0200 Subject: [PATCH] Add in swap plugin reserved, in and out values for AIX. Signed-off-by: Florian Forster --- src/swap.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/swap.c b/src/swap.c index c7b634bc..46d3534f 100644 --- a/src/swap.c +++ b/src/swap.c @@ -221,7 +221,7 @@ static void swap_submit_gauge (const char *plugin_instance, /* {{{ */ swap_submit (plugin_instance, "swap", type_instance, v); } /* }}} void swap_submit_gauge */ -#if KERNEL_LINUX +#if KERNEL_LINUX || HAVE_PERFSTAT static void swap_submit_derive (const char *plugin_instance, /* {{{ */ const char *type_instance, derive_t value) { @@ -230,7 +230,9 @@ static void swap_submit_derive (const char *plugin_instance, /* {{{ */ v.derive = value; swap_submit (plugin_instance, "swap_io", type_instance, v); } /* }}} void swap_submit_derive */ +#endif +#if KERNEL_LINUX static int swap_read_separate (void) /* {{{ */ { FILE *fh; @@ -786,8 +788,12 @@ static int swap_read (void) /* {{{ */ sstrerror (errno, errbuf, sizeof (errbuf))); return (-1); } + swap_submit_gauge (NULL, "used", (gauge_t) (pmemory.pgsp_total - pmemory.pgsp_free) * pagesize); swap_submit_gauge (NULL, "free", (gauge_t) pmemory.pgsp_free * pagesize ); + swap_submit_gauge (NULL, "reserved", (gauge_t) pmemory.pgsp_rsvd * pagesize); + swap_submit_derive (NULL, "in", (derive_t) pmemory.pgspins * pagesize); + swap_submit_derive (NULL, "out", (derive_t) pmemory.pgspouts * pagesize); return (0); } /* }}} int swap_read */ -- 2.11.0