X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fmic.c;h=3e31889fe83f560d89a09ce20df0d26c55d95dc6;hb=f8e1e81d433c5b4e06792c2617abf0e6ec9e76d9;hp=49ff0dbf3d8d9d2d3d6b6c39eaa9f3ec835009d0;hpb=fc25f490984524798f044260f40793d1e002a3a5;p=collectd.git diff --git a/src/mic.c b/src/mic.c index 49ff0dbf..3e31889f 100644 --- a/src/mic.c +++ b/src/mic.c @@ -20,6 +20,7 @@ **/ #include "collectd.h" + #include "plugin.h" #include "common.h" #include "utils_ignorelist.h" @@ -53,8 +54,8 @@ static const char *config_keys[] = "Temperature", "IgnoreSelectedTemperature", "ShowPower", - "PowerSensor", - "IgnorePowerSelected" + "Power", + "IgnoreSelectedPower" }; static int config_keys_num = STATIC_ARRAY_SIZE (config_keys); @@ -131,11 +132,11 @@ static int mic_config (const char *key, const char *value) { invert = 0; ignorelist_set_invert(temp_ignore,invert); } - else if (strcasecmp("PowerSensor",key) == 0) + else if (strcasecmp("Power",key) == 0) { ignorelist_add(power_ignore,value); } - else if (strcasecmp("IgnorePowerSelected",key) == 0) + else if (strcasecmp("IgnoreSelectedPower",key) == 0) { int invert = 1; if (IS_TRUE(value)) @@ -213,9 +214,8 @@ static void mic_submit_temp(int micnumber, const char *type, gauge_t val) static int mic_read_temps(int mic) { size_t num_therms = STATIC_ARRAY_SIZE(therm_ids); - size_t j; - for (j = 0; j < num_therms; j++) { + for (size_t j = 0; j < num_therms; j++) { U32 status; U32 temp_buffer; U32 buffer_size = (U32)sizeof(temp_buffer); @@ -286,8 +286,7 @@ static int mic_read_cpu(int mic) } if (show_cpu_cores) { - int j; - for (j = 0; j < core_util.core; j++) { + for (int j = 0; j < core_util.core; j++) { mic_submit_cpu(mic, "user", j, core_jiffs[j].user); mic_submit_cpu(mic, "sys", j, core_jiffs[j].sys); mic_submit_cpu(mic, "nice", j, core_jiffs[j].nice); @@ -356,12 +355,11 @@ static int mic_read_power(int mic) static int mic_read (void) { - int i; U32 ret; int error; error=0; - for (i=0;i