aboutsummaryrefslogtreecommitdiffstats
path: root/tools/power
diff options
context:
space:
mode:
authorZhang Rui <rui.zhang@intel.com>2022-08-20 23:58:20 +0800
committerSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>2022-09-15 11:16:05 -0700
commit30e0600e2f849434e9a86824e2eced6a6c534723 (patch)
tree1199af3e9d5aadc546e5bffdf057b8275f3aebbd /tools/power
parenttools/power/x86/intel-speed-select: Add pkg and die in isst_id (diff)
downloadlinux-dev-30e0600e2f849434e9a86824e2eced6a6c534723.tar.xz
linux-dev-30e0600e2f849434e9a86824e2eced6a6c534723.zip
tools/power/x86/intel-speed-select: Convert more function to use isst_id
With pkg and die info added into struct isst_id, more functions can be converted to use struct isst_id as parameter. Signed-off-by: Zhang Rui <rui.zhang@intel.com> Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Diffstat (limited to 'tools/power')
-rw-r--r--tools/power/x86/intel-speed-select/isst-config.c12
-rw-r--r--tools/power/x86/intel-speed-select/isst-core.c2
-rw-r--r--tools/power/x86/intel-speed-select/isst-display.c3
-rw-r--r--tools/power/x86/intel-speed-select/isst.h4
4 files changed, 10 insertions, 11 deletions
diff --git a/tools/power/x86/intel-speed-select/isst-config.c b/tools/power/x86/intel-speed-select/isst-config.c
index bddc0d1ff2d7..355d81d8bd26 100644
--- a/tools/power/x86/intel-speed-select/isst-config.c
+++ b/tools/power/x86/intel-speed-select/isst-config.c
@@ -582,7 +582,7 @@ static void set_cpu_present_cpu_mask(void)
}
}
-int get_max_punit_core_id(int pkg_id, int die_id)
+int get_max_punit_core_id(struct isst_id *id)
{
int max_id = 0;
int i;
@@ -592,8 +592,8 @@ int get_max_punit_core_id(int pkg_id, int die_id)
if (!CPU_ISSET_S(i, present_cpumask_size, present_cpumask))
continue;
- if (cpu_map[i].pkg_id == pkg_id &&
- cpu_map[i].die_id == die_id &&
+ if (cpu_map[i].pkg_id == id->pkg &&
+ cpu_map[i].die_id == id->die &&
cpu_map[i].punit_cpu_core > max_id)
max_id = cpu_map[i].punit_cpu_core;
}
@@ -601,10 +601,10 @@ int get_max_punit_core_id(int pkg_id, int die_id)
return max_id;
}
-int get_cpu_count(int pkg_id, int die_id)
+int get_cpu_count(struct isst_id *id)
{
- if (pkg_id < MAX_PACKAGE_COUNT && die_id < MAX_DIE_PER_PACKAGE)
- return cpu_cnt[pkg_id][die_id];
+ if (id->pkg < MAX_PACKAGE_COUNT && id->die < MAX_DIE_PER_PACKAGE)
+ return cpu_cnt[id->pkg][id->die];
return 0;
}
diff --git a/tools/power/x86/intel-speed-select/isst-core.c b/tools/power/x86/intel-speed-select/isst-core.c
index e4e137edf00b..86eeea857a01 100644
--- a/tools/power/x86/intel-speed-select/isst-core.c
+++ b/tools/power/x86/intel-speed-select/isst-core.c
@@ -412,7 +412,7 @@ int isst_get_pbf_info(struct isst_id *id, int level, struct isst_pbf_info *pbf_i
pbf_info->core_cpumask_size = alloc_cpu_set(&pbf_info->core_cpumask);
- max_punit_core = get_max_punit_core_id(get_physical_package_id(id->cpu), get_physical_die_id(id->cpu));
+ max_punit_core = get_max_punit_core_id(id);
max_mask_index = max_punit_core > 32 ? 2 : 1;
for (i = 0; i < max_mask_index; ++i) {
diff --git a/tools/power/x86/intel-speed-select/isst-display.c b/tools/power/x86/intel-speed-select/isst-display.c
index f718b9e84136..2b282eea1024 100644
--- a/tools/power/x86/intel-speed-select/isst-display.c
+++ b/tools/power/x86/intel-speed-select/isst-display.c
@@ -377,8 +377,7 @@ void isst_ctdp_display_information(struct isst_id *id, FILE *outf, int tdp_level
format_and_print(outf, level + 1, header, NULL);
snprintf(header, sizeof(header), "cpu-count");
- j = get_cpu_count(get_physical_package_id(id->cpu),
- get_physical_die_id(id->cpu));
+ j = get_cpu_count(id);
snprintf(value, sizeof(value), "%d", j);
format_and_print(outf, level + 2, header, value);
diff --git a/tools/power/x86/intel-speed-select/isst.h b/tools/power/x86/intel-speed-select/isst.h
index 4bab3b2dce5d..cb53b5bd3013 100644
--- a/tools/power/x86/intel-speed-select/isst.h
+++ b/tools/power/x86/intel-speed-select/isst.h
@@ -179,8 +179,8 @@ struct isst_pkg_ctdp {
};
extern int get_topo_max_cpus(void);
-extern int get_cpu_count(int pkg_id, int die_id);
-extern int get_max_punit_core_id(int pkg_id, int die_id);
+extern int get_cpu_count(struct isst_id *id);
+extern int get_max_punit_core_id(struct isst_id *id);
/* Common interfaces */
FILE *get_output_file(void);