summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 39755bc)
raw | patch | inline | side by side (parent: 39755bc)
author | Vincent Brillault <git@lerya.net> | |
Sat, 18 Apr 2015 08:58:20 +0000 (10:58 +0200) | ||
committer | Vincent Brillault <git@lerya.net> | |
Sat, 18 Apr 2015 09:06:26 +0000 (11:06 +0200) |
There is no "thread_id" and the value we compute is the direct number.
It can only be '1' or '2' and do not start at 0 like other values.
It can only be '1' or '2' and do not start at 0 like other values.
src/turbostat.c | patch | blob | history |
diff --git a/src/turbostat.c b/src/turbostat.c
index 629d792547a315abecb0977b2d332c706568017a..5470e6e4d9c462458e6c9d41fef6f8782fcc34ef 100644 (file)
--- a/src/turbostat.c
+++ b/src/turbostat.c
{
unsigned int i;
int ret;
- unsigned int max_package_id, max_core_id, max_thread_id;
- max_package_id = max_core_id = max_thread_id = 0;
+ unsigned int max_package_id, max_core_id, max_threads;
+ max_package_id = max_core_id = max_threads = 0;
/* Clean topology */
free(topology.cpus);
goto err;
else
num_threads = (unsigned int) ret;
- if (num_threads > max_thread_id)
- max_thread_id = num_threads;
+ if (num_threads > max_threads)
+ max_threads = num_threads;
ret = parse_int_file("/sys/devices/system/cpu/cpu%d/topology/thread_siblings_list", i);
if (ret < 0)
goto err;
/* Num is max + 1 (need to count 0) */
topology.num_packages = max_package_id + 1;
topology.num_cores = max_core_id + 1;
- topology.num_threads = max_thread_id + 1;
+ topology.num_threads = max_threads;
return 0;
err: