@@ -599,7 +599,8 @@ var tableDefinitions = map[string]TableDefinition{
599599 script .CstatesScriptName ,
600600 script .C1DemotionScriptName ,
601601 },
602- FieldsFunc : configurationTableValues },
602+ TextTableRendererFunc : configurationTableTextRenderer ,
603+ FieldsFunc : configurationTableValues },
603604 //
604605 // benchmarking tables
605606 //
@@ -2176,34 +2177,36 @@ func configurationTableValues(outputs map[string]script.ScriptOutput) []Field {
21762177 slog .Error ("failed to get uarch from script outputs" )
21772178 return []Field {}
21782179 }
2179-
2180+ // This table is only shown in text mode on stdout for the config command. The config
2181+ // command implements its own print logic and uses the Description field to show the command line
2182+ // argument for each config item.
21802183 fields := []Field {
2181- {Name : "Cores per Socket" , Values : []string {valFromRegexSubmatch (outputs [script .LscpuScriptName ].Stdout , `^Core\(s\) per socket:\s*(.+)$` )}},
2182- {Name : "L3 Cache" , Values : []string {l3InstanceFromOutput (outputs )}},
2183- {Name : "Package Power / TDP" , Values : []string {tdpFromOutput (outputs )}},
2184- {Name : "All-Core Max Frequency" , Values : []string {allCoreMaxFrequencyFromOutput (outputs )}},
2184+ {Name : "Cores per Socket" , Description : "--cores <N>" , Values : []string {valFromRegexSubmatch (outputs [script .LscpuScriptName ].Stdout , `^Core\(s\) per socket:\s*(.+)$` )}},
2185+ {Name : "L3 Cache" , Description : "--llc <MB>" , Values : []string {l3InstanceFromOutput (outputs )}},
2186+ {Name : "Package Power / TDP" , Description : "--tdp <Watts>" , Values : []string {tdpFromOutput (outputs )}},
2187+ {Name : "All-Core Max Frequency" , Description : "--core-max <GHz>" , Values : []string {allCoreMaxFrequencyFromOutput (outputs )}},
21852188 }
21862189 if strings .Contains (uarch , "SRF" ) || strings .Contains (uarch , "GNR" ) || strings .Contains (uarch , "CWF" ) {
21872190 fields = append (fields , []Field {
2188- {Name : "Uncore Min Frequency (Compute)" , Values : []string {uncoreMinMaxDieFrequencyFromOutput (false , true , outputs )}},
2189- {Name : "Uncore Min Frequency (I/O )" , Values : []string {uncoreMinMaxDieFrequencyFromOutput (false , false , outputs )}},
2190- {Name : "Uncore Max Frequency (Compute )" , Values : []string {uncoreMinMaxDieFrequencyFromOutput (true , true , outputs )}},
2191- {Name : "Uncore Max Frequency (I/O)" , Values : []string {uncoreMinMaxDieFrequencyFromOutput (true , false , outputs )}},
2191+ {Name : "Uncore Max Frequency (Compute)" , Description : "--uncore-max-compute <GHz>" , Values : []string {uncoreMinMaxDieFrequencyFromOutput (true , true , outputs )}},
2192+ {Name : "Uncore Min Frequency (Compute )" , Description : "--uncore-min-compute <GHz>" , Values : []string {uncoreMinMaxDieFrequencyFromOutput (false , true , outputs )}},
2193+ {Name : "Uncore Max Frequency (I/O )" , Description : "--uncore-max-io <GHz>" , Values : []string {uncoreMinMaxDieFrequencyFromOutput (true , false , outputs )}},
2194+ {Name : "Uncore Min Frequency (I/O)" , Description : "--uncore-min-io <GHz>" , Values : []string {uncoreMinMaxDieFrequencyFromOutput (false , false , outputs )}},
21922195 }... )
21932196 } else {
21942197 fields = append (fields , []Field {
2195- {Name : "Uncore Max Frequency ( GHz) " , Values : []string {uncoreMaxFrequencyFromOutput (outputs )}},
2196- {Name : "Uncore Min Frequency ( GHz) " , Values : []string {uncoreMinFrequencyFromOutput (outputs )}},
2198+ {Name : "Uncore Max Frequency" , Description : "--uncore-max < GHz> " , Values : []string {uncoreMaxFrequencyFromOutput (outputs )}},
2199+ {Name : "Uncore Min Frequency" , Description : "--uncore-min < GHz> " , Values : []string {uncoreMinFrequencyFromOutput (outputs )}},
21972200 }... )
21982201 }
21992202 fields = append (fields , []Field {
2200- {Name : "Energy Performance Bias" , Values : []string {epbFromOutput (outputs )}},
2201- {Name : "Energy Performance Preference" , Values : []string {eppFromOutput (outputs )}},
2202- {Name : "Scaling Governor" , Values : []string {strings .TrimSpace (outputs [script .ScalingGovernorScriptName ].Stdout )}},
2203+ {Name : "Energy Performance Bias" , Description : "--epb <0-15>" , Values : []string {epbFromOutput (outputs )}},
2204+ {Name : "Energy Performance Preference" , Description : "--epp <0-255>" , Values : []string {eppFromOutput (outputs )}},
2205+ {Name : "Scaling Governor" , Description : "--gov <performance|powersave>" , Values : []string {strings .TrimSpace (outputs [script .ScalingGovernorScriptName ].Stdout )}},
22032206 }... )
22042207 // add ELC (for SRF, CWF and GNR only)
22052208 if strings .Contains (uarch , "SRF" ) || strings .Contains (uarch , "GNR" ) || strings .Contains (uarch , "CWF" ) {
2206- fields = append (fields , Field {Name : "Efficiency Latency Control" , Values : []string {elcSummaryFromOutput (outputs )}})
2209+ fields = append (fields , Field {Name : "Efficiency Latency Control" , Description : "--elc <default|latency-optimized>" , Values : []string {elcSummaryFromOutput (outputs )}})
22072210 }
22082211 // add prefetchers
22092212 for _ , pf := range prefetcherDefinitions {
@@ -2232,18 +2235,23 @@ func configurationTableValues(outputs map[string]script.ScriptOutput) []Field {
22322235 } else {
22332236 enabledDisabled = "Disabled"
22342237 }
2235- fields = append (fields , Field {Name : pf .ShortName + " prefetcher" , Values : []string {enabledDisabled }})
2238+ fields = append (fields ,
2239+ Field {
2240+ Name : pf .ShortName + " prefetcher" ,
2241+ Description : "--" + "pref-" + strings .ReplaceAll (strings .ToLower (pf .ShortName ), " " , "" ) + " <enable|disable>" ,
2242+ Values : []string {enabledDisabled }},
2243+ )
22362244 }
22372245 }
2238- // add C-states
2239- cstates := cstatesSummaryFromOutput (outputs )
2240- if cstates != "" {
2241- fields = append (fields , Field {Name : "C-states " , Values : []string {cstates }})
2246+ // add C6
2247+ c6 := c6FromOutput (outputs )
2248+ if c6 != "" {
2249+ fields = append (fields , Field {Name : "C6" , Description : "--c6 <enable|disable> " , Values : []string {c6 }})
22422250 }
22432251 // add C1 Demotion
22442252 c1Demotion := strings .TrimSpace (outputs [script .C1DemotionScriptName ].Stdout )
22452253 if c1Demotion != "" {
2246- fields = append (fields , Field {Name : "C1 Demotion" , Values : []string {c1Demotion }})
2254+ fields = append (fields , Field {Name : "C1 Demotion" , Description : "--c1-demotion <enable|disable>" , Values : []string {c1Demotion }})
22472255 }
22482256 return fields
22492257}
0 commit comments