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
2010-09-14 16:30:32 +00:00
|
|
|
probe libvirt.daemon.client.connect = process("libvirtd").mark("client_connect")
|
|
|
|
{
|
|
|
|
fd = $arg1;
|
|
|
|
readonly = $arg2;
|
2010-10-21 14:45:12 +00:00
|
|
|
localAddr = user_string($arg3);
|
|
|
|
remoteAddr = user_string($arg4);
|
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
2010-09-14 16:30:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
probe libvirt.daemon.client.disconnect = process("libvirtd").mark("client_disconnect")
|
|
|
|
{
|
|
|
|
fd = $arg1;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
probe libvirt.daemon.client.tls_allow = process("libvirtd").mark("client_tls_allow")
|
|
|
|
{
|
|
|
|
fd = $arg1;
|
|
|
|
x509dname = user_string($arg2);
|
|
|
|
}
|
|
|
|
|
|
|
|
probe libvirt.daemon.client.tls_deny = process("libvirtd").mark("client_tls_deny")
|
|
|
|
{
|
|
|
|
fd = $arg1;
|
|
|
|
x509dname = user_string($arg2);
|
|
|
|
}
|
|
|
|
|
|
|
|
probe libvirt.daemon.client.tls_fail = process("libvirtd").mark("client_tls_fail")
|
|
|
|
{
|
|
|
|
fd = $arg1;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function authtype_to_string(authtype) {
|
|
|
|
if (authtype == 0)
|
|
|
|
return "none"
|
|
|
|
if (authtype == 1)
|
|
|
|
return "sasl"
|
|
|
|
if (authtype == 2)
|
|
|
|
return "polkit"
|
|
|
|
return "unknown"
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
probe libvirt.daemon.client.auth_allow = process("libvirtd").mark("client_auth_allow")
|
|
|
|
{
|
|
|
|
fd = $arg1;
|
|
|
|
authtype = $arg2;
|
|
|
|
authname = authtype_to_string($arg2);
|
|
|
|
identity = user_string($arg3);
|
|
|
|
}
|
|
|
|
|
|
|
|
probe libvirt.daemon.client.auth_deny = process("libvirtd").mark("client_auth_deny")
|
|
|
|
{
|
|
|
|
fd = $arg1;
|
|
|
|
authtype = $arg2;
|
|
|
|
authname = authtype_to_string($arg2);
|
|
|
|
identity = user_string($arg3);
|
|
|
|
}
|
|
|
|
|
|
|
|
probe libvirt.daemon.client.auth_fail = process("libvirtd").mark("client_auth_fail")
|
|
|
|
{
|
|
|
|
fd = $arg1;
|
|
|
|
authtype = $arg2;
|
|
|
|
authname = authtype_to_string($arg2);
|
|
|
|
}
|