summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 259df74)
raw | patch | inline | side by side (parent: 259df74)
author | Vincent Brillault <git@lerya.net> | |
Sat, 20 Sep 2014 17:45:36 +0000 (19:45 +0200) | ||
committer | Vincent Brillault <git@lerya.net> | |
Sat, 28 Feb 2015 06:35:41 +0000 (07:35 +0100) |
src/turbostat.c | patch | blob | history |
diff --git a/src/turbostat.c b/src/turbostat.c
index 328d129d0fb6eab4e3eb1536fd7d1a3e4baff56b..06f15cd907a35c7eaf1458ed510a4fba6365888b 100644 (file)
--- a/src/turbostat.c
+++ b/src/turbostat.c
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);
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);
}