X-Git-Url: https://git.octo.it/?p=collectd.git;a=blobdiff_plain;f=src%2Fcpusleep.c;h=ee26b0b3d23ef55610a098280476ecf1b6510da9;hp=31bb25d67ed4ba618f0133deac0a082d80c5ec13;hb=48efd3deb4c9139fd060ff3d289896e9031bcc7c;hpb=41288c6a9ed050b41ad47184aa1b53668c3588cc diff --git a/src/cpusleep.c b/src/cpusleep.c index 31bb25d6..ee26b0b3 100644 --- a/src/cpusleep.c +++ b/src/cpusleep.c @@ -28,18 +28,18 @@ * CPU sleep is reported in milliseconds of sleep per second of wall * time. For that, the time difference between BOOT and MONOTONIC clocks * is reported using derive type. -**/ + **/ #include "collectd.h" -#include "common.h" #include "plugin.h" +#include "utils/common/common.h" #include static void cpusleep_submit(derive_t cpu_sleep) { value_list_t vl = VALUE_LIST_INIT; - vl.values = &(value_t) { .derive = cpu_sleep }; + vl.values = &(value_t){.derive = cpu_sleep}; vl.values_len = 1; sstrncpy(vl.plugin, "cpusleep", sizeof(vl.plugin)); sstrncpy(vl.type, "total_time_in_ms", sizeof(vl.type)); @@ -51,12 +51,12 @@ static int cpusleep_read(void) { struct timespec b, m; if (clock_gettime(CLOCK_BOOTTIME, &b) < 0) { ERROR("cpusleep plugin: clock_boottime failed"); - return (-1); + return -1; } if (clock_gettime(CLOCK_MONOTONIC, &m) < 0) { ERROR("cpusleep plugin: clock_monotonic failed"); - return (-1); + return -1; } // to avoid false positives in counter overflow due to reboot, @@ -67,7 +67,7 @@ static int cpusleep_read(void) { cpusleep_submit(sleep); - return (0); + return 0; } void module_register(void) {