20
20
"%s/devices/system/cpu/cpu%d/topology/core_siblings_list"
21
21
#define DIE_CPUS_FMT \
22
22
"%s/devices/system/cpu/cpu%d/topology/die_cpus_list"
23
- #define THRD_SIB_FMT \
24
- "%s/devices/system/cpu/cpu%d/topology/thread_siblings_list"
25
- #define THRD_SIB_FMT_NEW \
23
+ #define CORE_CPUS_FMT \
26
24
"%s/devices/system/cpu/cpu%d/topology/core_cpus_list"
25
+ #define CORE_CPUS_FMT_OLD \
26
+ "%s/devices/system/cpu/cpu%d/topology/thread_siblings_list"
27
27
#define NODE_ONLINE_FMT \
28
28
"%s/devices/system/node/online"
29
29
#define NODE_MEMINFO_FMT \
@@ -104,10 +104,10 @@ static int build_cpu_topology(struct cpu_topology *tp, int cpu)
104
104
ret = 0 ;
105
105
106
106
try_threads :
107
- scnprintf (filename , MAXPATHLEN , THRD_SIB_FMT_NEW ,
107
+ scnprintf (filename , MAXPATHLEN , CORE_CPUS_FMT ,
108
108
sysfs__mountpoint (), cpu );
109
109
if (access (filename , F_OK ) == -1 ) {
110
- scnprintf (filename , MAXPATHLEN , THRD_SIB_FMT ,
110
+ scnprintf (filename , MAXPATHLEN , CORE_CPUS_FMT_OLD ,
111
111
sysfs__mountpoint (), cpu );
112
112
}
113
113
fp = fopen (filename , "r" );
@@ -121,13 +121,13 @@ static int build_cpu_topology(struct cpu_topology *tp, int cpu)
121
121
if (p )
122
122
* p = '\0' ;
123
123
124
- for (i = 0 ; i < tp -> thread_sib ; i ++ ) {
125
- if (!strcmp (buf , tp -> thread_siblings [i ]))
124
+ for (i = 0 ; i < tp -> core_cpus_lists ; i ++ ) {
125
+ if (!strcmp (buf , tp -> core_cpus_list [i ]))
126
126
break ;
127
127
}
128
- if (i == tp -> thread_sib ) {
129
- tp -> thread_siblings [i ] = buf ;
130
- tp -> thread_sib ++ ;
128
+ if (i == tp -> core_cpus_lists ) {
129
+ tp -> core_cpus_list [i ] = buf ;
130
+ tp -> core_cpus_lists ++ ;
131
131
buf = NULL ;
132
132
}
133
133
ret = 0 ;
@@ -151,8 +151,8 @@ void cpu_topology__delete(struct cpu_topology *tp)
151
151
for (i = 0 ; i < tp -> die_cpus_lists ; i ++ )
152
152
zfree (& tp -> die_cpus_list [i ]);
153
153
154
- for (i = 0 ; i < tp -> thread_sib ; i ++ )
155
- zfree (& tp -> thread_siblings [i ]);
154
+ for (i = 0 ; i < tp -> core_cpus_lists ; i ++ )
155
+ zfree (& tp -> core_cpus_list [i ]);
156
156
157
157
free (tp );
158
158
}
@@ -215,7 +215,7 @@ struct cpu_topology *cpu_topology__new(void)
215
215
tp -> die_cpus_list = addr ;
216
216
addr += sz ;
217
217
}
218
- tp -> thread_siblings = addr ;
218
+ tp -> core_cpus_list = addr ;
219
219
220
220
for (i = 0 ; i < nr ; i ++ ) {
221
221
if (!cpu_map__has (map , i ))
0 commit comments