From: Vincent Brillault Date: Sat, 18 Apr 2015 08:49:46 +0000 (+0200) Subject: Turbostat: Initialize non existing threads cpu_id X-Git-Tag: collectd-5.5.0~24^2~7 X-Git-Url: https://git.tokkee.org/?p=collectd.git;a=commitdiff_plain;h=39755bc4eaaea9b453ed423253bc7c478fbd95e5 Turbostat: Initialize non existing threads cpu_id --- diff --git a/src/turbostat.c b/src/turbostat.c index 9373b61a..629d7925 100644 --- a/src/turbostat.c +++ b/src/turbostat.c @@ -1258,6 +1258,9 @@ allocate_counters(struct thread_data **threads, struct core_data **cores, struct if (*threads == NULL) goto err; + for (i = 0; i < total_threads; ++i) + (*threads)[i].cpu_id = topology.max_cpu_id + 1; + total_cores = topology.num_cores * topology.num_packages; *cores = calloc(total_cores, sizeof(struct core_data)); if (*cores == NULL)