From: Igor Redko <redkoi(a)virtuozzo.com>
Signed-off-by: Igor Redko <redkoi(a)virtuozzo.com>
Signed-off-by: Derbyshev Dmitry <dderbyshev(a)virtuozzo.com>
---
src/libvirt_qemu_probes.d | 4 ++++
src/qemu/qemu_driver.c | 7 +++++++
2 files changed, 11 insertions(+)
diff --git a/src/libvirt_qemu_probes.d b/src/libvirt_qemu_probes.d
index e4449a9..1a36026 100644
--- a/src/libvirt_qemu_probes.d
+++ b/src/libvirt_qemu_probes.d
@@ -19,4 +19,8 @@ provider libvirt {
probe qemu_monitor_io_read(void *mon, const char *buf, unsigned int len, int ret,
int errno);
probe qemu_monitor_io_write(void *mon, const char *buf, unsigned int len, int
ret, int errno);
probe qemu_monitor_io_send_fd(void *mon, int fd, int ret, int errno);
+
+ # Memory statistics caching
+ probe qemu_memstats_cache_expires(unsigned long long old_expire, unsigned long
long new_expire);
+ probe qemu_memstats_cache_expired(unsigned long long expire, unsigned long long
now);
};
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 616b87d..d14009e 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -105,6 +105,11 @@
#include "virnuma.h"
#include "dirname.h"
#include "network/bridge_driver.h"
+#include "virprobe.h"
+
+#ifdef WITH_DTRACE_PROBES
+# include "libvirt_qemu_probes.h"
+#endif
#define VIR_FROM_THIS VIR_FROM_QEMU
@@ -11000,6 +11005,7 @@ qemuDomainCacheMemoryStats(virDomainObjPtr vm,
/* period also in secs */
expires = (timestamp > now) ? now : timestamp + def->memballoon->period *
1000;
+ PROBE(QEMU_MEMSTATS_CACHE_EXPIRES, "old=%llu new=%llu",
priv->cacheExpires, expires);
if (expires < now || expires <= priv->cacheExpires)
goto cleanup;
@@ -11032,6 +11038,7 @@ qemuDomainCachedMemoryStats(virDomainObjPtr vm,
goto cleanup;
if (now > priv->cacheExpires){
+ PROBE(QEMU_MEMSTATS_CACHE_EXPIRED, "old=%llu new=%llu",
priv->cacheExpires, now);
goto cleanup;
}
--
1.9.5.msysgit.0