diff options
author | Zhang Rui <rui.zhang@intel.com> | 2022-08-10 12:14:11 +0300 |
---|---|---|
committer | Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> | 2023-03-22 23:36:54 +0300 |
commit | 46de87e39b871f926b429b14bde845412b541841 (patch) | |
tree | a768e63906d1b4b72b62166d71142e464119d3e1 /tools/power/x86/intel-speed-select/isst-display.c | |
parent | 79554aaa224a3b99f95b9c2843dc904764c32541 (diff) | |
download | linux-46de87e39b871f926b429b14bde845412b541841.tar.xz |
tools/power/x86/intel-speed-select: Display punit info
Display punit info for platforms with new api_version.
For platforms with old api_version, don't display the punit info to be
backward compatible.
For example:
Intel(R) Speed Select Technology
Executing on CPU model:173[0xad]
package-0
die-0
powerdomain-0
cpu-0
get-config-current_level:0
package-0
die-0
powerdomain-3
cpu--1
get-config-current_level:0
package-0
die-0
powerdomain-4
cpu--1
get-config-current_level:0
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
[srinivas.pandruvada@linux.intel.com: changelog edits]
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Diffstat (limited to 'tools/power/x86/intel-speed-select/isst-display.c')
-rw-r--r-- | tools/power/x86/intel-speed-select/isst-display.c | 39 |
1 files changed, 18 insertions, 21 deletions
diff --git a/tools/power/x86/intel-speed-select/isst-display.c b/tools/power/x86/intel-speed-select/isst-display.c index af97ba5dbcc2..959d2d81e13a 100644 --- a/tools/power/x86/intel-speed-select/isst-display.c +++ b/tools/power/x86/intel-speed-select/isst-display.c @@ -169,21 +169,30 @@ static void format_and_print(FILE *outf, int level, char *header, char *value) static int print_package_info(struct isst_id *id, FILE *outf) { char header[256]; + int level = 1; if (out_format_is_json()) { - snprintf(header, sizeof(header), "package-%d:die-%d:cpu-%d", - id->pkg, id->die, id->cpu); - format_and_print(outf, 1, header, NULL); + if (api_version() > 1) + snprintf(header, sizeof(header), "package-%d:die-%d:powerdomain-%d:cpu-%d", + id->pkg, id->die, id->punit, id->cpu); + else + snprintf(header, sizeof(header), "package-%d:die-%d:cpu-%d", + id->pkg, id->die, id->cpu); + format_and_print(outf, level, header, NULL); return 1; } snprintf(header, sizeof(header), "package-%d", id->pkg); - format_and_print(outf, 1, header, NULL); + format_and_print(outf, level++, header, NULL); snprintf(header, sizeof(header), "die-%d", id->die); - format_and_print(outf, 2, header, NULL); + format_and_print(outf, level++, header, NULL); + if (api_version() > 1) { + snprintf(header, sizeof(header), "powerdomain-%d", id->punit); + format_and_print(outf, level++, header, NULL); + } snprintf(header, sizeof(header), "cpu-%d", id->cpu); - format_and_print(outf, 3, header, NULL); + format_and_print(outf, level, header, NULL); - return 3; + return level; } static void _isst_pbf_display_information(struct isst_id *id, FILE *outf, int level, @@ -306,22 +315,10 @@ static void _isst_fact_display_information(struct isst_id *id, FILE *outf, int l void isst_ctdp_display_core_info(struct isst_id *id, FILE *outf, char *prefix, unsigned int val, char *str0, char *str1) { - char header[256]; char value[256]; - int level = 1; + int level = print_package_info(id, outf); - if (out_format_is_json()) { - snprintf(header, sizeof(header), "package-%d:die-%d:cpu-%d", - id->pkg, id->die, id->cpu); - format_and_print(outf, level++, header, NULL); - } else { - snprintf(header, sizeof(header), "package-%d", id->pkg); - format_and_print(outf, level++, header, NULL); - snprintf(header, sizeof(header), "die-%d", id->die); - format_and_print(outf, level++, header, NULL); - snprintf(header, sizeof(header), "cpu-%d", id->cpu); - format_and_print(outf, level++, header, NULL); - } + level++; if (str0 && !val) snprintf(value, sizeof(value), "%s", str0); |