summaryrefslogtreecommitdiff
path: root/tools/power/x86/intel-speed-select/isst-display.c
diff options
context:
space:
mode:
authorSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>2020-03-06 01:45:29 +0300
committerAndy Shevchenko <andriy.shevchenko@linux.intel.com>2020-03-20 15:46:22 +0300
commita9fd6ae739ef9624f9017df08edf0970c7d170e2 (patch)
tree07c68b83f4f08b41a136a49cf67a1b7cd28a7717 /tools/power/x86/intel-speed-select/isst-display.c
parent39bae0fce48f6431ceb3ab9cff91cb749c736c48 (diff)
downloadlinux-a9fd6ae739ef9624f9017df08edf0970c7d170e2.tar.xz
tools/power/x86/intel-speed-select: Improve error display for turbo-freq feature
This change adds improved error display and handling for commands related to turbo-freq feature. The changes include: - Replace perror/fprintf with helpful error message - Error for not specifying TDP level when required - Show error for invalid bucket number - Show message to enable core-power before enabling turbo-freq feature Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@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.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/tools/power/x86/intel-speed-select/isst-display.c b/tools/power/x86/intel-speed-select/isst-display.c
index 0667b405f17f..bf9422336fab 100644
--- a/tools/power/x86/intel-speed-select/isst-display.c
+++ b/tools/power/x86/intel-speed-select/isst-display.c
@@ -222,7 +222,21 @@ static void _isst_fact_display_information(int cpu, FILE *outf, int level,
struct isst_fact_bucket_info *bucket_info = fact_info->bucket_info;
char header[256];
char value[256];
- int j;
+ int print = 0, j;
+
+ for (j = 0; j < ISST_FACT_MAX_BUCKETS; ++j) {
+ if (fact_bucket != 0xff && fact_bucket != j)
+ continue;
+
+ if (!bucket_info[j].high_priority_cores_count)
+ break;
+
+ print = 1;
+ }
+ if (!print) {
+ fprintf(stderr, "Invalid bucket\n");
+ return;
+ }
snprintf(header, sizeof(header), "speed-select-turbo-freq-properties");
format_and_print(outf, base_level, header, NULL);