[libvirt-perl][PATCH 2/2] Add more PERF_PARAM_* constants

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Libvirt introduce PERF_PARAM_CACHE_MISSES,
PERF_PARAM_CACHE_REFERENCES, PERF_PARAM_CPU_CYCLES,
PERF_PARAM_INSTRUCTIONS constants. Add those to our perl bindings
too.

Signed-off-by: Michal Privoznik <mprivozn@xxxxxxxxxx>
---
 Changes                |  3 ++-
 Virt.xs                |  4 ++++
 lib/Sys/Virt/Domain.pm | 27 +++++++++++++++++++++++++++
 3 files changed, 33 insertions(+), 1 deletion(-)

diff --git a/Changes b/Changes
index 20a20a2..a2c2865 100644
--- a/Changes
+++ b/Changes
@@ -2,7 +2,8 @@ Revision history for perl module Sys::Virt
 
 2.3.0 2016-00-00
 
- - XXX
+ - Add PERF_PARAM_CACHE_MISSES, PERF_PARAM_CACHE_REFERENCES,
+   PERF_PARAM_CPU_CYCLES, PERF_PARAM_INSTRUCTIONS constants
 
 2.2.0 2016-00-00
 
diff --git a/Virt.xs b/Virt.xs
index d4eac47..ac337ad 100644
--- a/Virt.xs
+++ b/Virt.xs
@@ -8289,6 +8289,10 @@ BOOT:
       REGISTER_CONSTANT_STR(VIR_PERF_PARAM_CMT, PERF_PARAM_CMT);
       REGISTER_CONSTANT_STR(VIR_PERF_PARAM_MBML, PERF_PARAM_MBML);
       REGISTER_CONSTANT_STR(VIR_PERF_PARAM_MBMT, PERF_PARAM_MBMT);
+      REGISTER_CONSTANT_STR(VIR_PERF_PARAM_CACHE_MISSES, PERF_PARAM_CACHE_MISSES);
+      REGISTER_CONSTANT_STR(VIR_PERF_PARAM_CACHE_REFERENCES, PERF_PARAM_CACHE_REFERENCES);
+      REGISTER_CONSTANT_STR(VIR_PERF_PARAM_CPU_CYCLES, PERF_PARAM_CPU_CYCLES);
+      REGISTER_CONSTANT_STR(VIR_PERF_PARAM_INSTRUCTIONS, PERF_PARAM_INSTRUCTIONS);
 
       REGISTER_CONSTANT_STR(VIR_DOMAIN_BANDWIDTH_IN_AVERAGE, BANDWIDTH_IN_AVERAGE);
       REGISTER_CONSTANT_STR(VIR_DOMAIN_BANDWIDTH_IN_PEAK, BANDWIDTH_IN_PEAK);
diff --git a/lib/Sys/Virt/Domain.pm b/lib/Sys/Virt/Domain.pm
index 21c2729..061560f 100644
--- a/lib/Sys/Virt/Domain.pm
+++ b/lib/Sys/Virt/Domain.pm
@@ -2707,6 +2707,33 @@ The MBMT event counter which can be used to monitor total system
 bandwidth (bytes/s) from one level of cache to another. It
 corresponds to the "perf.mbmt" field in the *Stats APIs.
 
+=item Sys::Virt::Domain::PERF_PARAM_CACHE_MISSES
+
+The cache_misses perf event counter which can be used to measure
+the count of cache misses by applications running on the
+platform. It corresponds to the "perf.cache_misses" field in the
+*Stats APIs.
+
+=item Sys::Virt::Domain::PERF_PARAM_CACHE_REFERENCES
+
+The cache_references perf event counter which can be used to
+measure the count of cache hits by applications running on the
+platform. It corresponds to the "perf.cache_references" field in
+the *Stats APIs.
+
+=item Sys::Virt::Domain::PERF_PARAM_CPU_CYCLES
+
+The instructions perf event counter which can be used to measure
+the count of instructions by applications running on the
+platform. It corresponds to the "perf.instructions" field in the
+*Stats APIs.
+
+=item Sys::Virt::Domain::PERF_PARAM_INSTRUCTIONS
+
+The cpu_cycles perf event counter which can be used to measure
+how many cpu cycles one instruction needs.  It corresponds to the
+"perf.cpu_cycles" field in the *Stats APIs.
+
 =back
 
 =head2 VCPU FLAGS
-- 
2.8.4

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]