@@ -522,6 +522,27 @@ func channelsFromOutput(outputs map[string]script.ScriptOutput) string {
522522 return fmt .Sprintf ("%d" , cpu .MemoryChannelCount )
523523}
524524
525+ func turboEnabledFromOutput (outputs map [string ]script.ScriptOutput ) string {
526+ vendor := valFromRegexSubmatch (outputs [script .LscpuScriptName ].Stdout , `^Vendor ID:\s*(.+)$` )
527+ switch vendor {
528+ case "GenuineIntel" :
529+ val := valFromRegexSubmatch (outputs [script .CpuidScriptName ].Stdout , `^Intel Turbo Boost Technology\s*= (.+?)$` )
530+ if val == "true" {
531+ return "Enabled"
532+ }
533+ if val == "false" {
534+ return "Disabled"
535+ }
536+ return "" // unknown value
537+ case "AuthenticAMD" :
538+ val := valFromRegexSubmatch (outputs [script .LscpuScriptName ].Stdout , `^Frequency boost.*:\s*(.+?)$` )
539+ if val != "" {
540+ return val + " (AMD Frequency Boost)"
541+ }
542+ }
543+ return ""
544+ }
545+
525546func isPrefetcherEnabled (msrValue string , bit int ) (bool , error ) {
526547 if msrValue == "" {
527548 return false , fmt .Errorf ("msrValue is empty" )
@@ -1813,9 +1834,9 @@ func cveSummaryFromOutput(outputs map[string]script.ScriptOutput) string {
18131834}
18141835
18151836func systemSummaryFromOutput (outputs map [string ]script.ScriptOutput ) string {
1816- // BASELINE: 1-node, 2x Intel® Xeon® <SKU, processor>, xx cores, 100W TDP, HT On/Off?, Total Memory xxx GB (xx slots/ xx GB/ xxxx MHz [run @ xxxx MHz] ), <BIOS version>, <ucode version>, <OS Version>, <kernel version>. Test by Intel as of <mm/dd/yy>.
1817- template := "1-node, %sx %s, %s cores, %s TDP, HT %s, Total Memory %s, BIOS %s, microcode %s, %s, %s, %s, %s. Test by Intel as of %s."
1818- var socketCount , cpuModel , coreCount , tdp , htOnOff , installedMem , biosVersion , uCodeVersion , nics , disks , operatingSystem , kernelVersion , date string
1837+ // BASELINE: 1-node, 2x Intel® Xeon® <SKU, processor>, xx cores, 100W TDP, HT On/Off?, Turbo On/Off?, Total Memory xxx GB (xx slots/ xx GB/ xxxx MHz [run @ xxxx MHz] ), <BIOS version>, <ucode version>, <OS Version>, <kernel version>. Test by Intel as of <mm/dd/yy>.
1838+ template := "1-node, %sx %s, %s cores, %s TDP, HT %s, Turbo %s, Total Memory %s, BIOS %s, microcode %s, %s, %s, %s, %s. Test by Intel as of %s."
1839+ var socketCount , cpuModel , coreCount , tdp , htOnOff , turboOnOff , installedMem , biosVersion , uCodeVersion , nics , disks , operatingSystem , kernelVersion , date string
18191840
18201841 // socket count
18211842 socketCount = valFromRegexSubmatch (outputs [script .LscpuScriptName ].Stdout , `^Socket\(s\):\s*(\d+)$` )
@@ -1840,6 +1861,15 @@ func systemSummaryFromOutput(outputs map[string]script.ScriptOutput) string {
18401861 default :
18411862 htOnOff = "?"
18421863 }
1864+ // turbo
1865+ turboOnOff = turboEnabledFromOutput (outputs )
1866+ if strings .Contains (strings .ToLower (turboOnOff ), "enabled" ) {
1867+ turboOnOff = "On"
1868+ } else if strings .Contains (strings .ToLower (turboOnOff ), "disabled" ) {
1869+ turboOnOff = "Off"
1870+ } else {
1871+ turboOnOff = "?"
1872+ }
18431873 // memory
18441874 installedMem = installedMemoryFromOutput (outputs )
18451875 // BIOS
@@ -1857,7 +1887,7 @@ func systemSummaryFromOutput(outputs map[string]script.ScriptOutput) string {
18571887 // date
18581888 date = strings .TrimSpace (outputs [script .DateScriptName ].Stdout )
18591889 // put it all together
1860- return fmt .Sprintf (template , socketCount , cpuModel , coreCount , tdp , htOnOff , installedMem , biosVersion , uCodeVersion , nics , disks , operatingSystem , kernelVersion , date )
1890+ return fmt .Sprintf (template , socketCount , cpuModel , coreCount , tdp , htOnOff , turboOnOff , installedMem , biosVersion , uCodeVersion , nics , disks , operatingSystem , kernelVersion , date )
18611891}
18621892
18631893// getSectionsFromOutput parses output into sections, where the section name
0 commit comments