Skip to content

Commit 583f99a

Browse files
committed
fix: update ELC options in configuration table and adjust test cases for new values
Signed-off-by: Harper, Jason M <[email protected]>
1 parent 4cce9c2 commit 583f99a

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

cmd/config/config_tables.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -87,11 +87,11 @@ func configurationTableValues(outputs map[string]script.ScriptOutput) []table.Fi
8787
fields = append(fields, []table.Field{
8888
{Name: "Energy Performance Bias", Description: "--epb <0-15>", Values: []string{extract.EPBFromOutput(outputs)}},
8989
{Name: "Energy Performance Preference", Description: "--epp <0-255>", Values: []string{extract.EPPFromOutput(outputs)}},
90-
{Name: "Scaling Governor", Description: "--gov <performance|powersave>", Values: []string{strings.TrimSpace(outputs[script.ScalingGovernorScriptName].Stdout)}},
90+
{Name: "Scaling Governor", Description: "--gov <" + strings.Join(governorOptions, "|") + ">", Values: []string{strings.TrimSpace(outputs[script.ScalingGovernorScriptName].Stdout)}},
9191
}...)
9292
// add ELC (for SRF, CWF and GNR only)
9393
if strings.Contains(uarch, cpus.UarchSRF) || strings.Contains(uarch, cpus.UarchGNR) || strings.Contains(uarch, cpus.UarchCWF) {
94-
fields = append(fields, table.Field{Name: "Efficiency Latency Control", Description: "--elc <power-optimized|latency-optimized>", Values: []string{extract.ELCSummaryFromOutput(outputs)}})
94+
fields = append(fields, table.Field{Name: "Efficiency Latency Control", Description: "--elc <" + strings.Join(elcOptions, "|") + ">", Values: []string{extract.ELCSummaryFromOutput(outputs)}})
9595
}
9696
// add prefetchers
9797
for _, pf := range extract.PrefetcherDefinitions {
@@ -123,20 +123,20 @@ func configurationTableValues(outputs map[string]script.ScriptOutput) []table.Fi
123123
fields = append(fields,
124124
table.Field{
125125
Name: pf.ShortName + " prefetcher",
126-
Description: "--" + "pref-" + strings.ReplaceAll(strings.ToLower(pf.ShortName), " ", "") + " <enable|disable>",
126+
Description: "--" + "pref-" + strings.ReplaceAll(strings.ToLower(pf.ShortName), " ", "") + " <" + strings.Join(prefetcherOptions, "|") + ">",
127127
Values: []string{enabledDisabled}},
128128
)
129129
}
130130
}
131131
// add C6
132132
c6 := extract.C6FromOutput(outputs)
133133
if c6 != "" {
134-
fields = append(fields, table.Field{Name: "C6", Description: "--c6 <enable|disable>", Values: []string{c6}})
134+
fields = append(fields, table.Field{Name: "C6", Description: "--c6 <" + strings.Join(c6Options, "|") + ">", Values: []string{c6}})
135135
}
136136
// add C1 Demotion
137137
c1Demotion := strings.TrimSpace(outputs[script.C1DemotionScriptName].Stdout)
138138
if c1Demotion != "" {
139-
fields = append(fields, table.Field{Name: "C1 Demotion", Description: "--c1-demotion <enable|disable>", Values: []string{c1Demotion}})
139+
fields = append(fields, table.Field{Name: "C1 Demotion", Description: "--c1-demotion <" + strings.Join(c1DemotionOptions, "|") + ">", Values: []string{c1Demotion}})
140140
}
141141
return fields
142142
}

cmd/config/restore_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,8 @@ func TestConvertValue(t *testing.T) {
142142
{"Prefetcher enabled", "pref-l2hw", "Enabled", "enable", false},
143143
{"Prefetcher disabled", "pref-l2hw", "Disabled", "disable", false},
144144
{"C6 enabled", "c6", "Enabled", "enable", false},
145-
{"ELC lowercase", "elc", "power-optimized", "power-optimized", false},
146-
{"ELC capitalized", "elc", "Power-Optimized", "power-optimized", false},
145+
{"ELC lowercase", "elc", "power", "power", false},
146+
{"ELC capitalized", "elc", "Power", "power", false},
147147
{"Core SSE freq buckets", "core-max-buckets", "1-44/3.6, 45-52/3.5, 53-60/3.4", "1-44/3.6, 45-52/3.5, 53-60/3.4", false},
148148
{"Core SSE freq buckets full", "core-max-buckets", "1-44/3.6, 45-52/3.5, 53-60/3.4, 61-72/3.2, 73-76/3.1, 77-86/3.0", "1-44/3.6, 45-52/3.5, 53-60/3.4, 61-72/3.2, 73-76/3.1, 77-86/3.0", false},
149149
{"Core SSE freq buckets invalid", "core-max-buckets", "invalid-format", "", true},

0 commit comments

Comments
 (0)