21 #include <glog/logging.h> 24 #include <unordered_map> 26 using namespace folly;
33 {
"/sys/devices/system/cpu/cpu0/cache/index0/shared_cpu_list",
"0,17"},
34 {
"/sys/devices/system/cpu/cpu0/cache/index0/type",
"Data"},
35 {
"/sys/devices/system/cpu/cpu0/cache/index1/shared_cpu_list",
"0,17"},
36 {
"/sys/devices/system/cpu/cpu0/cache/index1/type",
"Instruction"},
37 {
"/sys/devices/system/cpu/cpu0/cache/index2/shared_cpu_list",
"0,17"},
38 {
"/sys/devices/system/cpu/cpu0/cache/index2/type",
"Unified"},
39 {
"/sys/devices/system/cpu/cpu0/cache/index3/shared_cpu_list",
"0-8,17-23"},
40 {
"/sys/devices/system/cpu/cpu0/cache/index3/type",
"Unified"},
41 {
"/sys/devices/system/cpu/cpu1/cache/index0/shared_cpu_list",
"1,18"},
42 {
"/sys/devices/system/cpu/cpu1/cache/index0/type",
"Data"},
43 {
"/sys/devices/system/cpu/cpu1/cache/index1/shared_cpu_list",
"1,18"},
44 {
"/sys/devices/system/cpu/cpu1/cache/index1/type",
"Instruction"},
45 {
"/sys/devices/system/cpu/cpu1/cache/index2/shared_cpu_list",
"1,18"},
46 {
"/sys/devices/system/cpu/cpu1/cache/index2/type",
"Unified"},
47 {
"/sys/devices/system/cpu/cpu1/cache/index3/shared_cpu_list",
"0-8,17-23"},
48 {
"/sys/devices/system/cpu/cpu1/cache/index3/type",
"Unified"},
49 {
"/sys/devices/system/cpu/cpu2/cache/index0/shared_cpu_list",
"2,19"},
50 {
"/sys/devices/system/cpu/cpu2/cache/index0/type",
"Data"},
51 {
"/sys/devices/system/cpu/cpu2/cache/index1/shared_cpu_list",
"2,19"},
52 {
"/sys/devices/system/cpu/cpu2/cache/index1/type",
"Instruction"},
53 {
"/sys/devices/system/cpu/cpu2/cache/index2/shared_cpu_list",
"2,19"},
54 {
"/sys/devices/system/cpu/cpu2/cache/index2/type",
"Unified"},
55 {
"/sys/devices/system/cpu/cpu2/cache/index3/shared_cpu_list",
"0-8,17-23"},
56 {
"/sys/devices/system/cpu/cpu2/cache/index3/type",
"Unified"},
57 {
"/sys/devices/system/cpu/cpu3/cache/index0/shared_cpu_list",
"3,20"},
58 {
"/sys/devices/system/cpu/cpu3/cache/index0/type",
"Data"},
59 {
"/sys/devices/system/cpu/cpu3/cache/index1/shared_cpu_list",
"3,20"},
60 {
"/sys/devices/system/cpu/cpu3/cache/index1/type",
"Instruction"},
61 {
"/sys/devices/system/cpu/cpu3/cache/index2/shared_cpu_list",
"3,20"},
62 {
"/sys/devices/system/cpu/cpu3/cache/index2/type",
"Unified"},
63 {
"/sys/devices/system/cpu/cpu3/cache/index3/shared_cpu_list",
"0-8,17-23"},
64 {
"/sys/devices/system/cpu/cpu3/cache/index3/type",
"Unified"},
65 {
"/sys/devices/system/cpu/cpu4/cache/index0/shared_cpu_list",
"4,21"},
66 {
"/sys/devices/system/cpu/cpu4/cache/index0/type",
"Data"},
67 {
"/sys/devices/system/cpu/cpu4/cache/index1/shared_cpu_list",
"4,21"},
68 {
"/sys/devices/system/cpu/cpu4/cache/index1/type",
"Instruction"},
69 {
"/sys/devices/system/cpu/cpu4/cache/index2/shared_cpu_list",
"4,21"},
70 {
"/sys/devices/system/cpu/cpu4/cache/index2/type",
"Unified"},
71 {
"/sys/devices/system/cpu/cpu4/cache/index3/shared_cpu_list",
"0-8,17-23"},
72 {
"/sys/devices/system/cpu/cpu4/cache/index3/type",
"Unified"},
73 {
"/sys/devices/system/cpu/cpu5/cache/index0/shared_cpu_list",
"5-6"},
74 {
"/sys/devices/system/cpu/cpu5/cache/index0/type",
"Data"},
75 {
"/sys/devices/system/cpu/cpu5/cache/index1/shared_cpu_list",
"5-6"},
76 {
"/sys/devices/system/cpu/cpu5/cache/index1/type",
"Instruction"},
77 {
"/sys/devices/system/cpu/cpu5/cache/index2/shared_cpu_list",
"5-6"},
78 {
"/sys/devices/system/cpu/cpu5/cache/index2/type",
"Unified"},
79 {
"/sys/devices/system/cpu/cpu5/cache/index3/shared_cpu_list",
"0-8,17-23"},
80 {
"/sys/devices/system/cpu/cpu5/cache/index3/type",
"Unified"},
81 {
"/sys/devices/system/cpu/cpu6/cache/index0/shared_cpu_list",
"5-6"},
82 {
"/sys/devices/system/cpu/cpu6/cache/index0/type",
"Data"},
83 {
"/sys/devices/system/cpu/cpu6/cache/index1/shared_cpu_list",
"5-6"},
84 {
"/sys/devices/system/cpu/cpu6/cache/index1/type",
"Instruction"},
85 {
"/sys/devices/system/cpu/cpu6/cache/index2/shared_cpu_list",
"5-6"},
86 {
"/sys/devices/system/cpu/cpu6/cache/index2/type",
"Unified"},
87 {
"/sys/devices/system/cpu/cpu6/cache/index3/shared_cpu_list",
"0-8,17-23"},
88 {
"/sys/devices/system/cpu/cpu6/cache/index3/type",
"Unified"},
89 {
"/sys/devices/system/cpu/cpu7/cache/index0/shared_cpu_list",
"7,22"},
90 {
"/sys/devices/system/cpu/cpu7/cache/index0/type",
"Data"},
91 {
"/sys/devices/system/cpu/cpu7/cache/index1/shared_cpu_list",
"7,22"},
92 {
"/sys/devices/system/cpu/cpu7/cache/index1/type",
"Instruction"},
93 {
"/sys/devices/system/cpu/cpu7/cache/index2/shared_cpu_list",
"7,22"},
94 {
"/sys/devices/system/cpu/cpu7/cache/index2/type",
"Unified"},
95 {
"/sys/devices/system/cpu/cpu7/cache/index3/shared_cpu_list",
"0-8,17-23"},
96 {
"/sys/devices/system/cpu/cpu7/cache/index3/type",
"Unified"},
97 {
"/sys/devices/system/cpu/cpu8/cache/index0/shared_cpu_list",
"8,23"},
98 {
"/sys/devices/system/cpu/cpu8/cache/index0/type",
"Data"},
99 {
"/sys/devices/system/cpu/cpu8/cache/index1/shared_cpu_list",
"8,23"},
100 {
"/sys/devices/system/cpu/cpu8/cache/index1/type",
"Instruction"},
101 {
"/sys/devices/system/cpu/cpu8/cache/index2/shared_cpu_list",
"8,23"},
102 {
"/sys/devices/system/cpu/cpu8/cache/index2/type",
"Unified"},
103 {
"/sys/devices/system/cpu/cpu8/cache/index3/shared_cpu_list",
"0-8,17-23"},
104 {
"/sys/devices/system/cpu/cpu8/cache/index3/type",
"Unified"},
105 {
"/sys/devices/system/cpu/cpu9/cache/index0/shared_cpu_list",
"9,24"},
106 {
"/sys/devices/system/cpu/cpu9/cache/index0/type",
"Data"},
107 {
"/sys/devices/system/cpu/cpu9/cache/index1/shared_cpu_list",
"9,24"},
108 {
"/sys/devices/system/cpu/cpu9/cache/index1/type",
"Instruction"},
109 {
"/sys/devices/system/cpu/cpu9/cache/index2/shared_cpu_list",
"9,24"},
110 {
"/sys/devices/system/cpu/cpu9/cache/index2/type",
"Unified"},
111 {
"/sys/devices/system/cpu/cpu9/cache/index3/shared_cpu_list",
"9-16,24-31"},
112 {
"/sys/devices/system/cpu/cpu9/cache/index3/type",
"Unified"},
113 {
"/sys/devices/system/cpu/cpu10/cache/index0/shared_cpu_list",
"10,25"},
114 {
"/sys/devices/system/cpu/cpu10/cache/index0/type",
"Data"},
115 {
"/sys/devices/system/cpu/cpu10/cache/index1/shared_cpu_list",
"10,25"},
116 {
"/sys/devices/system/cpu/cpu10/cache/index1/type",
"Instruction"},
117 {
"/sys/devices/system/cpu/cpu10/cache/index2/shared_cpu_list",
"10,25"},
118 {
"/sys/devices/system/cpu/cpu10/cache/index2/type",
"Unified"},
119 {
"/sys/devices/system/cpu/cpu10/cache/index3/shared_cpu_list",
121 {
"/sys/devices/system/cpu/cpu10/cache/index3/type",
"Unified"},
122 {
"/sys/devices/system/cpu/cpu11/cache/index0/shared_cpu_list",
"11,26"},
123 {
"/sys/devices/system/cpu/cpu11/cache/index0/type",
"Data"},
124 {
"/sys/devices/system/cpu/cpu11/cache/index1/shared_cpu_list",
"11,26"},
125 {
"/sys/devices/system/cpu/cpu11/cache/index1/type",
"Instruction"},
126 {
"/sys/devices/system/cpu/cpu11/cache/index2/shared_cpu_list",
"11,26"},
127 {
"/sys/devices/system/cpu/cpu11/cache/index2/type",
"Unified"},
128 {
"/sys/devices/system/cpu/cpu11/cache/index3/shared_cpu_list",
130 {
"/sys/devices/system/cpu/cpu11/cache/index3/type",
"Unified"},
131 {
"/sys/devices/system/cpu/cpu12/cache/index0/shared_cpu_list",
"12,27"},
132 {
"/sys/devices/system/cpu/cpu12/cache/index0/type",
"Data"},
133 {
"/sys/devices/system/cpu/cpu12/cache/index1/shared_cpu_list",
"12,27"},
134 {
"/sys/devices/system/cpu/cpu12/cache/index1/type",
"Instruction"},
135 {
"/sys/devices/system/cpu/cpu12/cache/index2/shared_cpu_list",
"12,27"},
136 {
"/sys/devices/system/cpu/cpu12/cache/index2/type",
"Unified"},
137 {
"/sys/devices/system/cpu/cpu12/cache/index3/shared_cpu_list",
139 {
"/sys/devices/system/cpu/cpu12/cache/index3/type",
"Unified"},
140 {
"/sys/devices/system/cpu/cpu13/cache/index0/shared_cpu_list",
"13,28"},
141 {
"/sys/devices/system/cpu/cpu13/cache/index0/type",
"Data"},
142 {
"/sys/devices/system/cpu/cpu13/cache/index1/shared_cpu_list",
"13,28"},
143 {
"/sys/devices/system/cpu/cpu13/cache/index1/type",
"Instruction"},
144 {
"/sys/devices/system/cpu/cpu13/cache/index2/shared_cpu_list",
"13,28"},
145 {
"/sys/devices/system/cpu/cpu13/cache/index2/type",
"Unified"},
146 {
"/sys/devices/system/cpu/cpu13/cache/index3/shared_cpu_list",
148 {
"/sys/devices/system/cpu/cpu13/cache/index3/type",
"Unified"},
149 {
"/sys/devices/system/cpu/cpu14/cache/index0/shared_cpu_list",
"14,29"},
150 {
"/sys/devices/system/cpu/cpu14/cache/index0/type",
"Data"},
151 {
"/sys/devices/system/cpu/cpu14/cache/index1/shared_cpu_list",
"14,29"},
152 {
"/sys/devices/system/cpu/cpu14/cache/index1/type",
"Instruction"},
153 {
"/sys/devices/system/cpu/cpu14/cache/index2/shared_cpu_list",
"14,29"},
154 {
"/sys/devices/system/cpu/cpu14/cache/index2/type",
"Unified"},
155 {
"/sys/devices/system/cpu/cpu14/cache/index3/shared_cpu_list",
157 {
"/sys/devices/system/cpu/cpu14/cache/index3/type",
"Unified"},
158 {
"/sys/devices/system/cpu/cpu15/cache/index0/shared_cpu_list",
"15,30"},
159 {
"/sys/devices/system/cpu/cpu15/cache/index0/type",
"Data"},
160 {
"/sys/devices/system/cpu/cpu15/cache/index1/shared_cpu_list",
"15,30"},
161 {
"/sys/devices/system/cpu/cpu15/cache/index1/type",
"Instruction"},
162 {
"/sys/devices/system/cpu/cpu15/cache/index2/shared_cpu_list",
"15,30"},
163 {
"/sys/devices/system/cpu/cpu15/cache/index2/type",
"Unified"},
164 {
"/sys/devices/system/cpu/cpu15/cache/index3/shared_cpu_list",
166 {
"/sys/devices/system/cpu/cpu15/cache/index3/type",
"Unified"},
167 {
"/sys/devices/system/cpu/cpu16/cache/index0/shared_cpu_list",
"16,31"},
168 {
"/sys/devices/system/cpu/cpu16/cache/index0/type",
"Data"},
169 {
"/sys/devices/system/cpu/cpu16/cache/index1/shared_cpu_list",
"16,31"},
170 {
"/sys/devices/system/cpu/cpu16/cache/index1/type",
"Instruction"},
171 {
"/sys/devices/system/cpu/cpu16/cache/index2/shared_cpu_list",
"16,31"},
172 {
"/sys/devices/system/cpu/cpu16/cache/index2/type",
"Unified"},
173 {
"/sys/devices/system/cpu/cpu16/cache/index3/shared_cpu_list",
175 {
"/sys/devices/system/cpu/cpu16/cache/index3/type",
"Unified"},
176 {
"/sys/devices/system/cpu/cpu17/cache/index0/shared_cpu_list",
"0,17"},
177 {
"/sys/devices/system/cpu/cpu17/cache/index0/type",
"Data"},
178 {
"/sys/devices/system/cpu/cpu17/cache/index1/shared_cpu_list",
"0,17"},
179 {
"/sys/devices/system/cpu/cpu17/cache/index1/type",
"Instruction"},
180 {
"/sys/devices/system/cpu/cpu17/cache/index2/shared_cpu_list",
"0,17"},
181 {
"/sys/devices/system/cpu/cpu17/cache/index2/type",
"Unified"},
182 {
"/sys/devices/system/cpu/cpu17/cache/index3/shared_cpu_list",
"0-8,17-23"},
183 {
"/sys/devices/system/cpu/cpu17/cache/index3/type",
"Unified"},
184 {
"/sys/devices/system/cpu/cpu18/cache/index0/shared_cpu_list",
"1,18"},
185 {
"/sys/devices/system/cpu/cpu18/cache/index0/type",
"Data"},
186 {
"/sys/devices/system/cpu/cpu18/cache/index1/shared_cpu_list",
"1,18"},
187 {
"/sys/devices/system/cpu/cpu18/cache/index1/type",
"Instruction"},
188 {
"/sys/devices/system/cpu/cpu18/cache/index2/shared_cpu_list",
"1,18"},
189 {
"/sys/devices/system/cpu/cpu18/cache/index2/type",
"Unified"},
190 {
"/sys/devices/system/cpu/cpu18/cache/index3/shared_cpu_list",
"0-8,17-23"},
191 {
"/sys/devices/system/cpu/cpu18/cache/index3/type",
"Unified"},
192 {
"/sys/devices/system/cpu/cpu19/cache/index0/shared_cpu_list",
"2,19"},
193 {
"/sys/devices/system/cpu/cpu19/cache/index0/type",
"Data"},
194 {
"/sys/devices/system/cpu/cpu19/cache/index1/shared_cpu_list",
"2,19"},
195 {
"/sys/devices/system/cpu/cpu19/cache/index1/type",
"Instruction"},
196 {
"/sys/devices/system/cpu/cpu19/cache/index2/shared_cpu_list",
"2,19"},
197 {
"/sys/devices/system/cpu/cpu19/cache/index2/type",
"Unified"},
198 {
"/sys/devices/system/cpu/cpu19/cache/index3/shared_cpu_list",
"0-8,17-23"},
199 {
"/sys/devices/system/cpu/cpu19/cache/index3/type",
"Unified"},
200 {
"/sys/devices/system/cpu/cpu20/cache/index0/shared_cpu_list",
"3,20"},
201 {
"/sys/devices/system/cpu/cpu20/cache/index0/type",
"Data"},
202 {
"/sys/devices/system/cpu/cpu20/cache/index1/shared_cpu_list",
"3,20"},
203 {
"/sys/devices/system/cpu/cpu20/cache/index1/type",
"Instruction"},
204 {
"/sys/devices/system/cpu/cpu20/cache/index2/shared_cpu_list",
"3,20"},
205 {
"/sys/devices/system/cpu/cpu20/cache/index2/type",
"Unified"},
206 {
"/sys/devices/system/cpu/cpu20/cache/index3/shared_cpu_list",
"0-8,17-23"},
207 {
"/sys/devices/system/cpu/cpu20/cache/index3/type",
"Unified"},
208 {
"/sys/devices/system/cpu/cpu21/cache/index0/shared_cpu_list",
"4,21"},
209 {
"/sys/devices/system/cpu/cpu21/cache/index0/type",
"Data"},
210 {
"/sys/devices/system/cpu/cpu21/cache/index1/shared_cpu_list",
"4,21"},
211 {
"/sys/devices/system/cpu/cpu21/cache/index1/type",
"Instruction"},
212 {
"/sys/devices/system/cpu/cpu21/cache/index2/shared_cpu_list",
"4,21"},
213 {
"/sys/devices/system/cpu/cpu21/cache/index2/type",
"Unified"},
214 {
"/sys/devices/system/cpu/cpu21/cache/index3/shared_cpu_list",
"0-8,17-23"},
215 {
"/sys/devices/system/cpu/cpu21/cache/index3/type",
"Unified"},
216 {
"/sys/devices/system/cpu/cpu22/cache/index0/shared_cpu_list",
"7,22"},
217 {
"/sys/devices/system/cpu/cpu22/cache/index0/type",
"Data"},
218 {
"/sys/devices/system/cpu/cpu22/cache/index1/shared_cpu_list",
"7,22"},
219 {
"/sys/devices/system/cpu/cpu22/cache/index1/type",
"Instruction"},
220 {
"/sys/devices/system/cpu/cpu22/cache/index2/shared_cpu_list",
"7,22"},
221 {
"/sys/devices/system/cpu/cpu22/cache/index2/type",
"Unified"},
222 {
"/sys/devices/system/cpu/cpu22/cache/index3/shared_cpu_list",
"0-8,17-23"},
223 {
"/sys/devices/system/cpu/cpu22/cache/index3/type",
"Unified"},
224 {
"/sys/devices/system/cpu/cpu23/cache/index0/shared_cpu_list",
"8,23"},
225 {
"/sys/devices/system/cpu/cpu23/cache/index0/type",
"Data"},
226 {
"/sys/devices/system/cpu/cpu23/cache/index1/shared_cpu_list",
"8,23"},
227 {
"/sys/devices/system/cpu/cpu23/cache/index1/type",
"Instruction"},
228 {
"/sys/devices/system/cpu/cpu23/cache/index2/shared_cpu_list",
"8,23"},
229 {
"/sys/devices/system/cpu/cpu23/cache/index2/type",
"Unified"},
230 {
"/sys/devices/system/cpu/cpu23/cache/index3/shared_cpu_list",
"0-8,17-23"},
231 {
"/sys/devices/system/cpu/cpu23/cache/index3/type",
"Unified"},
232 {
"/sys/devices/system/cpu/cpu24/cache/index0/shared_cpu_list",
"9,24"},
233 {
"/sys/devices/system/cpu/cpu24/cache/index0/type",
"Data"},
234 {
"/sys/devices/system/cpu/cpu24/cache/index1/shared_cpu_list",
"9,24"},
235 {
"/sys/devices/system/cpu/cpu24/cache/index1/type",
"Instruction"},
236 {
"/sys/devices/system/cpu/cpu24/cache/index2/shared_cpu_list",
"9,24"},
237 {
"/sys/devices/system/cpu/cpu24/cache/index2/type",
"Unified"},
238 {
"/sys/devices/system/cpu/cpu24/cache/index3/shared_cpu_list",
240 {
"/sys/devices/system/cpu/cpu24/cache/index3/type",
"Unified"},
241 {
"/sys/devices/system/cpu/cpu25/cache/index0/shared_cpu_list",
"10,25"},
242 {
"/sys/devices/system/cpu/cpu25/cache/index0/type",
"Data"},
243 {
"/sys/devices/system/cpu/cpu25/cache/index1/shared_cpu_list",
"10,25"},
244 {
"/sys/devices/system/cpu/cpu25/cache/index1/type",
"Instruction"},
245 {
"/sys/devices/system/cpu/cpu25/cache/index2/shared_cpu_list",
"10,25"},
246 {
"/sys/devices/system/cpu/cpu25/cache/index2/type",
"Unified"},
247 {
"/sys/devices/system/cpu/cpu25/cache/index3/shared_cpu_list",
249 {
"/sys/devices/system/cpu/cpu25/cache/index3/type",
"Unified"},
250 {
"/sys/devices/system/cpu/cpu26/cache/index0/shared_cpu_list",
"11,26"},
251 {
"/sys/devices/system/cpu/cpu26/cache/index0/type",
"Data"},
252 {
"/sys/devices/system/cpu/cpu26/cache/index1/shared_cpu_list",
"11,26"},
253 {
"/sys/devices/system/cpu/cpu26/cache/index1/type",
"Instruction"},
254 {
"/sys/devices/system/cpu/cpu26/cache/index2/shared_cpu_list",
"11,26"},
255 {
"/sys/devices/system/cpu/cpu26/cache/index2/type",
"Unified"},
256 {
"/sys/devices/system/cpu/cpu26/cache/index3/shared_cpu_list",
258 {
"/sys/devices/system/cpu/cpu26/cache/index3/type",
"Unified"},
259 {
"/sys/devices/system/cpu/cpu27/cache/index0/shared_cpu_list",
"12,27"},
260 {
"/sys/devices/system/cpu/cpu27/cache/index0/type",
"Data"},
261 {
"/sys/devices/system/cpu/cpu27/cache/index1/shared_cpu_list",
"12,27"},
262 {
"/sys/devices/system/cpu/cpu27/cache/index1/type",
"Instruction"},
263 {
"/sys/devices/system/cpu/cpu27/cache/index2/shared_cpu_list",
"12,27"},
264 {
"/sys/devices/system/cpu/cpu27/cache/index2/type",
"Unified"},
265 {
"/sys/devices/system/cpu/cpu27/cache/index3/shared_cpu_list",
267 {
"/sys/devices/system/cpu/cpu27/cache/index3/type",
"Unified"},
268 {
"/sys/devices/system/cpu/cpu28/cache/index0/shared_cpu_list",
"13,28"},
269 {
"/sys/devices/system/cpu/cpu28/cache/index0/type",
"Data"},
270 {
"/sys/devices/system/cpu/cpu28/cache/index1/shared_cpu_list",
"13,28"},
271 {
"/sys/devices/system/cpu/cpu28/cache/index1/type",
"Instruction"},
272 {
"/sys/devices/system/cpu/cpu28/cache/index2/shared_cpu_list",
"13,28"},
273 {
"/sys/devices/system/cpu/cpu28/cache/index2/type",
"Unified"},
274 {
"/sys/devices/system/cpu/cpu28/cache/index3/shared_cpu_list",
276 {
"/sys/devices/system/cpu/cpu28/cache/index3/type",
"Unified"},
277 {
"/sys/devices/system/cpu/cpu29/cache/index0/shared_cpu_list",
"14,29"},
278 {
"/sys/devices/system/cpu/cpu29/cache/index0/type",
"Data"},
279 {
"/sys/devices/system/cpu/cpu29/cache/index1/shared_cpu_list",
"14,29"},
280 {
"/sys/devices/system/cpu/cpu29/cache/index1/type",
"Instruction"},
281 {
"/sys/devices/system/cpu/cpu29/cache/index2/shared_cpu_list",
"14,29"},
282 {
"/sys/devices/system/cpu/cpu29/cache/index2/type",
"Unified"},
283 {
"/sys/devices/system/cpu/cpu29/cache/index3/shared_cpu_list",
285 {
"/sys/devices/system/cpu/cpu29/cache/index3/type",
"Unified"},
286 {
"/sys/devices/system/cpu/cpu30/cache/index0/shared_cpu_list",
"15,30"},
287 {
"/sys/devices/system/cpu/cpu30/cache/index0/type",
"Data"},
288 {
"/sys/devices/system/cpu/cpu30/cache/index1/shared_cpu_list",
"15,30"},
289 {
"/sys/devices/system/cpu/cpu30/cache/index1/type",
"Instruction"},
290 {
"/sys/devices/system/cpu/cpu30/cache/index2/shared_cpu_list",
"15,30"},
291 {
"/sys/devices/system/cpu/cpu30/cache/index2/type",
"Unified"},
292 {
"/sys/devices/system/cpu/cpu30/cache/index3/shared_cpu_list",
294 {
"/sys/devices/system/cpu/cpu30/cache/index3/type",
"Unified"},
295 {
"/sys/devices/system/cpu/cpu31/cache/index0/shared_cpu_list",
"16,31"},
296 {
"/sys/devices/system/cpu/cpu31/cache/index0/type",
"Data"},
297 {
"/sys/devices/system/cpu/cpu31/cache/index1/shared_cpu_list",
"16,31"},
298 {
"/sys/devices/system/cpu/cpu31/cache/index1/type",
"Instruction"},
299 {
"/sys/devices/system/cpu/cpu31/cache/index2/shared_cpu_list",
"16,31"},
300 {
"/sys/devices/system/cpu/cpu31/cache/index2/type",
"Unified"},
301 {
"/sys/devices/system/cpu/cpu31/cache/index3/shared_cpu_list",
303 {
"/sys/devices/system/cpu/cpu31/cache/index3/type",
"Unified"}};
309 {0, 2, 4, 6, 8, 10, 11, 12, 14, 16, 18, 20, 22, 24, 26, 28,
310 30, 1, 3, 5, 7, 9, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31}};
314 auto iter = fakeSysfsTree.find(name);
315 return iter == fakeSysfsTree.end() ?
std::string() : iter->second;
319 EXPECT_EQ(expected.numCpus, parsed.numCpus);
320 EXPECT_EQ(expected.numCachesByLevel, parsed.numCachesByLevel);
321 EXPECT_EQ(expected.localityIndexByCpu, parsed.localityIndexByCpu);
324 #if FOLLY_HAVE_LINUX_VDSO 334 TEST(ThreadId, SimpleTls) {
337 &cpu,
nullptr,
nullptr);
342 &again,
nullptr,
nullptr);
347 TEST(ThreadId, SimplePthread) {
359 static FOLLY_TLS
unsigned testingCpu = 0;
361 static int testingGetcpu(
unsigned* cpu,
unsigned* node,
void* ) {
362 if (cpu !=
nullptr) {
365 if (node !=
nullptr) {
373 for (
size_t s = 1;
s < 200; ++
s) {
379 for (
size_t s = 1;
s < 200; ++
s) {
385 std::vector<std::thread>
threads;
386 for (
size_t i = 0;
i < 4; ++
i) {
387 threads.emplace_back([]() {
388 for (
size_t s : {16, 32, 64}) {
389 for (
size_t j = 1; j < 200; ++j) {
397 for (
auto& thread : threads) {
403 #define DECLARE_SPREADER_TAG(tag, locality, func) \ 405 template <typename dummy> \ 410 const CacheLocality& CacheLocality::system<tag>() { \ 411 static auto* inst = new CacheLocality(locality); \ 415 Getcpu::Func AccessSpreader<tag>::pickGetcpuFunc() { \ 418 template struct AccessSpreader<tag>; \ 425 auto numCpus = CacheLocality::system<ManualTag>().numCpus;
427 for (
size_t s = 1;
s < 200; ++
s) {
428 for (
size_t c = 0;
c < 400; ++
c) {
431 testingCpu =
c % numCpus;
434 <<
"numCpus=" << numCpus <<
", s=" <<
s <<
", c=" <<
c;
441 auto a = alloc.
get(0);
442 auto res =
a->allocate(8);
445 res =
a->allocate(8);
449 res =
a->allocate(12);
453 res =
a->allocate(257);
457 std::vector<void*> mems;
458 for (
int i = 0;
i < 10000;
i++) {
459 mems.push_back(
a->allocate(1));
461 for (
auto& mem : mems) {
static CacheLocality uniform(size_t numCpus)
static std::unordered_map< std::string, std::string > fakeSysfsTree
static const CacheLocality nonUniformExampleLocality
This is the expected CacheLocality structure for fakeSysfsTree.
#define EXPECT_EQ(val1, val2)
—— Concurrent Priority Queue Implementation ——
static int getcpu(unsigned *cpu, unsigned *node, void *)
std::vector< std::thread::id > threads
static Func resolveVdsoFunc()
#define EXPECT_TRUE(condition)
static size_t current(size_t numStripes)
#define EXPECT_LT(val1, val2)
Allocator * get(size_t stripe)
TEST(SequencedExecutor, CPUThreadPoolExecutor)
#define DECLARE_SPREADER_TAG(tag, locality, func)