diff --git a/src/reporter/report_tables.go b/src/reporter/report_tables.go index 7235245..99db3a4 100644 --- a/src/reporter/report_tables.go +++ b/src/reporter/report_tables.go @@ -705,6 +705,7 @@ func newCPUTable(sources []*Source, cpusInfo *cpu.CPU, category TableCategory) ( if err != nil { channels = "Unknown" } + virtualization := source.valFromRegexSubmatch("lscpu", `^Virtualization.*:\s*(.+?)$`) var hostValues = HostValues{ Name: source.getHostname(), ValueNames: []string{ @@ -757,11 +758,11 @@ func newCPUTable(sources []*Source, cpusInfo *cpu.CPU, category TableCategory) ( source.valFromRegexSubmatch("lscpu", `^L1i cache.*:\s*(.+?)$`), source.valFromRegexSubmatch("lscpu", `^L2 cache.*:\s*(.+?)$`), source.getL3(microarchitecture), - source.getL3PerCore(microarchitecture, coresPerSocket, sockets), + source.getL3PerCore(microarchitecture, coresPerSocket, sockets, virtualization), channels, source.getPrefetchers(), source.getTurboEnabled(family), - source.valFromRegexSubmatch("lscpu", `^Virtualization.*:\s*(.+?)$`), + virtualization, source.getPPINs(), }, }, diff --git a/src/reporter/source.go b/src/reporter/source.go index 3c36550..72a7fb9 100644 --- a/src/reporter/source.go +++ b/src/reporter/source.go @@ -472,7 +472,7 @@ func (s *Source) getCacheWays(uArch string) (cacheWays []int64) { wayCount = 12 } else if uArch == "SPR_MCC" || uArch == "SPR_XCC" { wayCount = 15 - } else if uArch == "EMR" { + } else if uArch == "EMR_MCC" || uArch == "EMR_XCC" { wayCount = 20 } else { return @@ -564,7 +564,11 @@ func (s *Source) getL3(uArch string) (val string) { return } -func (s *Source) getL3PerCore(uArch string, coresPerSocketStr string, socketsStr string) (val string) { +func (s *Source) getL3PerCore(uArch string, coresPerSocketStr string, socketsStr string, virtualization string) (val string) { + if virtualization == "full" { + log.Printf("Can't calculate L3 per Core on virtualized host.") + return + } l3, err := strconv.ParseFloat(strings.Split(s.getL3(uArch), " ")[0], 64) if err != nil { return