Re: [PATCH] Add a systemtap script for watching QEMU monitor interactions

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

 



On 10/24/2011 08:37 AM, Daniel P. Berrange wrote:
From: "Daniel P. Berrange"<berrange@xxxxxxxxxx>

This change adds some systemtap/dtrace probes to the QEMU monitor
client code. In particular it allows watching of all operations
for a VM

* examples/systemtap/qemu-monitor.stp: Watch all monitor commands
* src/Makefile.am: Passing libdir/bindir/sbindir to dtrace2systemtap.pl
* src/dtrace2systemtap.pl: Accept libdir/bindir/sbindir as args
   and look for '# binary:' comment to mark probes against libvirtd
   vs libvirt.so
* src/qemu/qemu_monitor.c, src/qemu/qemu_monitor_json.c,
   src/qemu/qemu_monitor_text.c: Add probes for key functions
---
  examples/systemtap/qemu-monitor.stp |   81 +++++++++++++++++++++++++++++++++++
  src/Makefile.am                     |    2 +-
  src/dtrace2systemtap.pl             |   15 ++++++-
  src/probes.d                        |   20 +++++++++
  src/qemu/qemu_monitor.c             |   31 ++++++++++++-
  src/qemu/qemu_monitor_json.c        |    4 ++
  src/qemu/qemu_monitor_text.c        |    3 +
  7 files changed, 150 insertions(+), 6 deletions(-)
  create mode 100644 examples/systemtap/qemu-monitor.stp

@@ -66,7 +72,7 @@ while (<>) {
  		die "unexpected data $_ on line $.";
  	    }
  	} else {
-	    die "unexpected data $_ on line $.";
+	    #die "unexpected data $_ on line $.";

Alon pointed this out.

@@ -183,6 +183,8 @@ static void qemuMonitorFree(qemuMonitorPtr mon)
  int qemuMonitorRef(qemuMonitorPtr mon)
  {
      mon->refs++;
+    PROBE(QEMU_MONITOR_UNREF,
+          "mon=%p refs=%d", mon, mon->refs);

It looks weird seeing an UNREF inside qemuMonitorRef. Did you mean QEMU_MONITOR_REF?

ACK with those points addressed.

--
Eric Blake   eblake@xxxxxxxxxx    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

--
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]