mirror of
https://github.com/opencontainers/runc.git
synced 2025-09-26 19:41:35 +08:00

gofumpt (mvdan.cc/gofumpt) is a fork of gofmt with stricter rules. Brought to you by git ls-files \*.go | grep -v ^vendor/ | xargs gofumpt -s -w Looking at the diff, all these changes make sense. Also, replace gofmt with gofumpt in golangci.yml. Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
34 lines
725 B
Go
34 lines
725 B
Go
// +build linux
|
|
|
|
package intelrdt
|
|
|
|
// The flag to indicate if Intel RDT/MBM is enabled
|
|
var mbmEnabled bool
|
|
|
|
// Check if Intel RDT/MBM is enabled.
|
|
func IsMBMEnabled() bool {
|
|
featuresInit()
|
|
return mbmEnabled
|
|
}
|
|
|
|
func getMBMNumaNodeStats(numaPath string) (*MBMNumaNodeStats, error) {
|
|
stats := &MBMNumaNodeStats{}
|
|
if enabledMonFeatures.mbmTotalBytes {
|
|
mbmTotalBytes, err := getIntelRdtParamUint(numaPath, "mbm_total_bytes")
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
stats.MBMTotalBytes = mbmTotalBytes
|
|
}
|
|
|
|
if enabledMonFeatures.mbmLocalBytes {
|
|
mbmLocalBytes, err := getIntelRdtParamUint(numaPath, "mbm_local_bytes")
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
stats.MBMLocalBytes = mbmLocalBytes
|
|
}
|
|
|
|
return stats, nil
|
|
}
|