From: Pierre-Yves Ritschard Date: Thu, 16 Jan 2014 07:06:25 +0000 (+0100) Subject: keep plugin instance for first cpu X-Git-Tag: collectd-5.5.0~316^2~5 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=06d7fbe8bb299e76cac532378e7b1999495979dc;p=collectd.git keep plugin instance for first cpu --- diff --git a/src/cpu.c b/src/cpu.c index 3882c6fd..1d7322c4 100644 --- a/src/cpu.c +++ b/src/cpu.c @@ -315,7 +315,7 @@ static void submit_value (int cpu_num, int cpu_state, const char *type, value_t sstrncpy (vl.type_instance, cpu_state_names[cpu_state], sizeof (vl.type_instance)); - if (cpu_num > 0) { + if (cpu_num >= 0) { ssnprintf (vl.plugin_instance, sizeof (vl.plugin_instance), "%i", cpu_num); } @@ -363,7 +363,6 @@ static void submit (int cpu_num, derive_t *derives) gauge_t percent; if (!report_percent && report_by_cpu) { - for (i = 1; i < CPU_SUBMIT_ACTIVE; i++) { if (derives[i] == -1)