aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel P. Berrange <berrange@redhat.com>2010-09-14 17:30:32 +0100
committerDaniel P. Berrange <berrange@redhat.com>2010-10-22 12:00:39 +0100
commit968eb4e5cdb2175bb283218c2339be110874ffff (patch)
tree981e442ec4d91438d0c9a3dd789652c846fd5243 /examples/systemtap
parentAdd test suite for virSocket APIs (diff)
downloadlibvirt-968eb4e5cdb2175bb283218c2339be110874ffff.tar.gz
libvirt-968eb4e5cdb2175bb283218c2339be110874ffff.tar.bz2
libvirt-968eb4e5cdb2175bb283218c2339be110874ffff.zip
Add dtrace static probes in libvirtd
Adds initial support for dtrace static probes in libvirtd daemon, assuming use of systemtap dtrace compat shim on Linux. The probes are inserted for network client connect, disconnect, TLS handshake states and authentication protocol states. This can be tested by running the xample program and then attempting to connect with any libvirt client (virsh, virt-manager, etc). # stap examples/systemtap/client.stp Client fd=44 connected readonly=0 Client fd=44 auth polkit deny pid:24997,uid:500 Client fd=44 disconnected Client fd=46 connected readonly=1 Client fd=46 auth sasl allow test Client fd=46 disconnected The libvirtd.stp file should also really not be required, since it is duplicated info that is already available in the main probes.d definition file. A script to autogenerate the .stp file is needed, either in libvirtd tree, or better as part of systemtap itself. * Makefile.am: Add examples/systemtap subdir * autobuild.sh: Disable dtrace for mingw32 * configure.ac: Add check for dtrace * daemon/.gitignore: Ignore generated dtrace probe file * daemon/Makefile.am: Build dtrace probe header & object files * daemon/libvirtd.stp: SystemTAP convenience probeset * daemon/libvirtd.c: Add connect/disconnect & TLS probes * daemon/remote.c: Add SASL and PolicyKit auth probes * daemon/probes.d: Master probe definition * daemon/libvirtd.h: Add convenience macro for probes so that compilation is a no-op when dtrace is not available * examples/systemtap/Makefile.am, examples/systemtap/client.stp Example systemtap script using dtrace probe markers * libvirt.spec.in: Enable dtrace on F13/RHEL6 * mingw32-libvirt.spec.in: Force disable dtrace
Diffstat (limited to 'examples/systemtap')
-rw-r--r--examples/systemtap/Makefile.am2
-rw-r--r--examples/systemtap/client.stp28
2 files changed, 30 insertions, 0 deletions
diff --git a/examples/systemtap/Makefile.am b/examples/systemtap/Makefile.am
new file mode 100644
index 000000000..084081e54
--- /dev/null
+++ b/examples/systemtap/Makefile.am
@@ -0,0 +1,2 @@
+
+EXTRA_DIST = client.stp
diff --git a/examples/systemtap/client.stp b/examples/systemtap/client.stp
new file mode 100644
index 000000000..00df15a36
--- /dev/null
+++ b/examples/systemtap/client.stp
@@ -0,0 +1,28 @@
+#!/usr/bin/stap
+
+probe libvirt.daemon.client.connect {
+ printf("Client fd=%d connected readonly=%d\n", fd, readonly);
+}
+probe libvirt.daemon.client.disconnect {
+ printf("Client fd=%d disconnected\n", fd);
+}
+
+probe libvirt.daemon.client.tls_allow {
+ printf("Client fd=%d tls allow %s\n", fd, x509dname);
+}
+probe libvirt.daemon.client.tls_deny {
+ printf("Client fd=%d tls deny %s\n", fd, x509dname);
+}
+probe libvirt.daemon.client.tls_fail {
+ printf("Client fd=%d tls fail\n", fd);
+}
+
+probe libvirt.daemon.client.auth_allow {
+ printf("Client fd=%d auth %s allow %s\n", fd, authname, identity);
+}
+probe libvirt.daemon.client.auth_deny {
+ printf("Client fd=%d auth %s deny %s\n", fd, authname, identity);
+}
+probe libvirt.daemon.client.auth_fail {
+ printf("Client fd=%d auth %s fail\n", fd, authname);
+}