X-Git-Url: https://git.octo.it/?p=collectd.git;a=blobdiff_plain;f=src%2Fhugepages.c;h=e066300beb799460f0b12b0f991740ef62983452;hp=29a7f9e0ace362d7f04085676053008f1e5845ed;hb=48efd3deb4c9139fd060ff3d289896e9031bcc7c;hpb=ac6580fd886d45a66506fe710a6fea0f48368dcb diff --git a/src/hugepages.c b/src/hugepages.c index 29a7f9e0..e066300b 100644 --- a/src/hugepages.c +++ b/src/hugepages.c @@ -30,17 +30,17 @@ #include "collectd.h" -#include "common.h" /* auxiliary functions */ -#include "plugin.h" /* plugin_register_*, plugin_dispatch_values */ +#include "plugin.h" /* plugin_register_*, plugin_dispatch_values */ +#include "utils/common/common.h" /* auxiliary functions */ static const char g_plugin_name[] = "hugepages"; -static _Bool g_flag_rpt_numa = 1; -static _Bool g_flag_rpt_mm = 1; +static bool g_flag_rpt_numa = true; +static bool g_flag_rpt_mm = true; -static _Bool g_values_pages = 1; -static _Bool g_values_bytes = 0; -static _Bool g_values_percent = 0; +static bool g_values_pages = true; +static bool g_values_bytes; +static bool g_values_percent; #define HP_HAVE_NR 0x01 #define HP_HAVE_SURPLUS 0x02 @@ -102,20 +102,20 @@ static void submit_hp(const struct entry_info *info) { if (g_values_pages) { sstrncpy(vl.type, "vmpage_number", sizeof(vl.type)); - plugin_dispatch_multivalue(&vl, /* store_percentage = */ 0, DS_TYPE_GAUGE, - "free", free, "used", used, NULL); + plugin_dispatch_multivalue(&vl, /* store_percentage = */ false, + DS_TYPE_GAUGE, "free", free, "used", used, NULL); } if (g_values_bytes) { gauge_t page_size = (gauge_t)(1024 * info->page_size_kb); sstrncpy(vl.type, "memory", sizeof(vl.type)); - plugin_dispatch_multivalue(&vl, /* store_percentage = */ 0, DS_TYPE_GAUGE, - "free", free * page_size, "used", + plugin_dispatch_multivalue(&vl, /* store_percentage = */ false, + DS_TYPE_GAUGE, "free", free * page_size, "used", used * page_size, NULL); } if (g_values_percent) { sstrncpy(vl.type, "percent", sizeof(vl.type)); - plugin_dispatch_multivalue(&vl, /* store_percentage = */ 1, DS_TYPE_GAUGE, - "free", free, "used", used, NULL); + plugin_dispatch_multivalue(&vl, /* store_percentage = */ true, + DS_TYPE_GAUGE, "free", free, "used", used, NULL); } }