2020-08-10 17:43:49 +00:00
|
|
|
package intelrdt
|
|
|
|
|
2021-07-02 08:43:15 +00:00
|
|
|
var cmtEnabled bool
|
2020-08-10 17:43:49 +00:00
|
|
|
|
|
|
|
// Check if Intel RDT/CMT is enabled.
|
|
|
|
func IsCMTEnabled() bool {
|
2021-04-14 18:11:13 +00:00
|
|
|
featuresInit()
|
2020-08-10 17:43:49 +00:00
|
|
|
return cmtEnabled
|
|
|
|
}
|
|
|
|
|
|
|
|
func getCMTNumaNodeStats(numaPath string) (*CMTNumaNodeStats, error) {
|
|
|
|
stats := &CMTNumaNodeStats{}
|
|
|
|
|
2021-04-14 18:11:13 +00:00
|
|
|
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
|
|
|
|
}
|