k3s/vendor/github.com/opencontainers/runc/libcontainer/intelrdt/cmt.go

24 lines
455 B
Go
Raw Normal View History

2020-08-10 17:43:49 +00:00
package intelrdt
var cmtEnabled bool
2020-08-10 17:43:49 +00:00
// Check if Intel RDT/CMT is enabled.
func IsCMTEnabled() bool {
featuresInit()
2020-08-10 17:43:49 +00:00
return cmtEnabled
}
func getCMTNumaNodeStats(numaPath string) (*CMTNumaNodeStats, error) {
stats := &CMTNumaNodeStats{}
if enabledMonFeatures.llcOccupancy {
llcOccupancy, err := getIntelRdtParamUint(numaPath, "llc_occupancy")
if err != nil {
return nil, err
}
stats.LLCOccupancy = llcOccupancy
2020-08-10 17:43:49 +00:00
}
return stats, nil
}