From 39f51b526f3801ff1dd212ae431f0b22193ddb06 Mon Sep 17 00:00:00 2001 From: Marek Becka Date: Tue, 9 Jun 2015 17:13:29 -0400 Subject: [PATCH] vmem plugin: fix types for nr_dirtied and nr_written --- src/vmem.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/vmem.c b/src/vmem.c index 56997bf1..b8febcec 100644 --- a/src/vmem.c +++ b/src/vmem.c @@ -150,8 +150,16 @@ static int vmem_read (void) if (strncmp ("nr_", key, strlen ("nr_")) == 0) { char *inst = key + strlen ("nr_"); - value_t value = { .gauge = gauge }; - submit_one (NULL, "vmpage_number", inst, value); + if (strcmp(inst, "dirtied") == 0 || strcmp(inst, "written") == 0) + { + value_t value = { .derive = counter }; + submit_one (NULL, "vmpage_action", inst, value); + } + else + { + value_t value = { .gauge = gauge }; + submit_one (NULL, "vmpage_number", inst, value); + } } /* -- 2.30.2