1 // SPDX-License-Identifier: GPL-2.0
3 * Intel dynamic_speed_select -- Enumerate and control features
4 * Copyright (c) 2019 Intel Corporation.
9 static void printcpulist(int str_len
, char *str
, int mask_size
,
12 int i
, first
, curr_index
, index
;
14 if (!CPU_COUNT_S(mask_size
, cpu_mask
)) {
15 snprintf(str
, str_len
, "none");
21 for (i
= 0; i
< get_topo_max_cpus(); ++i
) {
22 if (!CPU_ISSET_S(i
, mask_size
, cpu_mask
))
25 index
= snprintf(&str
[curr_index
],
26 str_len
- curr_index
, ",");
29 index
= snprintf(&str
[curr_index
], str_len
- curr_index
, "%d",
36 static void printcpumask(int str_len
, char *str
, int mask_size
,
39 int i
, max_cpus
= get_topo_max_cpus();
41 int size
, index
, curr_index
;
43 size
= max_cpus
/ (sizeof(unsigned int) * 8);
44 if (max_cpus
% (sizeof(unsigned int) * 8))
47 mask
= calloc(size
, sizeof(unsigned int));
51 for (i
= 0; i
< max_cpus
; ++i
) {
52 int mask_index
, bit_index
;
54 if (!CPU_ISSET_S(i
, mask_size
, cpu_mask
))
57 mask_index
= i
/ (sizeof(unsigned int) * 8);
58 bit_index
= i
% (sizeof(unsigned int) * 8);
59 mask
[mask_index
] |= BIT(bit_index
);
63 for (i
= size
- 1; i
>= 0; --i
) {
64 index
= snprintf(&str
[curr_index
], str_len
- curr_index
, "%08x",
68 strncat(&str
[curr_index
], ",", str_len
- curr_index
);
76 static void format_and_print_txt(FILE *outf
, int level
, char *header
,
80 static char delimiters
[256];
87 strcpy(delimiters
, " ");
89 for (i
= 0; i
< level
- 1; ++i
)
90 j
+= snprintf(&delimiters
[j
], sizeof(delimiters
) - j
,
94 if (header
&& value
) {
95 fprintf(outf
, "%s", delimiters
);
96 fprintf(outf
, "%s:%s\n", header
, value
);
98 fprintf(outf
, "%s", delimiters
);
99 fprintf(outf
, "%s\n", header
);
103 static int last_level
;
104 static void format_and_print(FILE *outf
, int level
, char *header
, char *value
)
107 static char delimiters
[256];
110 if (!out_format_is_json()) {
111 format_and_print_txt(outf
, level
, header
, value
);
119 fprintf(outf
, "\n}\n");
124 for (i
= 0; i
< level
; ++i
)
125 j
+= snprintf(&delimiters
[j
], sizeof(delimiters
) - j
,
128 if (last_level
== level
)
129 fprintf(outf
, ",\n");
132 if (last_level
!= level
)
135 fprintf(outf
, "%s\"%s\": ", delimiters
, header
);
136 fprintf(outf
, "\"%s\"", value
);
138 for (i
= last_level
- 1; i
>= level
; --i
) {
141 for (j
= i
; j
> 0; --j
)
142 k
+= snprintf(&delimiters
[k
],
143 sizeof(delimiters
) - k
,
145 if (i
== level
&& header
)
146 fprintf(outf
, "\n%s},", delimiters
);
148 fprintf(outf
, "\n%s}", delimiters
);
150 if (abs(last_level
- level
) < 3)
153 fprintf(outf
, "%s\"%s\": {", delimiters
,
161 static void print_package_info(int cpu
, FILE *outf
)
165 snprintf(header
, sizeof(header
), "package-%d",
166 get_physical_package_id(cpu
));
167 format_and_print(outf
, 1, header
, NULL
);
168 snprintf(header
, sizeof(header
), "die-%d", get_physical_die_id(cpu
));
169 format_and_print(outf
, 2, header
, NULL
);
170 snprintf(header
, sizeof(header
), "cpu-%d", cpu
);
171 format_and_print(outf
, 3, header
, NULL
);
174 static void _isst_pbf_display_information(int cpu
, FILE *outf
, int level
,
175 struct isst_pbf_info
*pbf_info
,
181 snprintf(header
, sizeof(header
), "speed-select-base-freq");
182 format_and_print(outf
, disp_level
, header
, NULL
);
184 snprintf(header
, sizeof(header
), "high-priority-base-frequency(MHz)");
185 snprintf(value
, sizeof(value
), "%d",
186 pbf_info
->p1_high
* DISP_FREQ_MULTIPLIER
);
187 format_and_print(outf
, disp_level
+ 1, header
, value
);
189 snprintf(header
, sizeof(header
), "high-priority-cpu-mask");
190 printcpumask(sizeof(value
), value
, pbf_info
->core_cpumask_size
,
191 pbf_info
->core_cpumask
);
192 format_and_print(outf
, disp_level
+ 1, header
, value
);
194 snprintf(header
, sizeof(header
), "high-priority-cpu-list");
195 printcpulist(sizeof(value
), value
,
196 pbf_info
->core_cpumask_size
,
197 pbf_info
->core_cpumask
);
198 format_and_print(outf
, disp_level
+ 1, header
, value
);
200 snprintf(header
, sizeof(header
), "low-priority-base-frequency(MHz)");
201 snprintf(value
, sizeof(value
), "%d",
202 pbf_info
->p1_low
* DISP_FREQ_MULTIPLIER
);
203 format_and_print(outf
, disp_level
+ 1, header
, value
);
205 if (is_clx_n_platform())
208 snprintf(header
, sizeof(header
), "tjunction-temperature(C)");
209 snprintf(value
, sizeof(value
), "%d", pbf_info
->t_prochot
);
210 format_and_print(outf
, disp_level
+ 1, header
, value
);
212 snprintf(header
, sizeof(header
), "thermal-design-power(W)");
213 snprintf(value
, sizeof(value
), "%d", pbf_info
->tdp
);
214 format_and_print(outf
, disp_level
+ 1, header
, value
);
217 static void _isst_fact_display_information(int cpu
, FILE *outf
, int level
,
218 int fact_bucket
, int fact_avx
,
219 struct isst_fact_info
*fact_info
,
222 struct isst_fact_bucket_info
*bucket_info
= fact_info
->bucket_info
;
227 snprintf(header
, sizeof(header
), "speed-select-turbo-freq");
228 format_and_print(outf
, base_level
, header
, NULL
);
229 for (j
= 0; j
< ISST_FACT_MAX_BUCKETS
; ++j
) {
230 if (fact_bucket
!= 0xff && fact_bucket
!= j
)
233 if (!bucket_info
[j
].high_priority_cores_count
)
236 snprintf(header
, sizeof(header
), "bucket-%d", j
);
237 format_and_print(outf
, base_level
+ 1, header
, NULL
);
239 snprintf(header
, sizeof(header
), "high-priority-cores-count");
240 snprintf(value
, sizeof(value
), "%d",
241 bucket_info
[j
].high_priority_cores_count
);
242 format_and_print(outf
, base_level
+ 2, header
, value
);
244 if (fact_avx
& 0x01) {
245 snprintf(header
, sizeof(header
),
246 "high-priority-max-frequency(MHz)");
247 snprintf(value
, sizeof(value
), "%d",
248 bucket_info
[j
].sse_trl
* DISP_FREQ_MULTIPLIER
);
249 format_and_print(outf
, base_level
+ 2, header
, value
);
252 if (fact_avx
& 0x02) {
253 snprintf(header
, sizeof(header
),
254 "high-priority-max-avx2-frequency(MHz)");
255 snprintf(value
, sizeof(value
), "%d",
256 bucket_info
[j
].avx_trl
* DISP_FREQ_MULTIPLIER
);
257 format_and_print(outf
, base_level
+ 2, header
, value
);
260 if (fact_avx
& 0x04) {
261 snprintf(header
, sizeof(header
),
262 "high-priority-max-avx512-frequency(MHz)");
263 snprintf(value
, sizeof(value
), "%d",
264 bucket_info
[j
].avx512_trl
*
265 DISP_FREQ_MULTIPLIER
);
266 format_and_print(outf
, base_level
+ 2, header
, value
);
269 snprintf(header
, sizeof(header
),
270 "speed-select-turbo-freq-clip-frequencies");
271 format_and_print(outf
, base_level
+ 1, header
, NULL
);
272 snprintf(header
, sizeof(header
), "low-priority-max-frequency(MHz)");
273 snprintf(value
, sizeof(value
), "%d",
274 fact_info
->lp_clipping_ratio_license_sse
*
275 DISP_FREQ_MULTIPLIER
);
276 format_and_print(outf
, base_level
+ 2, header
, value
);
277 snprintf(header
, sizeof(header
),
278 "low-priority-max-avx2-frequency(MHz)");
279 snprintf(value
, sizeof(value
), "%d",
280 fact_info
->lp_clipping_ratio_license_avx2
*
281 DISP_FREQ_MULTIPLIER
);
282 format_and_print(outf
, base_level
+ 2, header
, value
);
283 snprintf(header
, sizeof(header
),
284 "low-priority-max-avx512-frequency(MHz)");
285 snprintf(value
, sizeof(value
), "%d",
286 fact_info
->lp_clipping_ratio_license_avx512
*
287 DISP_FREQ_MULTIPLIER
);
288 format_and_print(outf
, base_level
+ 2, header
, value
);
291 void isst_ctdp_display_core_info(int cpu
, FILE *outf
, char *prefix
,
297 snprintf(header
, sizeof(header
), "package-%d",
298 get_physical_package_id(cpu
));
299 format_and_print(outf
, 1, header
, NULL
);
300 snprintf(header
, sizeof(header
), "die-%d", get_physical_die_id(cpu
));
301 format_and_print(outf
, 2, header
, NULL
);
302 snprintf(header
, sizeof(header
), "cpu-%d", cpu
);
303 format_and_print(outf
, 3, header
, NULL
);
305 snprintf(value
, sizeof(value
), "%u", val
);
306 format_and_print(outf
, 4, prefix
, value
);
308 format_and_print(outf
, 1, NULL
, NULL
);
311 void isst_ctdp_display_information(int cpu
, FILE *outf
, int tdp_level
,
312 struct isst_pkg_ctdp
*pkg_dev
)
316 int i
, base_level
= 1;
318 if (pkg_dev
->processed
)
319 print_package_info(cpu
, outf
);
321 for (i
= 0; i
<= pkg_dev
->levels
; ++i
) {
322 struct isst_pkg_ctdp_level_info
*ctdp_level
;
325 ctdp_level
= &pkg_dev
->ctdp_level
[i
];
326 if (!ctdp_level
->processed
)
329 snprintf(header
, sizeof(header
), "perf-profile-level-%d",
331 format_and_print(outf
, base_level
+ 3, header
, NULL
);
333 snprintf(header
, sizeof(header
), "cpu-count");
334 j
= get_cpu_count(get_physical_die_id(cpu
),
335 get_physical_die_id(cpu
));
336 snprintf(value
, sizeof(value
), "%d", j
);
337 format_and_print(outf
, base_level
+ 4, header
, value
);
339 if (ctdp_level
->core_cpumask_size
) {
340 snprintf(header
, sizeof(header
), "enable-cpu-mask");
341 printcpumask(sizeof(value
), value
,
342 ctdp_level
->core_cpumask_size
,
343 ctdp_level
->core_cpumask
);
344 format_and_print(outf
, base_level
+ 4, header
, value
);
346 snprintf(header
, sizeof(header
), "enable-cpu-list");
347 printcpulist(sizeof(value
), value
,
348 ctdp_level
->core_cpumask_size
,
349 ctdp_level
->core_cpumask
);
350 format_and_print(outf
, base_level
+ 4, header
, value
);
353 snprintf(header
, sizeof(header
), "thermal-design-power-ratio");
354 snprintf(value
, sizeof(value
), "%d", ctdp_level
->tdp_ratio
);
355 format_and_print(outf
, base_level
+ 4, header
, value
);
357 snprintf(header
, sizeof(header
), "base-frequency(MHz)");
358 if (!ctdp_level
->sse_p1
)
359 ctdp_level
->sse_p1
= ctdp_level
->tdp_ratio
;
360 snprintf(value
, sizeof(value
), "%d",
361 ctdp_level
->sse_p1
* DISP_FREQ_MULTIPLIER
);
362 format_and_print(outf
, base_level
+ 4, header
, value
);
364 if (ctdp_level
->avx2_p1
) {
365 snprintf(header
, sizeof(header
), "base-frequency-avx2(MHz)");
366 snprintf(value
, sizeof(value
), "%d",
367 ctdp_level
->avx2_p1
* DISP_FREQ_MULTIPLIER
);
368 format_and_print(outf
, base_level
+ 4, header
, value
);
371 if (ctdp_level
->avx512_p1
) {
372 snprintf(header
, sizeof(header
), "base-frequency-avx512(MHz)");
373 snprintf(value
, sizeof(value
), "%d",
374 ctdp_level
->avx512_p1
* DISP_FREQ_MULTIPLIER
);
375 format_and_print(outf
, base_level
+ 4, header
, value
);
378 if (ctdp_level
->uncore_p1
) {
379 snprintf(header
, sizeof(header
), "uncore-frequency-min(MHz)");
380 snprintf(value
, sizeof(value
), "%d",
381 ctdp_level
->uncore_p1
* DISP_FREQ_MULTIPLIER
);
382 format_and_print(outf
, base_level
+ 4, header
, value
);
385 if (ctdp_level
->uncore_p0
) {
386 snprintf(header
, sizeof(header
), "uncore-frequency-max(MHz)");
387 snprintf(value
, sizeof(value
), "%d",
388 ctdp_level
->uncore_p0
* DISP_FREQ_MULTIPLIER
);
389 format_and_print(outf
, base_level
+ 4, header
, value
);
392 if (ctdp_level
->mem_freq
) {
393 snprintf(header
, sizeof(header
), "mem-frequency(MHz)");
394 snprintf(value
, sizeof(value
), "%d",
395 ctdp_level
->mem_freq
* DISP_FREQ_MULTIPLIER
);
396 format_and_print(outf
, base_level
+ 4, header
, value
);
399 snprintf(header
, sizeof(header
),
400 "speed-select-turbo-freq");
401 if (ctdp_level
->fact_support
) {
402 if (ctdp_level
->fact_enabled
)
403 snprintf(value
, sizeof(value
), "enabled");
405 snprintf(value
, sizeof(value
), "disabled");
407 snprintf(value
, sizeof(value
), "unsupported");
408 format_and_print(outf
, base_level
+ 4, header
, value
);
410 snprintf(header
, sizeof(header
),
411 "speed-select-base-freq");
412 if (ctdp_level
->pbf_support
) {
413 if (ctdp_level
->pbf_enabled
)
414 snprintf(value
, sizeof(value
), "enabled");
416 snprintf(value
, sizeof(value
), "disabled");
418 snprintf(value
, sizeof(value
), "unsupported");
419 format_and_print(outf
, base_level
+ 4, header
, value
);
421 snprintf(header
, sizeof(header
),
422 "speed-select-core-power");
423 if (ctdp_level
->sst_cp_support
) {
424 if (ctdp_level
->sst_cp_enabled
)
425 snprintf(value
, sizeof(value
), "enabled");
427 snprintf(value
, sizeof(value
), "disabled");
429 snprintf(value
, sizeof(value
), "unsupported");
430 format_and_print(outf
, base_level
+ 4, header
, value
);
432 if (is_clx_n_platform()) {
433 if (ctdp_level
->pbf_support
)
434 _isst_pbf_display_information(cpu
, outf
,
436 &ctdp_level
->pbf_info
,
441 if (ctdp_level
->pkg_tdp
) {
442 snprintf(header
, sizeof(header
), "thermal-design-power(W)");
443 snprintf(value
, sizeof(value
), "%d", ctdp_level
->pkg_tdp
);
444 format_and_print(outf
, base_level
+ 4, header
, value
);
447 if (ctdp_level
->t_proc_hot
) {
448 snprintf(header
, sizeof(header
), "tjunction-max(C)");
449 snprintf(value
, sizeof(value
), "%d", ctdp_level
->t_proc_hot
);
450 format_and_print(outf
, base_level
+ 4, header
, value
);
453 snprintf(header
, sizeof(header
), "turbo-ratio-limits-sse");
454 format_and_print(outf
, base_level
+ 4, header
, NULL
);
455 for (j
= 0; j
< 8; ++j
) {
456 snprintf(header
, sizeof(header
), "bucket-%d", j
);
457 format_and_print(outf
, base_level
+ 5, header
, NULL
);
459 snprintf(header
, sizeof(header
), "core-count");
460 snprintf(value
, sizeof(value
), "%llu", (ctdp_level
->buckets_info
>> (j
* 8)) & 0xff);
461 format_and_print(outf
, base_level
+ 6, header
, value
);
463 snprintf(header
, sizeof(header
),
464 "max-turbo-frequency(MHz)");
465 snprintf(value
, sizeof(value
), "%d",
466 ctdp_level
->trl_sse_active_cores
[j
] *
467 DISP_FREQ_MULTIPLIER
);
468 format_and_print(outf
, base_level
+ 6, header
, value
);
471 if (ctdp_level
->trl_avx_active_cores
[0]) {
472 snprintf(header
, sizeof(header
), "turbo-ratio-limits-avx2");
473 format_and_print(outf
, base_level
+ 4, header
, NULL
);
474 for (j
= 0; j
< 8; ++j
) {
475 snprintf(header
, sizeof(header
), "bucket-%d", j
);
476 format_and_print(outf
, base_level
+ 5, header
, NULL
);
478 snprintf(header
, sizeof(header
), "core-count");
479 snprintf(value
, sizeof(value
), "%llu", (ctdp_level
->buckets_info
>> (j
* 8)) & 0xff);
480 format_and_print(outf
, base_level
+ 6, header
, value
);
482 snprintf(header
, sizeof(header
), "max-turbo-frequency(MHz)");
483 snprintf(value
, sizeof(value
), "%d", ctdp_level
->trl_avx_active_cores
[j
] * DISP_FREQ_MULTIPLIER
);
484 format_and_print(outf
, base_level
+ 6, header
, value
);
488 if (ctdp_level
->trl_avx_512_active_cores
[0]) {
489 snprintf(header
, sizeof(header
), "turbo-ratio-limits-avx512");
490 format_and_print(outf
, base_level
+ 4, header
, NULL
);
491 for (j
= 0; j
< 8; ++j
) {
492 snprintf(header
, sizeof(header
), "bucket-%d", j
);
493 format_and_print(outf
, base_level
+ 5, header
, NULL
);
495 snprintf(header
, sizeof(header
), "core-count");
496 snprintf(value
, sizeof(value
), "%llu", (ctdp_level
->buckets_info
>> (j
* 8)) & 0xff);
497 format_and_print(outf
, base_level
+ 6, header
, value
);
499 snprintf(header
, sizeof(header
), "max-turbo-frequency(MHz)");
500 snprintf(value
, sizeof(value
), "%d", ctdp_level
->trl_avx_512_active_cores
[j
] * DISP_FREQ_MULTIPLIER
);
501 format_and_print(outf
, base_level
+ 6, header
, value
);
505 if (ctdp_level
->pbf_support
)
506 _isst_pbf_display_information(cpu
, outf
, i
,
507 &ctdp_level
->pbf_info
,
509 if (ctdp_level
->fact_support
)
510 _isst_fact_display_information(cpu
, outf
, i
, 0xff, 0xff,
511 &ctdp_level
->fact_info
,
515 format_and_print(outf
, 1, NULL
, NULL
);
518 void isst_ctdp_display_information_start(FILE *outf
)
521 format_and_print(outf
, 0, "start", NULL
);
524 void isst_ctdp_display_information_end(FILE *outf
)
526 format_and_print(outf
, 0, NULL
, NULL
);
529 void isst_pbf_display_information(int cpu
, FILE *outf
, int level
,
530 struct isst_pbf_info
*pbf_info
)
532 print_package_info(cpu
, outf
);
533 _isst_pbf_display_information(cpu
, outf
, level
, pbf_info
, 4);
534 format_and_print(outf
, 1, NULL
, NULL
);
537 void isst_fact_display_information(int cpu
, FILE *outf
, int level
,
538 int fact_bucket
, int fact_avx
,
539 struct isst_fact_info
*fact_info
)
541 print_package_info(cpu
, outf
);
542 _isst_fact_display_information(cpu
, outf
, level
, fact_bucket
, fact_avx
,
544 format_and_print(outf
, 1, NULL
, NULL
);
547 void isst_clos_display_information(int cpu
, FILE *outf
, int clos
,
548 struct isst_clos_config
*clos_config
)
553 snprintf(header
, sizeof(header
), "package-%d",
554 get_physical_package_id(cpu
));
555 format_and_print(outf
, 1, header
, NULL
);
556 snprintf(header
, sizeof(header
), "die-%d", get_physical_die_id(cpu
));
557 format_and_print(outf
, 2, header
, NULL
);
558 snprintf(header
, sizeof(header
), "cpu-%d", cpu
);
559 format_and_print(outf
, 3, header
, NULL
);
561 snprintf(header
, sizeof(header
), "core-power");
562 format_and_print(outf
, 4, header
, NULL
);
564 snprintf(header
, sizeof(header
), "clos");
565 snprintf(value
, sizeof(value
), "%d", clos
);
566 format_and_print(outf
, 5, header
, value
);
568 snprintf(header
, sizeof(header
), "epp");
569 snprintf(value
, sizeof(value
), "%d", clos_config
->epp
);
570 format_and_print(outf
, 5, header
, value
);
572 snprintf(header
, sizeof(header
), "clos-proportional-priority");
573 snprintf(value
, sizeof(value
), "%d", clos_config
->clos_prop_prio
);
574 format_and_print(outf
, 5, header
, value
);
576 snprintf(header
, sizeof(header
), "clos-min");
577 snprintf(value
, sizeof(value
), "%d MHz", clos_config
->clos_min
* DISP_FREQ_MULTIPLIER
);
578 format_and_print(outf
, 5, header
, value
);
580 snprintf(header
, sizeof(header
), "clos-max");
581 snprintf(value
, sizeof(value
), "%d MHz", clos_config
->clos_max
* DISP_FREQ_MULTIPLIER
);
582 format_and_print(outf
, 5, header
, value
);
584 snprintf(header
, sizeof(header
), "clos-desired");
585 snprintf(value
, sizeof(value
), "%d MHz", clos_config
->clos_desired
* DISP_FREQ_MULTIPLIER
);
586 format_and_print(outf
, 5, header
, value
);
588 format_and_print(outf
, 1, NULL
, NULL
);
591 void isst_clos_display_clos_information(int cpu
, FILE *outf
,
592 int clos_enable
, int type
)
597 snprintf(header
, sizeof(header
), "package-%d",
598 get_physical_package_id(cpu
));
599 format_and_print(outf
, 1, header
, NULL
);
600 snprintf(header
, sizeof(header
), "die-%d", get_physical_die_id(cpu
));
601 format_and_print(outf
, 2, header
, NULL
);
602 snprintf(header
, sizeof(header
), "cpu-%d", cpu
);
603 format_and_print(outf
, 3, header
, NULL
);
605 snprintf(header
, sizeof(header
), "core-power");
606 format_and_print(outf
, 4, header
, NULL
);
608 snprintf(header
, sizeof(header
), "enable-status");
609 snprintf(value
, sizeof(value
), "%d", clos_enable
);
610 format_and_print(outf
, 5, header
, value
);
612 snprintf(header
, sizeof(header
), "priority-type");
613 snprintf(value
, sizeof(value
), "%d", type
);
614 format_and_print(outf
, 5, header
, value
);
616 format_and_print(outf
, 1, NULL
, NULL
);
619 void isst_clos_display_assoc_information(int cpu
, FILE *outf
, int clos
)
624 snprintf(header
, sizeof(header
), "package-%d",
625 get_physical_package_id(cpu
));
626 format_and_print(outf
, 1, header
, NULL
);
627 snprintf(header
, sizeof(header
), "die-%d", get_physical_die_id(cpu
));
628 format_and_print(outf
, 2, header
, NULL
);
629 snprintf(header
, sizeof(header
), "cpu-%d", cpu
);
630 format_and_print(outf
, 3, header
, NULL
);
632 snprintf(header
, sizeof(header
), "get-assoc");
633 format_and_print(outf
, 4, header
, NULL
);
635 snprintf(header
, sizeof(header
), "clos");
636 snprintf(value
, sizeof(value
), "%d", clos
);
637 format_and_print(outf
, 5, header
, value
);
639 format_and_print(outf
, 1, NULL
, NULL
);
642 void isst_display_result(int cpu
, FILE *outf
, char *feature
, char *cmd
,
649 snprintf(header
, sizeof(header
), "package-%d",
650 get_physical_package_id(cpu
));
651 format_and_print(outf
, 1, header
, NULL
);
652 snprintf(header
, sizeof(header
), "die-%d", get_physical_die_id(cpu
));
653 format_and_print(outf
, 2, header
, NULL
);
654 snprintf(header
, sizeof(header
), "cpu-%d", cpu
);
655 format_and_print(outf
, 3, header
, NULL
);
657 snprintf(header
, sizeof(header
), "%s", feature
);
658 format_and_print(outf
, 4, header
, NULL
);
659 snprintf(header
, sizeof(header
), "%s", cmd
);
661 snprintf(value
, sizeof(value
), "success");
663 snprintf(value
, sizeof(value
), "failed(error %d)", result
);
664 format_and_print(outf
, 5, header
, value
);
666 format_and_print(outf
, 1, NULL
, NULL
);