github.com/opencontainers/runc@v1.2.0-rc.1.0.20240520010911-492dc558cdd6/libcontainer/intelrdt/mbm.go (about) 1 package intelrdt 2 3 // The flag to indicate if Intel RDT/MBM is enabled 4 var mbmEnabled bool 5 6 // Check if Intel RDT/MBM is enabled. 7 func IsMBMEnabled() bool { 8 featuresInit() 9 return mbmEnabled 10 } 11 12 func getMBMNumaNodeStats(numaPath string) (*MBMNumaNodeStats, error) { 13 stats := &MBMNumaNodeStats{} 14 if enabledMonFeatures.mbmTotalBytes { 15 mbmTotalBytes, err := getIntelRdtParamUint(numaPath, "mbm_total_bytes") 16 if err != nil { 17 return nil, err 18 } 19 stats.MBMTotalBytes = mbmTotalBytes 20 } 21 22 if enabledMonFeatures.mbmLocalBytes { 23 mbmLocalBytes, err := getIntelRdtParamUint(numaPath, "mbm_local_bytes") 24 if err != nil { 25 return nil, err 26 } 27 stats.MBMLocalBytes = mbmLocalBytes 28 } 29 30 return stats, nil 31 }