Commit 26fdc913 authored by Nitesh Konkar's avatar Nitesh Konkar Committed by John Ferlan

Add support for perf events

Signed-off-by: default avatarNitesh Konkar <nitkon12@linux.vnet.ibm.com>
parent e9642325
......@@ -2264,6 +2264,24 @@ type DomainStatsPerf struct {
StalledCyclesBackend uint64
RefCpuCyclesSet bool
RefCpuCycles uint64
CpuClockSet bool
CpuClock uint64
TaskClockSet bool
TaskClock uint64
PageFaultsSet bool
PageFaults uint64
ContextSwitchesSet bool
ContextSwitches uint64
CpuMigrationsSet bool
CpuMigrations uint64
PageFaultsMinSet bool
PageFaultsMin uint64
PageFaultsMajSet bool
PageFaultsMaj uint64
AlignmentFaultsSet bool
AlignmentFaults uint64
EmulationFaultsSet bool
EmulationFaults uint64
}
func getDomainStatsPerfFieldInfo(params *DomainStatsPerf) map[string]typedParamsFieldInfo {
......@@ -2320,6 +2338,42 @@ func getDomainStatsPerfFieldInfo(params *DomainStatsPerf) map[string]typedParams
set: &params.RefCpuCyclesSet,
ul: &params.RefCpuCycles,
},
"perf.cpu_clock": typedParamsFieldInfo{
set: &params.CpuClockSet,
ul: &params.CpuClock,
},
"perf.task_clock": typedParamsFieldInfo{
set: &params.TaskClockSet,
ul: &params.TaskClock,
},
"perf.page_faults": typedParamsFieldInfo{
set: &params.PageFaultsSet,
ul: &params.PageFaults,
},
"perf.context_switches": typedParamsFieldInfo{
set: &params.ContextSwitchesSet,
ul: &params.ContextSwitches,
},
"perf.cpu_migrations": typedParamsFieldInfo{
set: &params.CpuMigrationsSet,
ul: &params.CpuMigrations,
},
"perf.page_faults_min": typedParamsFieldInfo{
set: &params.PageFaultsMinSet,
ul: &params.PageFaultsMin,
},
"perf.page_faults_maj": typedParamsFieldInfo{
set: &params.PageFaultsMajSet,
ul: &params.PageFaultsMaj,
},
"perf.alignment_faults": typedParamsFieldInfo{
set: &params.AlignmentFaultsSet,
ul: &params.AlignmentFaults,
},
"perf.emulation_faults": typedParamsFieldInfo{
set: &params.EmulationFaultsSet,
ul: &params.EmulationFaults,
},
}
}
......
......@@ -3195,6 +3195,24 @@ type DomainPerfEvents struct {
StalledCyclesBackend bool
RefCpuCyclesSet bool
RefCpuCycles bool
CpuClockSet bool
CpuClock bool
TaskClockSet bool
TaskClock bool
PageFaultsSet bool
PageFaults bool
ContextSwitchesSet bool
ContextSwitches bool
CpuMigrationsSet bool
CpuMigrations bool
PageFaultsMinSet bool
PageFaultsMin bool
PageFaultsMajSet bool
PageFaultsMaj bool
AlignmentFaultsSet bool
AlignmentFaults bool
EmulationFaultsSet bool
EmulationFaults bool
}
/* Remember to also update DomainStatsPerf in connect.go when adding to the stuct above */
......@@ -3253,6 +3271,42 @@ func getDomainPerfEventsFieldInfo(params *DomainPerfEvents) map[string]typedPara
set: &params.RefCpuCyclesSet,
b: &params.RefCpuCycles,
},
C.VIR_PERF_PARAM_CPU_CLOCK: typedParamsFieldInfo{
set: &params.CpuClockSet,
b: &params.CpuClock,
},
C.VIR_PERF_PARAM_TASK_CLOCK: typedParamsFieldInfo{
set: &params.TaskClockSet,
b: &params.TaskClock,
},
C.VIR_PERF_PARAM_PAGE_FAULTS: typedParamsFieldInfo{
set: &params.PageFaultsSet,
b: &params.PageFaults,
},
C.VIR_PERF_PARAM_CONTEXT_SWITCHES: typedParamsFieldInfo{
set: &params.ContextSwitchesSet,
b: &params.ContextSwitches,
},
C.VIR_PERF_PARAM_CPU_MIGRATIONS: typedParamsFieldInfo{
set: &params.CpuMigrationsSet,
b: &params.CpuMigrations,
},
C.VIR_PERF_PARAM_PAGE_FAULTS_MIN: typedParamsFieldInfo{
set: &params.PageFaultsMinSet,
b: &params.PageFaultsMin,
},
C.VIR_PERF_PARAM_PAGE_FAULTS_MAJ: typedParamsFieldInfo{
set: &params.PageFaultsMajSet,
b: &params.PageFaultsMaj,
},
C.VIR_PERF_PARAM_ALIGNMENT_FAULTS: typedParamsFieldInfo{
set: &params.AlignmentFaultsSet,
b: &params.AlignmentFaults,
},
C.VIR_PERF_PARAM_REF_EMULATION_FAULTS: typedParamsFieldInfo{
set: &params.EmulationFaultsSet,
b: &params.EmulationFaults,
},
}
}
......
......@@ -45,6 +45,42 @@
#define VIR_PERF_PARAM_REF_CPU_CYCLES "ref_cpu_cycles"
#endif
#ifndef VIR_PERF_PARAM_CPU_CLOCK
#define VIR_PERF_PARAM_CPU_CLOCK "cpu_clock"
#endif
#ifndef VIR_PERF_PARAM_TASK_CLOCK
#define VIR_PERF_PARAM_TASK_CLOCK "task_clock"
#endif
#ifndef VIR_PERF_PARAM_PAGE_FAULTS
#define VIR_PERF_PARAM_PAGE_FAULTS "page_faults"
#endif
#ifndef VIR_PERF_PARAM_CONTEXT_SWITCHES
#define VIR_PERF_PARAM_CONTEXT_SWITCHES "context_switches"
#endif
#ifndef VIR_PERF_PARAM_CPU_MIGRATIONS
#define VIR_PERF_PARAM_CPU_MIGRATIONS "cpu_migrations"
#endif
#ifndef VIR_PERF_PARAM_PAGE_FAULTS_MIN
#define VIR_PERF_PARAM_PAGE_FAULTS_MIN "page_faults_min"
#endif
#ifndef VIR_PERF_PARAM_PAGE_FAULTS_MAJ
#define VIR_PERF_PARAM_PAGE_FAULTS_MAJ "page_faults_maj"
#endif
#ifndef VIR_PERF_PARAM_ALIGNMENT_FAULTS
#define VIR_PERF_PARAM__ALIGNMENT_FAULTS "alignment_faults"
#endif
#ifndef VIR_PERF_PARAM_EMULATION_FAULTS
#define VIR_PERF_PARAM_EMULATION_FAULTS "emulation_faults"
#endif
#ifndef VIR_DOMAIN_EVENT_ID_METADATA_CHANGE
#define VIR_DOMAIN_EVENT_ID_METADATA_CHANGE 23
#endif
......
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