summaryrefslogtreecommitdiff
path: root/tools/power
diff options
context:
space:
mode:
authorZhang Rui <rui.zhang@intel.com>2022-08-18 16:26:23 +0300
committerSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>2023-03-22 23:36:55 +0300
commitc7ff8ff3b29ee031a2194f67b5ceced9b77fdc21 (patch)
treec8046e5f8d03e70c11ba8642b71c8869a092aadd /tools/power
parentc5a295caefa33ce7599d7afbe7a2e9b1bc8d92a2 (diff)
downloadlinux-c7ff8ff3b29ee031a2194f67b5ceced9b77fdc21.tar.xz
tools/power/x86/intel-speed-select: Remove cpu mask display for non-cpu power domain
Non CPU power domains will not have any CPUs. So don't display any CPU count or enable mask. Signed-off-by: Zhang Rui <rui.zhang@intel.com> [srinivas.pandruvada@linux.intel.com: subject and changelog edits] 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-display.c44
1 files changed, 23 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 d8b789b9656a..e3573895c8b0 100644
--- a/tools/power/x86/intel-speed-select/isst-display.c
+++ b/tools/power/x86/intel-speed-select/isst-display.c
@@ -356,31 +356,33 @@ void isst_ctdp_display_information(struct isst_id *id, FILE *outf, int tdp_level
ctdp_level->level);
format_and_print(outf, level + 1, header, NULL);
- snprintf(header, sizeof(header), "cpu-count");
- j = get_cpu_count(id);
- snprintf(value, sizeof(value), "%d", j);
- format_and_print(outf, level + 2, header, value);
-
- j = CPU_COUNT_S(ctdp_level->core_cpumask_size,
- ctdp_level->core_cpumask);
- if (j) {
- snprintf(header, sizeof(header), "enable-cpu-count");
+ if (id->cpu >= 0) {
+ snprintf(header, sizeof(header), "cpu-count");
+ j = get_cpu_count(id);
snprintf(value, sizeof(value), "%d", j);
format_and_print(outf, level + 2, header, value);
- }
- if (ctdp_level->core_cpumask_size) {
- snprintf(header, sizeof(header), "enable-cpu-mask");
- printcpumask(sizeof(value), value,
- ctdp_level->core_cpumask_size,
- ctdp_level->core_cpumask);
- format_and_print(outf, level + 2, header, value);
+ j = CPU_COUNT_S(ctdp_level->core_cpumask_size,
+ ctdp_level->core_cpumask);
+ if (j) {
+ snprintf(header, sizeof(header), "enable-cpu-count");
+ snprintf(value, sizeof(value), "%d", j);
+ format_and_print(outf, level + 2, header, value);
+ }
- snprintf(header, sizeof(header), "enable-cpu-list");
- printcpulist(sizeof(value), value,
- ctdp_level->core_cpumask_size,
- ctdp_level->core_cpumask);
- format_and_print(outf, level + 2, header, value);
+ if (ctdp_level->core_cpumask_size) {
+ snprintf(header, sizeof(header), "enable-cpu-mask");
+ printcpumask(sizeof(value), value,
+ ctdp_level->core_cpumask_size,
+ ctdp_level->core_cpumask);
+ format_and_print(outf, level + 2, header, value);
+
+ snprintf(header, sizeof(header), "enable-cpu-list");
+ printcpulist(sizeof(value), value,
+ ctdp_level->core_cpumask_size,
+ ctdp_level->core_cpumask);
+ format_and_print(outf, level + 2, header, value);
+ }
}
snprintf(header, sizeof(header), "thermal-design-power-ratio");