Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

tools/power/x86/intel-speed-select: Avoid duplicate names for json parsing

For the command
"intel-speed-select perf-profile info":

There are two instances of “speed-select-turbo-freq” underneath
“perf-profile-level-0” for each package. When we load the output into
python with json.load(), the second instance overwrites the first.

Result is that we can only access:
"speed-select-turbo-freq": {
"bucket-0": {
"high-priority-cores-count": "2",
"high-priority-max-frequency(MHz)": "3000",
"high-priority-max-avx2-frequency(MHz)": "2800",
"high-priority-max-avx512-frequency(MHz)": "2600"
},
Because it is a duplicate of "speed-select-turbo-freq": "disabled"
Same is true for "speed-select-base-freq".

To avoid this add "-properties" suffix for the second instance to
differentiate.

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

authored by

Srinivas Pandruvada and committed by
Andy Shevchenko
3b0fe3ba 14a8aa49

+2 -2
+2 -2
tools/power/x86/intel-speed-select/isst-display.c
··· 178 178 char header[256]; 179 179 char value[256]; 180 180 181 - snprintf(header, sizeof(header), "speed-select-base-freq"); 181 + snprintf(header, sizeof(header), "speed-select-base-freq-properties"); 182 182 format_and_print(outf, disp_level, header, NULL); 183 183 184 184 snprintf(header, sizeof(header), "high-priority-base-frequency(MHz)"); ··· 224 224 char value[256]; 225 225 int j; 226 226 227 - snprintf(header, sizeof(header), "speed-select-turbo-freq"); 227 + snprintf(header, sizeof(header), "speed-select-turbo-freq-properties"); 228 228 format_and_print(outf, base_level, header, NULL); 229 229 for (j = 0; j < ISST_FACT_MAX_BUCKETS; ++j) { 230 230 if (fact_bucket != 0xff && fact_bucket != j)