From: Vincent Brillault Date: Sat, 20 Sep 2014 17:45:36 +0000 (+0200) Subject: Turbostat: fix topology detection X-Git-Tag: collectd-5.5.0~24^2~39 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=039be94c415888730738b05e668a9ffa45ee61cc;p=collectd.git Turbostat: fix topology detection --- diff --git a/src/turbostat.c b/src/turbostat.c index 328d129d..06f15cd9 100644 --- a/src/turbostat.c +++ b/src/turbostat.c @@ -1249,7 +1249,7 @@ topology_probe() ret = parse_int_file("/sys/devices/system/cpu/cpu%d/topology/core_siblings_list", i); if (ret < 0) goto err; - else if (ret == cpu->core_id) + else if (ret == i) cpu->first_core_in_package = 1; ret = get_threads_on_core(i); @@ -1259,13 +1259,12 @@ topology_probe() num_threads = ret; if (num_threads > max_thread_id) max_thread_id = num_threads; - if (num_threads > 1) { - ret = parse_int_file("/sys/devices/system/cpu/cpu%d/topology/thread_siblings_list", i); - if (ret < 0) - goto err; - else if (ret == num_threads) - cpu->first_thread_in_core = 1; - } + ret = parse_int_file("/sys/devices/system/cpu/cpu%d/topology/thread_siblings_list", i); + if (ret < 0) + goto err; + else if (ret == i) + cpu->first_thread_in_core = 1; + DEBUG("cpu %d pkg %d core %d\n", i, cpu->package_id, cpu->core_id); }