[libvirt] [PATCH go] Add support for perf cache_l1d event

Daniel P. Berrange berrange at redhat.com
Tue Jan 10 10:48:02 UTC 2017


Signed-off-by: Daniel P. Berrange <berrange at redhat.com>
---

Pushed as a build fix

 connect.go      | 6 ++++++
 domain.go       | 6 ++++++
 domain_compat.h | 4 ++++
 3 files changed, 16 insertions(+)

diff --git a/connect.go b/connect.go
index 35eb7fd..41c54b1 100644
--- a/connect.go
+++ b/connect.go
@@ -2253,6 +2253,8 @@ type DomainStatsPerf struct {
 	StalledCyclesBackend     uint64
 	RefCpuCyclesSet          bool
 	RefCpuCycles             uint64
+	CacheL1DSet              bool
+	CacheL1D                 uint64
 }
 
 func getDomainStatsPerfFieldInfo(params *DomainStatsPerf) map[string]typedParamsFieldInfo {
@@ -2309,6 +2311,10 @@ func getDomainStatsPerfFieldInfo(params *DomainStatsPerf) map[string]typedParams
 			set: &params.RefCpuCyclesSet,
 			ul:  &params.RefCpuCycles,
 		},
+		"perf.cache_l1d": typedParamsFieldInfo{
+			set: &params.CacheL1DSet,
+			ul:  &params.CacheL1D,
+		},
 	}
 }
 
diff --git a/domain.go b/domain.go
index 515138a..3e66dab 100644
--- a/domain.go
+++ b/domain.go
@@ -3183,6 +3183,8 @@ type DomainPerfEvents struct {
 	StalledCyclesBackend     bool
 	RefCpuCyclesSet          bool
 	RefCpuCycles             bool
+	CacheL1DSet              bool
+	CacheL1D                 bool
 }
 
 /* Remember to also update DomainStatsPerf in connect.go when adding to the stuct above */
@@ -3241,6 +3243,10 @@ func getDomainPerfEventsFieldInfo(params *DomainPerfEvents) map[string]typedPara
 			set: &params.RefCpuCyclesSet,
 			b:   &params.RefCpuCycles,
 		},
+		C.VIR_PERF_PARAM_CACHE_L1D: typedParamsFieldInfo{
+			set: &params.CacheL1DSet,
+			b:   &params.CacheL1D,
+		},
 	}
 }
 
diff --git a/domain_compat.h b/domain_compat.h
index 14072d0..4da562b 100644
--- a/domain_compat.h
+++ b/domain_compat.h
@@ -45,6 +45,10 @@
 #define VIR_PERF_PARAM_REF_CPU_CYCLES "ref_cpu_cycles"
 #endif
 
+#ifndef VIR_PERF_PARAM_CACHE_L1D
+#define VIR_PERF_PARAM_CACHE_L1D "cache_l1d"
+#endif
+
 #ifndef VIR_DOMAIN_EVENT_ID_METADATA_CHANGE
 #define VIR_DOMAIN_EVENT_ID_METADATA_CHANGE 23
 #endif
-- 
2.9.3




More information about the libvir-list mailing list