From: Florian Forster Date: Fri, 19 Jan 2024 20:05:35 +0000 (+0100) Subject: cpu plugin: Add "ReportUsage" to `config_keys`. X-Git-Tag: 6.0.0-rc0~5^2~5 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7ca9e89b78030e25914408751b410680edda2993;p=thirdparty%2Fcollectd.git cpu plugin: Add "ReportUsage" to `config_keys`. Also sort `config_keys`. --- diff --git a/src/cpu.c b/src/cpu.c index 4c40dd6a8..35bd3c86a 100644 --- a/src/cpu.c +++ b/src/cpu.c @@ -224,9 +224,9 @@ static bool report_guest; static bool subtract_guest = true; static const char *config_keys[] = { - "ReportByCpu", "ReportByState", "ReportNumCpu", - "ReportUtilization", "ValuesPercentage", "ReportGuestState", - "SubtractGuestState", + "ReportByCpu", "ReportByState", "ReportGuestState", + "ReportNumCpu", "ReportUsage", "ReportUtilization", + "ValuesPercentage", "SubtractGuestState", }; static int config_keys_num = STATIC_ARRAY_SIZE(config_keys); @@ -234,17 +234,17 @@ static int cpu_config(char const *key, char const *value) /* {{{ */ { if (strcasecmp(key, "ReportByCpu") == 0) report_by_cpu = IS_TRUE(value); + else if (strcasecmp(key, "ReportByState") == 0) + report_by_state = IS_TRUE(value); + else if (strcasecmp(key, "ReportGuestState") == 0) + report_guest = IS_TRUE(value); + else if (strcasecmp(key, "ReportNumCpu") == 0) + report_num_cpu = IS_TRUE(value); else if (strcasecmp(key, "ReportUsage") == 0) report_usage = IS_TRUE(value); else if (strcasecmp(key, "ReportUtilization") == 0 || strcasecmp(key, "ValuesPercentage") == 0) report_utilization = IS_TRUE(value); - else if (strcasecmp(key, "ReportByState") == 0) - report_by_state = IS_TRUE(value); - else if (strcasecmp(key, "ReportNumCpu") == 0) - report_num_cpu = IS_TRUE(value); - else if (strcasecmp(key, "ReportGuestState") == 0) - report_guest = IS_TRUE(value); else if (strcasecmp(key, "SubtractGuestState") == 0) subtract_guest = IS_TRUE(value); else