dhcp/dhcp-systemtap.patch

826 lines
22 KiB
Diff
Raw Normal View History

2015-08-10 10:09:24 +00:00
diff -up dhcp-4.3.3b1/configure.ac.systemtap dhcp-4.3.3b1/configure.ac
--- dhcp-4.3.3b1/configure.ac.systemtap 2015-08-10 11:46:08.876892296 +0200
+++ dhcp-4.3.3b1/configure.ac 2015-08-10 11:46:08.913892156 +0200
@@ -574,6 +574,35 @@ else
AC_MSG_RESULT(no)
fi
+AC_MSG_CHECKING([whether to include systemtap tracing support])
+AC_ARG_ENABLE([systemtap],
+ [AS_HELP_STRING([--enable-systemtap],
+ [Enable inclusion of systemtap trace support])],
+ [ENABLE_SYSTEMTAP="${enableval}"], [ENABLE_SYSTEMTAP='no'])
+AM_CONDITIONAL([ENABLE_SYSTEMTAP], [test x$ENABLE_SYSTEMTAP = xyes])
+AC_MSG_RESULT(${ENABLE_SYSTEMTAP})
+
+if test "x${ENABLE_SYSTEMTAP}" = xyes; then
+ # Additional configuration for --enable-systemtap is HERE
+ AC_CHECK_PROGS(DTRACE, dtrace)
+ if test -z "$DTRACE"; then
+ AC_MSG_ERROR([dtrace not found])
+ fi
+ AC_CHECK_HEADER([sys/sdt.h], [SDT_H_FOUND='yes'],
+ [SDT_H_FOUND='no';
+ AC_MSG_ERROR([systemtap support needs sys/sdt.h header])])
+ AC_DEFINE([HAVE_SYSTEMTAP], [1], [Define to 1 if using SystemTap probes.])
+ AC_ARG_WITH([tapset-install-dir],
+ [AS_HELP_STRING([--with-tapset-install-dir],
+ [The absolute path where the tapset dir will be installed])],
+ [if test "x${withval}" = x; then
+ ABS_TAPSET_DIR="\$(datadir)/systemtap/tapset"
+ else
+ ABS_TAPSET_DIR="${withval}"
+ fi], [ABS_TAPSET_DIR="\$(datadir)/systemtap/tapset"])
+ AC_SUBST(ABS_TAPSET_DIR)
+fi
+
# Solaris needs some libraries for functions
AC_SEARCH_LIBS(socket, [socket])
AC_SEARCH_LIBS(inet_ntoa, [nsl])
2015-08-10 10:09:24 +00:00
@@ -778,6 +807,7 @@ AC_CONFIG_FILES([
2015-03-05 18:36:52 +00:00
tests/unittest.sh
2012-12-17 18:28:45 +00:00
server/tests/Makefile
doc/devel/doxyfile
+ tapset/Makefile
])
2013-12-20 15:13:52 +00:00
AC_OUTPUT
2015-08-10 10:09:24 +00:00
diff -up dhcp-4.3.3b1/Makefile.am.systemtap dhcp-4.3.3b1/Makefile.am
--- dhcp-4.3.3b1/Makefile.am.systemtap 2015-08-10 11:46:08.827892482 +0200
+++ dhcp-4.3.3b1/Makefile.am 2015-08-10 11:46:08.914892153 +0200
2014-07-10 17:01:31 +00:00
@@ -33,5 +33,8 @@ endif
2014-07-10 17:01:31 +00:00
SUBDIRS += includes tests common omapip client dhcpctl relay server
2014-07-10 17:01:31 +00:00
+SUBDIRS += tapset
+#DIST_SUBDIRS = $(SUBDIRS)
2013-12-20 15:13:52 +00:00
+
2014-07-10 17:01:31 +00:00
nobase_include_HEADERS = dhcpctl/dhcpctl.h
2015-08-10 10:09:24 +00:00
diff -up dhcp-4.3.3b1/server/dhcp.c.systemtap dhcp-4.3.3b1/server/dhcp.c
--- dhcp-4.3.3b1/server/dhcp.c.systemtap 2015-08-10 11:46:08.905892186 +0200
+++ dhcp-4.3.3b1/server/dhcp.c 2015-08-10 11:47:15.969638417 +0200
@@ -31,6 +31,8 @@
#include <limits.h>
#include <sys/time.h>
2015-08-10 10:09:24 +00:00
+#include "trace.h"
2015-08-10 10:09:24 +00:00
+
static void maybe_return_agent_options(struct packet *packet,
struct option_state *options);
2015-08-10 10:09:24 +00:00
static int reuse_lease (struct packet* packet, struct lease* new_lease,
@@ -311,6 +313,8 @@ void dhcpdiscover (packet, ms_nulltp)
dhcp_failover_state_t *peer;
#endif
+ TRACE(DHCPD_DISCOVER_START());
+
find_lease (&lease, packet, packet -> shared_network,
0, &peer_has_leases, (struct lease *)0, MDL);
2015-08-10 10:09:24 +00:00
@@ -433,6 +437,8 @@ void dhcpdiscover (packet, ms_nulltp)
out:
if (lease)
lease_dereference (&lease, MDL);
+
+ TRACE(DHCPD_DISCOVER_DONE());
}
void dhcprequest (packet, ms_nulltp, ip_lease)
2015-08-10 10:09:24 +00:00
@@ -455,6 +461,8 @@ void dhcprequest (packet, ms_nulltp, ip_
#endif
int have_requested_addr = 0;
+ TRACE(DHCPD_REQUEST_START());
+
oc = lookup_option (&dhcp_universe, packet -> options,
DHO_DHCP_REQUESTED_ADDRESS);
memset (&data, 0, sizeof data);
2015-08-10 10:09:24 +00:00
@@ -734,6 +742,9 @@ void dhcprequest (packet, ms_nulltp, ip_
log_info ("%s: unknown lease %s.", msgbuf, piaddr (cip));
out:
+
+ TRACE(DHCPD_REQUEST_DONE());
+
if (subnet)
subnet_dereference (&subnet, MDL);
if (lease)
2015-08-10 10:09:24 +00:00
@@ -752,6 +763,7 @@ void dhcprelease (packet, ms_nulltp)
const char *s;
char msgbuf [1024], cstr[16]; /* XXX */
+ TRACE(DHCPD_RELEASE_START());
/* DHCPRELEASE must not specify address in requested-address
option, but old protocol specs weren't explicit about this,
2015-08-10 10:09:24 +00:00
@@ -872,6 +884,8 @@ void dhcprelease (packet, ms_nulltp)
#endif
if (lease)
lease_dereference (&lease, MDL);
+
+ TRACE(DHCPD_RELEASE_DONE());
}
void dhcpdecline (packet, ms_nulltp)
2015-08-10 10:09:24 +00:00
@@ -889,6 +903,8 @@ void dhcpdecline (packet, ms_nulltp)
struct option_cache *oc;
struct data_string data;
+ TRACE(DHCPD_DECLINE_START());
+
/* DHCPDECLINE must specify address. */
if (!(oc = lookup_option (&dhcp_universe, packet -> options,
DHO_DHCP_REQUESTED_ADDRESS)))
2015-08-10 10:09:24 +00:00
@@ -995,6 +1011,8 @@ void dhcpdecline (packet, ms_nulltp)
option_state_dereference (&options, MDL);
if (lease)
lease_dereference (&lease, MDL);
+
+ TRACE(DHCPD_DECLINE_DONE());
}
void dhcpinform (packet, ms_nulltp)
2015-08-10 10:09:24 +00:00
@@ -1022,6 +1040,8 @@ void dhcpinform (packet, ms_nulltp)
2013-12-20 15:13:52 +00:00
int h_w_fixed_addr = 0;
#endif
+ TRACE(DHCPD_INFORM_START());
+
/* The client should set ciaddr to its IP address, but apparently
it's common for clients not to do this, so we'll use their IP
source address if they didn't set ciaddr. */
2015-08-10 10:09:24 +00:00
@@ -1592,6 +1612,8 @@ void dhcpinform (packet, ms_nulltp)
if (subnet)
subnet_dereference (&subnet, MDL);
+
+ TRACE(DHCPD_INFORM_DONE());
}
2015-02-08 17:31:39 +00:00
/*!
2015-08-10 10:09:24 +00:00
@@ -1622,6 +1644,8 @@ void nak_lease (packet, cip, network_gro
struct option_cache *oc = (struct option_cache *)0;
2015-02-08 17:31:39 +00:00
struct option_state *eval_options = NULL;
+ TRACE(DHCPD_NAK_LEASE_START());
+
option_state_allocate (&options, MDL);
memset (&outgoing, 0, sizeof outgoing);
memset (&raw, 0, sizeof raw);
2015-08-10 10:09:24 +00:00
@@ -1795,7 +1819,8 @@ void nak_lease (packet, cip, network_gro
2015-02-08 17:31:39 +00:00
"interface.", MDL, outgoing.packet_length,
packet->interface->name);
}
2015-02-08 17:31:39 +00:00
-
+
+ TRACE(DHCPD_NAK_LEASE_DONE());
}
2015-02-08 17:31:39 +00:00
/*!
2015-08-10 10:09:24 +00:00
@@ -2000,6 +2025,8 @@ void ack_lease (packet, lease, offer, wh
if (lease -> state)
return;
+ TRACE(DHCPD_ACK_LEASE_START());
+
/* Save original cltt for comparison later. */
lease_cltt = lease->cltt;
2015-08-10 10:09:24 +00:00
@@ -3392,6 +3419,7 @@ void ack_lease (packet, lease, offer, wh
#endif
dhcp_reply(lease);
}
+ TRACE(DHCPD_ACK_LEASE_DONE());
}
2015-08-10 10:09:24 +00:00
#if defined(DELAYED_ACK)
@@ -3570,6 +3598,8 @@ void dhcp_reply (lease)
if (!state)
log_fatal ("dhcp_reply was supplied lease with no state!");
+ TRACE(DHCPD_REPLY_START());
+
/* Compose a response for the client... */
memset (&raw, 0, sizeof raw);
memset (&d1, 0, sizeof d1);
2015-08-10 10:09:24 +00:00
@@ -3791,6 +3821,8 @@ void dhcp_reply (lease)
free_lease_state (state, MDL);
lease -> state = (struct lease_state *)0;
+
+ TRACE(DHCPD_REPLY_DONE());
}
int find_lease (struct lease **lp,
2015-08-10 10:09:24 +00:00
@@ -3813,6 +3845,8 @@ int find_lease (struct lease **lp,
struct data_string client_identifier;
struct hardware h;
+ TRACE(DHCPD_FIND_LEASE_START());
+
#if defined(FAILOVER_PROTOCOL)
/* Quick check to see if the peer has leases. */
if (peer_has_leases) {
2015-08-10 10:09:24 +00:00
@@ -4535,6 +4569,9 @@ int find_lease (struct lease **lp,
#if defined (DEBUG_FIND_LEASE)
log_info ("Not returning a lease.");
#endif
+
+ TRACE(DHCPD_FIND_LEASE_DONE());
+
return 0;
}
2015-08-10 10:09:24 +00:00
diff -up dhcp-4.3.3b1/server/dhcpd.c.systemtap dhcp-4.3.3b1/server/dhcpd.c
--- dhcp-4.3.3b1/server/dhcpd.c.systemtap 2015-08-10 11:46:08.863892345 +0200
+++ dhcp-4.3.3b1/server/dhcpd.c 2015-08-10 11:46:08.915892149 +0200
@@ -56,6 +56,8 @@ uid_t set_uid = 0;
gid_t set_gid = 0;
#endif /* PARANOIA */
+#include "trace.h"
+
2012-12-17 18:28:45 +00:00
#ifndef UNIT_TEST
static void usage(void);
2012-12-17 18:28:45 +00:00
#endif
2015-08-10 10:09:24 +00:00
@@ -816,6 +818,8 @@ main(int argc, char **argv) {
2013-12-20 15:13:52 +00:00
/* Log that we are about to start working */
log_info("Server starting service.");
2013-12-20 15:13:52 +00:00
+ TRACE(DHCPD_MAIN());
+
/*
* Receive packets and dispatch them...
* dispatch() will never return.
2015-08-10 10:09:24 +00:00
diff -up dhcp-4.3.3b1/server/dhcpv6.c.systemtap dhcp-4.3.3b1/server/dhcpv6.c
--- dhcp-4.3.3b1/server/dhcpv6.c.systemtap 2015-08-10 11:46:08.896892221 +0200
+++ dhcp-4.3.3b1/server/dhcpv6.c 2015-08-10 11:51:44.835621025 +0200
2013-12-20 15:13:52 +00:00
@@ -17,6 +17,7 @@
/*! \file server/dhcpv6.c */
#include "dhcpd.h"
+#include "trace.h"
#ifdef DHCPv6
2015-08-10 10:09:24 +00:00
@@ -4972,6 +4973,8 @@ static void
dhcpv6_solicit(struct data_string *reply_ret, struct packet *packet) {
struct data_string client_id;
+ TRACE(DHCPD_SIX_SOLICIT_START());
+
2015-08-10 10:09:24 +00:00
/*
* Validate our input.
*/
2015-08-10 10:09:24 +00:00
@@ -4985,6 +4988,8 @@ dhcpv6_solicit(struct data_string *reply
* Clean up.
*/
data_string_forget(&client_id, MDL);
+
+ TRACE(DHCPD_SIX_SOLICIT_DONE());
}
/*
2015-08-10 10:09:24 +00:00
@@ -4998,6 +5003,8 @@ dhcpv6_request(struct data_string *reply
struct data_string client_id;
struct data_string server_id;
+ TRACE(DHCPD_SIX_REQUEST_START());
+
/*
* Validate our input.
*/
2015-08-10 10:09:24 +00:00
@@ -5022,6 +5029,8 @@ dhcpv6_request(struct data_string *reply
*/
data_string_forget(&client_id, MDL);
data_string_forget(&server_id, MDL);
+
+ TRACE(DHCPD_SIX_REQUEST_DONE());
}
/* Find a DHCPv6 packet's shared network from hints in the packet.
2015-08-10 10:09:24 +00:00
@@ -5134,6 +5143,8 @@ dhcpv6_confirm(struct data_string *reply
struct dhcpv6_packet *reply = (struct dhcpv6_packet *)reply_data;
int reply_ofs = (int)(offsetof(struct dhcpv6_packet, options));
+ TRACE(DHCPD_SIX_CONFIRM_START());
+
2015-08-10 10:09:24 +00:00
/*
* Basic client message validation.
*/
2015-08-10 10:09:24 +00:00
@@ -5320,6 +5331,8 @@ exit:
option_state_dereference(&cli_enc_opt_state, MDL);
if (opt_state != NULL)
option_state_dereference(&opt_state, MDL);
+
+ TRACE(DHCPD_SIX_CONFIRM_DONE());
}
/*
2015-08-10 10:09:24 +00:00
@@ -5334,6 +5347,8 @@ dhcpv6_renew(struct data_string *reply,
struct data_string client_id;
struct data_string server_id;
+ TRACE(DHCPD_SIX_RENEW_START());
+
2015-08-10 10:09:24 +00:00
/*
* Validate the request.
*/
2015-08-10 10:09:24 +00:00
@@ -5358,6 +5373,8 @@ dhcpv6_renew(struct data_string *reply,
*/
data_string_forget(&server_id, MDL);
data_string_forget(&client_id, MDL);
+
+ TRACE(DHCPD_SIX_RENEW_DONE());
}
/*
2015-08-10 10:09:24 +00:00
@@ -5371,6 +5388,8 @@ static void
dhcpv6_rebind(struct data_string *reply, struct packet *packet) {
struct data_string client_id;
+ TRACE(DHCPD_SIX_REBIND_START());
+
if (!valid_client_msg(packet, &client_id)) {
return;
}
2015-08-10 10:09:24 +00:00
@@ -5378,6 +5397,8 @@ dhcpv6_rebind(struct data_string *reply,
lease_to_client(reply, packet, &client_id, NULL);
data_string_forget(&client_id, MDL);
+
+ TRACE(DHCPD_SIX_REBIND_DONE());
}
static void
2015-08-10 10:09:24 +00:00
@@ -5779,6 +5800,8 @@ dhcpv6_decline(struct data_string *reply
struct data_string client_id;
struct data_string server_id;
+ TRACE(DHCPD_SIX_DECLINE_START());
+
2015-08-10 10:09:24 +00:00
/*
* Validate our input.
*/
2015-08-10 10:09:24 +00:00
@@ -5808,6 +5831,8 @@ dhcpv6_decline(struct data_string *reply
data_string_forget(&server_id, MDL);
data_string_forget(&client_id, MDL);
+
+ TRACE(DHCPD_SIX_DECLINE_DONE());
}
static void
2015-08-10 10:09:24 +00:00
@@ -6256,6 +6281,8 @@ dhcpv6_release(struct data_string *reply
struct data_string client_id;
struct data_string server_id;
+ TRACE(DHCPD_SIX_RELEASE_START());
+
2015-08-10 10:09:24 +00:00
/*
* Validate our input.
*/
2015-08-10 10:09:24 +00:00
@@ -6286,6 +6313,8 @@ dhcpv6_release(struct data_string *reply
data_string_forget(&server_id, MDL);
data_string_forget(&client_id, MDL);
+
+ TRACE(DHCPD_SIX_RELEASE_DONE());
}
/*
2015-08-10 10:09:24 +00:00
@@ -6298,6 +6327,8 @@ dhcpv6_information_request(struct data_s
struct data_string client_id;
struct data_string server_id;
+ TRACE(DHCPD_SIX_INFORMATION_REQUEST_START());
+
/*
* Validate our input.
*/
2015-08-10 10:09:24 +00:00
@@ -6329,6 +6360,8 @@ dhcpv6_information_request(struct data_s
data_string_forget(&client_id, MDL);
}
data_string_forget(&server_id, MDL);
+
+ TRACE(DHCPD_SIX_INFORMATION_REQUEST_DONE());
}
2015-08-10 10:09:24 +00:00
/*
@@ -6357,6 +6390,8 @@ dhcpv6_relay_forw(struct data_string *re
struct dhcpv6_relay_packet *reply;
int reply_ofs;
+ TRACE(DHCPD_SIX_RELAY_FORW_START());
+
2015-08-10 10:09:24 +00:00
/*
* Initialize variables for early exit.
*/
2015-08-10 10:09:24 +00:00
@@ -6616,6 +6651,8 @@ exit:
if (enc_packet != NULL) {
packet_dereference(&enc_packet, MDL);
}
+
+ TRACE(DHCPD_SIX_RELAY_FORW_DONE());
}
static void
2015-08-10 10:09:24 +00:00
diff -up dhcp-4.3.3b1/server/failover.c.systemtap dhcp-4.3.3b1/server/failover.c
--- dhcp-4.3.3b1/server/failover.c.systemtap 2015-07-30 15:17:16.000000000 +0200
+++ dhcp-4.3.3b1/server/failover.c 2015-08-10 11:46:08.919892134 +0200
2014-07-10 17:01:31 +00:00
@@ -30,6 +30,8 @@
#include "dhcpd.h"
#include <omapip/omapip_p.h>
+#include "trace.h"
+
#if defined (FAILOVER_PROTOCOL)
dhcp_failover_state_t *failover_states;
static isc_result_t do_a_failover_option (omapi_object_t *,
2015-02-08 17:31:39 +00:00
@@ -1767,6 +1769,8 @@ isc_result_t dhcp_failover_set_state (dh
struct lease *l;
struct timeval tv;
+ TRACE(DHCPD_FAILOVER_SET_STATE_START(state->me.state, new_state));
+
/* If we're in certain states where we're sending updates, and the peer
* state changes, we need to re-schedule any pending updates just to
* be on the safe side. This results in retransmission.
2015-08-10 10:09:24 +00:00
@@ -1986,6 +1990,8 @@ isc_result_t dhcp_failover_set_state (dh
break;
}
+ TRACE(DHCPD_FAILOVER_SET_STATE_DONE());
+
return ISC_R_SUCCESS;
}
2015-08-10 10:09:24 +00:00
@@ -2499,6 +2505,8 @@ dhcp_failover_pool_dobalance(dhcp_failov
if (state -> me.state != normal)
return 0;
+ TRACE(DHCPD_FAILOVER_POOL_DOBALANCE_START());
+
state->last_balance = cur_time;
for (s = shared_networks ; s ; s = s->next) {
2015-08-10 10:09:24 +00:00
@@ -2660,6 +2668,8 @@ dhcp_failover_pool_dobalance(dhcp_failov
if (leases_queued)
commit_leases();
+ TRACE(DHCPD_FAILOVER_POOL_DOBALANCE_DONE());
+
return leases_queued;
}
2015-08-10 10:09:24 +00:00
diff -up dhcp-4.3.3b1/server/Makefile.am.systemtap dhcp-4.3.3b1/server/Makefile.am
--- dhcp-4.3.3b1/server/Makefile.am.systemtap 2015-08-10 11:46:08.831892467 +0200
+++ dhcp-4.3.3b1/server/Makefile.am 2015-08-10 11:52:34.278433933 +0200
@@ -10,7 +10,8 @@ dist_sysconf_DATA = dhcpd.conf.example
2014-07-10 17:01:31 +00:00
sbin_PROGRAMS = dhcpd
dhcpd_SOURCES = dhcpd.c dhcp.c bootp.c confpars.c db.c class.c failover.c \
omapi.c mdb.c stables.c salloc.c ddns.c dhcpleasequery.c \
2015-08-10 10:09:24 +00:00
- dhcpv6.c mdb6.c ldap.c ldap_casa.c leasechain.c ldap_krb_helper.c
+ dhcpv6.c mdb6.c ldap.c ldap_casa.c leasechain.c ldap_krb_helper.c \
+ probes.d trace.h
2014-07-10 17:01:31 +00:00
dhcpd_CFLAGS = $(LDAP_CFLAGS)
dhcpd_LDADD = ../common/libdhcp.a ../omapip/libomapi.la ../dhcpctl/libdhcpctl.la \
2015-08-10 10:09:24 +00:00
@@ -20,3 +21,13 @@ dhcpd_LDADD = ../common/libdhcp.a ../oma
2014-07-10 17:01:31 +00:00
man_MANS = dhcpd.8 dhcpd.conf.5 dhcpd.leases.5
EXTRA_DIST = $(man_MANS)
+if ENABLE_SYSTEMTAP
+BUILT_SOURCES = probes.h
+probes.h: probes.d
+ $(DTRACE) -C -h -s $< -o $@
+
+probes.o: probes.d
+ $(DTRACE) -C -G -s $< -o $@
+
+dhcpd_LDADD += probes.o
+endif
2015-08-10 10:09:24 +00:00
diff -up dhcp-4.3.3b1/server/probes.d.systemtap dhcp-4.3.3b1/server/probes.d
--- dhcp-4.3.3b1/server/probes.d.systemtap 2015-08-10 11:46:08.920892130 +0200
+++ dhcp-4.3.3b1/server/probes.d 2015-08-10 11:46:08.920892130 +0200
@@ -0,0 +1,43 @@
+provider dhcpd {
+ probe main();
+ probe discover_start();
+ probe discover_done();
+ probe request_start();
+ probe request_done();
+ probe release_start();
+ probe release_done();
+ probe decline_start();
+ probe decline_done();
+ probe inform_start();
+ probe inform_done();
+ probe nak_lease_start();
+ probe nak_lease_done();
+ probe ack_lease_start();
+ probe ack_lease_done();
+ probe reply_start();
+ probe reply_done();
+ probe find_lease_start();
+ probe find_lease_done();
+ probe six_solicit_start();
+ probe six_solicit_done();
+ probe six_request_start();
+ probe six_request_done();
+ probe six_confirm_start();
+ probe six_confirm_done();
+ probe six_renew_start();
+ probe six_renew_done();
+ probe six_rebind_start();
+ probe six_rebind_done();
+ probe six_decline_start();
+ probe six_decline_done();
+ probe six_release_start();
+ probe six_release_done();
+ probe six_information_request_start();
+ probe six_information_request_done();
+ probe six_relay_forw_start();
+ probe six_relay_forw_done();
+ probe failover_pool_dobalance_start();
+ probe failover_pool_dobalance_done();
+ probe failover_set_state_start(int, int);
+ probe failover_set_state_done();
+};
2015-08-10 10:09:24 +00:00
diff -up dhcp-4.3.3b1/server/tests/Makefile.am.systemtap dhcp-4.3.3b1/server/tests/Makefile.am
--- dhcp-4.3.3b1/server/tests/Makefile.am.systemtap 2015-08-10 11:46:08.831892467 +0200
+++ dhcp-4.3.3b1/server/tests/Makefile.am 2015-08-10 11:46:08.920892130 +0200
2013-12-20 15:13:52 +00:00
@@ -21,6 +21,10 @@ DHCPLIBS = $(top_builddir)/common/libdhc
2015-03-05 18:36:52 +00:00
$(top_builddir)/dhcpctl/libdhcpctl.la \
$(BIND9_LIBDIR) -lirs-export -ldns-export -lisccfg-export -lisc-export
2012-12-17 18:28:45 +00:00
+if ENABLE_SYSTEMTAP
+DHCPLIBS += ../probes.o
+endif
+
ATF_TESTS =
if HAVE_ATF
2015-03-05 18:36:52 +00:00
2015-08-10 10:09:24 +00:00
diff -up dhcp-4.3.3b1/server/trace.h.systemtap dhcp-4.3.3b1/server/trace.h
--- dhcp-4.3.3b1/server/trace.h.systemtap 2015-08-10 11:46:08.921892126 +0200
+++ dhcp-4.3.3b1/server/trace.h 2015-08-10 11:46:08.921892126 +0200
@@ -0,0 +1,11 @@
+// trace.h
+
+#include "config.h"
+#ifdef HAVE_SYSTEMTAP
+// include the generated probes header and put markers in code
+#include "probes.h"
+#define TRACE(probe) probe
+#else
+// Wrap the probe to allow it to be removed when no systemtap available
+#define TRACE(probe)
+#endif
2015-08-10 10:09:24 +00:00
diff -up dhcp-4.3.3b1/tapset/dhcpd.stp.systemtap dhcp-4.3.3b1/tapset/dhcpd.stp
--- dhcp-4.3.3b1/tapset/dhcpd.stp.systemtap 2015-08-10 11:46:08.921892126 +0200
+++ dhcp-4.3.3b1/tapset/dhcpd.stp 2015-08-10 11:46:08.921892126 +0200
@@ -0,0 +1,212 @@
+/* dhcpd tapset
+ Copyright (C) 2011, Red Hat Inc.
+ */
+
+probe dhcpd_main = process("dhcpd").mark("main")
+{
+ probestr = sprintf("%s(locals: %s)", $$name, $$locals);
+
+}
+
+probe dhcpd_discover_start = process("dhcpd").mark("discover_start")
+{
+ probestr = sprintf("%s", $$name);
+}
+
+probe dhcpd_discover_done = process("dhcpd").mark("discover_done")
+{
+ probestr = sprintf("%s", $$name);
+}
+
+probe dhcpd_request_start = process("dhcpd").mark("request_start")
+{
+ probestr = sprintf("%s", $$name);
+}
+
+probe dhcpd_request_done = process("dhcpd").mark("request_done")
+{
+ probestr = sprintf("%s", $$name);
+}
+
+probe dhcpd_release_start = process("dhcpd").mark("release_start")
+{
+ probestr = sprintf("%s", $$name);
+}
+
+probe dhcpd_release_done = process("dhcpd").mark("release_done")
+{
+ probestr = sprintf("%s", $$name);
+}
+
+probe dhcpd_decline_start = process("dhcpd").mark("decline_start")
+{
+ probestr = sprintf("%s", $$name);
+}
+
+probe dhcpd_decline_done = process("dhcpd").mark("decline_done")
+{
+ probestr = sprintf("%s", $$name);
+}
+
+probe dhcpd_inform_start = process("dhcpd").mark("inform_start")
+{
+ probestr = sprintf("%s", $$name);
+}
+
+probe dhcpd_inform_done = process("dhcpd").mark("inform_done")
+{
+ probestr = sprintf("%s", $$name);
+}
+
+probe dhcpd_nak_lease_start = process("dhcpd").mark("nak_lease_start")
+{
+ probestr = sprintf("%s", $$name);
+}
+
+probe dhcpd_nak_lease_done = process("dhcpd").mark("nak_lease_done")
+{
+ probestr = sprintf("%s", $$name);
+}
+
+probe dhcpd_ack_lease_start = process("dhcpd").mark("ack_lease_start")
+{
+ probestr = sprintf("%s", $$name);
+}
+
+probe dhcpd_ack_lease_done = process("dhcpd").mark("ack_lease_done")
+{
+ probestr = sprintf("%s", $$name);
+}
+
+probe dhcpd_reply_start = process("dhcpd").mark("reply_start")
+{
+ probestr = sprintf("%s", $$name);
+}
+
+probe dhcpd_reply_done = process("dhcpd").mark("reply_done")
+{
+ probestr = sprintf("%s", $$name);
+}
+
+probe dhcpd_find_lease_start = process("dhcpd").mark("find_lease_start")
+{
+ probestr = sprintf("%s", $$name);
+}
+
+probe dhcpd_find_lease_done = process("dhcpd").mark("find_lease_done")
+{
+ probestr = sprintf("%s", $$name);
+}
+
+probe dhcpd_six_solicit_start = process("dhcpd").mark("six_solicit_start")
+{
+ probestr = sprintf("%s", $$name);
+}
+
+probe dhcpd_six_solicit_done = process("dhcpd").mark("six_solicit_done")
+{
+ probestr = sprintf("%s", $$name);
+}
+
+probe dhcpd_six_request_start = process("dhcpd").mark("six_request_start")
+{
+ probestr = sprintf("%s", $$name);
+}
+
+probe dhcpd_six_request_done = process("dhcpd").mark("six_request_done")
+{
+ probestr = sprintf("%s", $$name);
+}
+
+probe dhcpd_six_confirm_start = process("dhcpd").mark("six_confirm_start")
+{
+ probestr = sprintf("%s", $$name);
+}
+
+probe dhcpd_six_confirm_done = process("dhcpd").mark("six_confirm_done")
+{
+ probestr = sprintf("%s", $$name);
+}
+
+probe dhcpd_six_renew_start = process("dhcpd").mark("six_renew_start")
+{
+ probestr = sprintf("%s", $$name);
+}
+
+probe dhcpd_six_renew_done = process("dhcpd").mark("six_renew_done")
+{
+ probestr = sprintf("%s", $$name);
+}
+
+probe dhcpd_six_rebind_start = process("dhcpd").mark("six_rebind_start")
+{
+ probestr = sprintf("%s", $$name);
+}
+
+probe dhcpd_six_rebind_done = process("dhcpd").mark("six_rebind_done")
+{
+ probestr = sprintf("%s", $$name);
+}
+
+probe dhcpd_six_decline_start = process("dhcpd").mark("six_decline_start")
+{
+ probestr = sprintf("%s", $$name);
+}
+
+probe dhcpd_six_decline_done = process("dhcpd").mark("six_decline_done")
+{
+ probestr = sprintf("%s", $$name);
+}
+
+probe dhcpd_six_release_start = process("dhcpd").mark("six_release_start")
+{
+ probestr = sprintf("%s", $$name);
+}
+
+probe dhcpd_six_release_done = process("dhcpd").mark("six_release_done")
+{
+ probestr = sprintf("%s", $$name);
+}
+
+probe dhcpd_six_information_request_start = process("dhcpd").mark("six_information_request_start")
+{
+ probestr = sprintf("%s", $$name);
+}
+
+probe dhcpd_six_information_request_done = process("dhcpd").mark("six_information_request_done")
+{
+ probestr = sprintf("%s", $$name);
+}
+
+probe dhcpd_six_relay_forw_start = process("dhcpd").mark("six_relay_forw_start")
+{
+ probestr = sprintf("%s", $$name);
+}
+
+probe dhcpd_six_relay_forw_done = process("dhcpd").mark("six_relay_forw_done")
+{
+ probestr = sprintf("%s", $$name);
+}
+
+probe dhcpd_failover_pool_dobalance_start = process("dhcpd").mark("failover_pool_dobalance_start")
+{
+ probestr = sprintf("%s", $$name);
+}
+
+probe dhcpd_failover_pool_dobalance_done = process("dhcpd").mark("failover_pool_dobalance_done")
+{
+ probestr = sprintf("%s", $$name);
+}
+
+
+probe dhcpd_failover_set_state_start = process("dhcpd").mark("failover_set_state_start")
+{
+ state = $arg1;
+ new_state = $arg2;
+ probestr = sprintf("%s(state=%d, new_state=%d)", $$name, state, new_state);
+}
+
+probe dhcpd_failover_set_state_done = process("dhcpd").mark("failover_set_state_done")
+{
+ probestr = sprintf("%s", $$name);
+}
2015-08-10 10:09:24 +00:00
diff -up dhcp-4.3.3b1/tapset/Makefile.am.systemtap dhcp-4.3.3b1/tapset/Makefile.am
--- dhcp-4.3.3b1/tapset/Makefile.am.systemtap 2015-08-10 11:46:08.921892126 +0200
+++ dhcp-4.3.3b1/tapset/Makefile.am 2015-08-10 11:46:08.921892126 +0200
2014-07-10 17:01:31 +00:00
@@ -0,0 +1,26 @@
+# Makefile.am for dhcp/tapset
+# Jiri Popelka
+
+.PHONY: clean-local install-data-hook uninstall-local
+
+#
+EXTRA_DIST = dhcpd.stp
+TAPSET_FILES = $(EXTRA_DIST)
+TAPSET_INSTALL_DIR = $(DESTDIR)@ABS_TAPSET_DIR@
+
+if ENABLE_SYSTEMTAP
+all-local: $(TAPSET_FILES)
+
+clean-local:
+
+install-data-hook:
+ $(MKDIR_P) $(TAPSET_INSTALL_DIR)
+ $(INSTALL_DATA) $(TAPSET_FILES) $(TAPSET_INSTALL_DIR)
+
+uninstall-local:
+ @list='$(TAPSET_FILES)'; for p in $$list; do \
+ echo " rm -f '$(TAPSET_INSTALL_DIR)/$$p'"; \
+ rm -f "$(TAPSET_INSTALL_DIR)/$$p"; \
+ done
+endif
+