File: mbm.go

package info (click to toggle)
runc 1.0.3%2Bds1-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 2,836 kB
  • sloc: sh: 1,571; ansic: 1,236; makefile: 136
file content (33 lines) | stat: -rw-r--r-- 725 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// +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
}