aboutsummaryrefslogtreecommitdiffstats
path: root/tools/power/x86/intel-speed-select/isst-display.c
diff options
context:
space:
mode:
authorZhang Rui <rui.zhang@intel.com>2022-08-20 23:58:21 +0800
committerSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>2022-09-15 11:16:05 -0700
commit56d6469291f8b1e1ab2f78e401c564163d3ee0f0 (patch)
tree81183ed198373c6489c1c34674ef1e4171be08f1 /tools/power/x86/intel-speed-select/isst-display.c
parenttools/power/x86/intel-speed-select: Convert more function to use isst_id (diff)
downloadlinux-dev-56d6469291f8b1e1ab2f78e401c564163d3ee0f0.tar.xz
linux-dev-56d6469291f8b1e1ab2f78e401c564163d3ee0f0.zip
tools/power/x86/intel-speed-select: Cleanup get_physical_id usage
struct isst_id already contains package and die id information, thus there is no need to get the package and die id information, when struct isst_id is already available. Remove unneeded get_physical_package_id/get_physical_die_id usage. Signed-off-by: Zhang Rui <rui.zhang@intel.com> Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Diffstat (limited to '')
-rw-r--r--tools/power/x86/intel-speed-select/isst-display.c17
1 files changed, 6 insertions, 11 deletions
diff --git a/tools/power/x86/intel-speed-select/isst-display.c b/tools/power/x86/intel-speed-select/isst-display.c
index 2b282eea1024..b19f57d30f55 100644
--- a/tools/power/x86/intel-speed-select/isst-display.c
+++ b/tools/power/x86/intel-speed-select/isst-display.c
@@ -172,15 +172,13 @@ static int print_package_info(struct isst_id *id, FILE *outf)
if (out_format_is_json()) {
snprintf(header, sizeof(header), "package-%d:die-%d:cpu-%d",
- get_physical_package_id(id->cpu), get_physical_die_id(id->cpu),
- id->cpu);
+ id->pkg, id->die, id->cpu);
format_and_print(outf, 1, header, NULL);
return 1;
}
- snprintf(header, sizeof(header), "package-%d",
- get_physical_package_id(id->cpu));
+ snprintf(header, sizeof(header), "package-%d", id->pkg);
format_and_print(outf, 1, header, NULL);
- snprintf(header, sizeof(header), "die-%d", get_physical_die_id(id->cpu));
+ snprintf(header, sizeof(header), "die-%d", id->die);
format_and_print(outf, 2, header, NULL);
snprintf(header, sizeof(header), "cpu-%d", id->cpu);
format_and_print(outf, 3, header, NULL);
@@ -328,15 +326,12 @@ void isst_ctdp_display_core_info(struct isst_id *id, FILE *outf, char *prefix,
if (out_format_is_json()) {
snprintf(header, sizeof(header), "package-%d:die-%d:cpu-%d",
- get_physical_package_id(id->cpu), get_physical_die_id(id->cpu),
- id->cpu);
+ id->pkg, id->die, id->cpu);
format_and_print(outf, level++, header, NULL);
} else {
- snprintf(header, sizeof(header), "package-%d",
- get_physical_package_id(id->cpu));
+ snprintf(header, sizeof(header), "package-%d", id->pkg);
format_and_print(outf, level++, header, NULL);
- snprintf(header, sizeof(header), "die-%d",
- get_physical_die_id(id->cpu));
+ 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);