Commit 3d300833 authored by Daniel P. Berrange's avatar Daniel P. Berrange

Add support for new perf event constants

Signed-off-by: default avatarDaniel P. Berrange <berrange@redhat.com>
parent e454eb07
......@@ -2227,20 +2227,32 @@ func getDomainStatsBlockFieldInfo(idx int, params *DomainStatsBlock) map[string]
}
type DomainStatsPerf struct {
CmtSet bool
Cmt uint64
MbmtSet bool
Mbmt uint64
MbmlSet bool
Mbml uint64
CacheMissesSet bool
CacheMisses uint64
CacheReferencesSet bool
CacheReferences uint64
InstructionsSet bool
Instructions uint64
CpuCyclesSet bool
CpuCycles uint64
CmtSet bool
Cmt uint64
MbmtSet bool
Mbmt uint64
MbmlSet bool
Mbml uint64
CacheMissesSet bool
CacheMisses uint64
CacheReferencesSet bool
CacheReferences uint64
InstructionsSet bool
Instructions uint64
CpuCyclesSet bool
CpuCycles uint64
BranchInstructionsSet bool
BranchInstructions uint64
BranchMissesSet bool
BranchMisses uint64
BusCyclesSet bool
BusCycles uint64
StalledCyclesFrontendSet bool
StalledCyclesFrontend uint64
StalledCyclesBackendSet bool
StalledCyclesBackend uint64
RefCpuCyclesSet bool
RefCpuCycles uint64
}
func getDomainStatsPerfFieldInfo(params *DomainStatsPerf) map[string]typedParamsFieldInfo {
......@@ -2273,6 +2285,30 @@ func getDomainStatsPerfFieldInfo(params *DomainStatsPerf) map[string]typedParams
set: &params.CpuCyclesSet,
ul: &params.CpuCycles,
},
"perf.branch_instructions": typedParamsFieldInfo{
set: &params.BranchInstructionsSet,
ul: &params.BranchInstructions,
},
"perf.branch_misses": typedParamsFieldInfo{
set: &params.BranchMissesSet,
ul: &params.BranchMisses,
},
"perf.bus_cycles": typedParamsFieldInfo{
set: &params.BusCyclesSet,
ul: &params.BusCycles,
},
"perf.stalled_cycles_frontend": typedParamsFieldInfo{
set: &params.StalledCyclesFrontendSet,
ul: &params.StalledCyclesFrontend,
},
"perf.stalled_cycles_backend": typedParamsFieldInfo{
set: &params.StalledCyclesBackendSet,
ul: &params.StalledCyclesBackend,
},
"perf.ref_cpu_cycles": typedParamsFieldInfo{
set: &params.RefCpuCyclesSet,
ul: &params.RefCpuCycles,
},
}
}
......
......@@ -3157,25 +3157,35 @@ func (d *Domain) SetNumaParameters(params *DomainNumaParameters, flags DomainMod
}
type DomainPerfEvents struct {
CmtSet bool
Cmt bool
MbmtSet bool
Mbmt bool
MbmlSet bool
Mbml bool
CacheMissesSet bool
CacheMisses bool
CacheReferencesSet bool
CacheReferences bool
InstructionsSet bool
Instructions bool
CpuCyclesSet bool
CpuCycles bool
BranchInstructionsSet bool
BranchInstructions bool
BranchMissesSet bool
BranchMisses bool
}
CmtSet bool
Cmt bool
MbmtSet bool
Mbmt bool
MbmlSet bool
Mbml bool
CacheMissesSet bool
CacheMisses bool
CacheReferencesSet bool
CacheReferences bool
InstructionsSet bool
Instructions bool
CpuCyclesSet bool
CpuCycles bool
BranchInstructionsSet bool
BranchInstructions bool
BranchMissesSet bool
BranchMisses bool
BusCyclesSet bool
BusCycles bool
StalledCyclesFrontendSet bool
StalledCyclesFrontend bool
StalledCyclesBackendSet bool
StalledCyclesBackend bool
RefCpuCyclesSet bool
RefCpuCycles bool
}
/* Remember to also update DomainStatsPerf in connect.go when adding to the stuct above */
func getDomainPerfEventsFieldInfo(params *DomainPerfEvents) map[string]typedParamsFieldInfo {
return map[string]typedParamsFieldInfo{
......@@ -3215,6 +3225,22 @@ func getDomainPerfEventsFieldInfo(params *DomainPerfEvents) map[string]typedPara
set: &params.BranchMissesSet,
b: &params.BranchMisses,
},
C.VIR_PERF_PARAM_BUS_CYCLES: typedParamsFieldInfo{
set: &params.BusCyclesSet,
b: &params.BusCycles,
},
C.VIR_PERF_PARAM_STALLED_CYCLES_FRONTEND: typedParamsFieldInfo{
set: &params.StalledCyclesFrontendSet,
b: &params.StalledCyclesFrontend,
},
C.VIR_PERF_PARAM_STALLED_CYCLES_BACKEND: typedParamsFieldInfo{
set: &params.StalledCyclesBackendSet,
b: &params.StalledCyclesBackend,
},
C.VIR_PERF_PARAM_REF_CPU_CYCLES: typedParamsFieldInfo{
set: &params.RefCpuCyclesSet,
b: &params.RefCpuCycles,
},
}
}
......
......@@ -27,6 +27,25 @@
#ifndef LIBVIRT_GO_DOMAIN_COMPAT_H__
#define LIBVIRT_GO_DOMAIN_COMPAT_H__
/* 3.0.0 */
#ifndef VIR_PERF_PARAM_BUS_CYCLES
#define VIR_PERF_PARAM_BUS_CYCLES "bus_cycles"
#endif
#ifndef VIR_PERF_PARAM_STALLED_CYCLES_FRONTEND
#define VIR_PERF_PARAM_STALLED_CYCLES_FRONTEND "stalled_cycles_frontend"
#endif
#ifndef VIR_PERF_PARAM_STALLED_CYCLES_BACKEND
#define VIR_PERF_PARAM_STALLED_CYCLES_BACKEND "stalled_cycles_backend"
#endif
#ifndef VIR_PERF_PARAM_REF_CPU_CYCLES
#define VIR_PERF_PARAM_REF_CPU_CYCLES "ref_cpu_cycles"
#endif
/* 1.2.2 */
#ifndef VIR_DOMAIN_BLKIO_DEVICE_READ_IOPS
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment