Skip to content

Commit 1233c7b

Browse files
spandruvadaandy-shev
authored andcommitted
tools/power/x86/intel-speed-select: Display core count for bucket
Read the bucket and core count relationship via MSR and display when displaying turbo ratio limits. Signed-off-by: Srinivas Pandruvada <[email protected]> Signed-off-by: Andy Shevchenko <[email protected]>
1 parent 92e0e87 commit 1233c7b

File tree

3 files changed

+26
-3
lines changed

3 files changed

+26
-3
lines changed

tools/power/x86/intel-speed-select/isst-core.c

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,24 @@ int isst_get_get_trl(int cpu, int level, int avx_level, int *trl)
188188
return 0;
189189
}
190190

191+
int isst_get_trl_bucket_info(int cpu, unsigned long long *buckets_info)
192+
{
193+
int ret;
194+
195+
debug_printf("cpu:%d bucket info via MSR\n", cpu);
196+
197+
*buckets_info = 0;
198+
199+
ret = isst_send_msr_command(cpu, 0x1ae, 0, buckets_info);
200+
if (ret)
201+
return ret;
202+
203+
debug_printf("cpu:%d bucket info via MSR successful 0x%llx\n", cpu,
204+
*buckets_info);
205+
206+
return 0;
207+
}
208+
191209
int isst_set_tdp_level_msr(int cpu, int tdp_level)
192210
{
193211
unsigned long long level = tdp_level;
@@ -563,6 +581,10 @@ int isst_get_process_ctdp(int cpu, int tdp_level, struct isst_pkg_ctdp *pkg_dev)
563581
if (ret)
564582
return ret;
565583

584+
ret = isst_get_trl_bucket_info(cpu, &ctdp_level->buckets_info);
585+
if (ret)
586+
return ret;
587+
566588
ret = isst_get_get_trl(cpu, i, 0,
567589
ctdp_level->trl_sse_active_cores);
568590
if (ret)

tools/power/x86/intel-speed-select/isst-display.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ void isst_ctdp_display_information(int cpu, FILE *outf, int tdp_level,
372372
format_and_print(outf, base_level + 5, header, NULL);
373373

374374
snprintf(header, sizeof(header), "core-count");
375-
snprintf(value, sizeof(value), "%d", j);
375+
snprintf(value, sizeof(value), "%llu", (ctdp_level->buckets_info >> (j * 8)) & 0xff);
376376
format_and_print(outf, base_level + 6, header, value);
377377

378378
snprintf(header, sizeof(header),
@@ -389,7 +389,7 @@ void isst_ctdp_display_information(int cpu, FILE *outf, int tdp_level,
389389
format_and_print(outf, base_level + 5, header, NULL);
390390

391391
snprintf(header, sizeof(header), "core-count");
392-
snprintf(value, sizeof(value), "%d", j);
392+
snprintf(value, sizeof(value), "%llu", (ctdp_level->buckets_info >> (j * 8)) & 0xff);
393393
format_and_print(outf, base_level + 6, header, value);
394394

395395
snprintf(header, sizeof(header),
@@ -407,7 +407,7 @@ void isst_ctdp_display_information(int cpu, FILE *outf, int tdp_level,
407407
format_and_print(outf, base_level + 5, header, NULL);
408408

409409
snprintf(header, sizeof(header), "core-count");
410-
snprintf(value, sizeof(value), "%d", j);
410+
snprintf(value, sizeof(value), "%llu", (ctdp_level->buckets_info >> (j * 8)) & 0xff);
411411
format_and_print(outf, base_level + 6, header, value);
412412

413413
snprintf(header, sizeof(header),

tools/power/x86/intel-speed-select/isst.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ struct isst_pkg_ctdp_level_info {
134134
size_t core_cpumask_size;
135135
cpu_set_t *core_cpumask;
136136
int cpu_count;
137+
unsigned long long buckets_info;
137138
int trl_sse_active_cores[ISST_TRL_MAX_ACTIVE_CORES];
138139
int trl_avx_active_cores[ISST_TRL_MAX_ACTIVE_CORES];
139140
int trl_avx_512_active_cores[ISST_TRL_MAX_ACTIVE_CORES];

0 commit comments

Comments
 (0)