X-Git-Url: https://git.octo.it/?p=collectd.git;a=blobdiff_plain;f=src%2Flpar.c;h=1c8685ed2aeb69840a87571b488cee2a96b7bcbf;hp=77e6d087daaa879df00be7a5b84411ca568ffae7;hb=54619dc85fd308b21ed09a0271e5c7383c7921b9;hpb=f25d207699e013bb47c0083fe56b8358a98f6f4d diff --git a/src/lpar.c b/src/lpar.c index 77e6d087..1c8685ed 100644 --- a/src/lpar.c +++ b/src/lpar.c @@ -21,8 +21,8 @@ #include "collectd.h" -#include "common.h" #include "plugin.h" +#include "utils/common/common.h" #include #include @@ -52,14 +52,14 @@ static perfstat_partition_total_t lparstats_old; static int lpar_config(const char *key, const char *value) { if (strcasecmp("CpuPoolStats", key) == 0) { if (IS_TRUE(value)) - pool_stats = 1; + pool_stats = true; else - pool_stats = 0; + pool_stats = false; } else if (strcasecmp("ReportBySerial", key) == 0) { if (IS_TRUE(value)) - report_by_serial = 1; + report_by_serial = true; else - report_by_serial = 0; + report_by_serial = false; } else { return -1; } @@ -84,14 +84,14 @@ static int lpar_init(void) { #if PERFSTAT_SUPPORTS_DONATION if (!lparstats_old.type.b.shared_enabled && lparstats_old.type.b.donate_enabled) { - donate_flag = 1; + donate_flag = true; } #endif if (pool_stats && !lparstats_old.type.b.pool_util_authority) { WARNING("lpar plugin: This partition does not have pool authority. " "Disabling CPU pool statistics collection."); - pool_stats = 0; + pool_stats = false; } return 0; @@ -224,10 +224,10 @@ static int lpar_read(void) { if (pool_busy_cpus < 0.0) pool_busy_cpus = 0.0; - snprintf(typinst, sizeof(typinst), "pool-%X-busy", lparstats.pool_id); + ssnprintf(typinst, sizeof(typinst), "pool-%X-busy", lparstats.pool_id); lpar_submit(typinst, pool_busy_cpus); - snprintf(typinst, sizeof(typinst), "pool-%X-idle", lparstats.pool_id); + ssnprintf(typinst, sizeof(typinst), "pool-%X-idle", lparstats.pool_id); lpar_submit(typinst, pool_idle_cpus); }