]>
Commit | Line | Data |
---|---|---|
444c1184 MT |
1 | diff -up dhcp-4.2.4b1/configure.ac.systemtap dhcp-4.2.4b1/configure.ac |
2 | --- dhcp-4.2.4b1/configure.ac.systemtap 2012-04-16 17:46:10.913227143 +0200 | |
3 | +++ dhcp-4.2.4b1/configure.ac 2012-04-16 17:46:10.947226667 +0200 | |
4 | @@ -504,6 +504,35 @@ else | |
6df985df SS |
5 | AC_MSG_RESULT(no) |
6 | fi | |
7 | ||
8 | +AC_MSG_CHECKING([whether to include systemtap tracing support]) | |
9 | +AC_ARG_ENABLE([systemtap], | |
10 | + [AS_HELP_STRING([--enable-systemtap], | |
11 | + [Enable inclusion of systemtap trace support])], | |
12 | + [ENABLE_SYSTEMTAP="${enableval}"], [ENABLE_SYSTEMTAP='no']) | |
13 | +AM_CONDITIONAL([ENABLE_SYSTEMTAP], [test x$ENABLE_SYSTEMTAP = xyes]) | |
14 | +AC_MSG_RESULT(${ENABLE_SYSTEMTAP}) | |
15 | + | |
16 | +if test "x${ENABLE_SYSTEMTAP}" = xyes; then | |
17 | + # Additional configuration for --enable-systemtap is HERE | |
18 | + AC_CHECK_PROGS(DTRACE, dtrace) | |
19 | + if test -z "$DTRACE"; then | |
20 | + AC_MSG_ERROR([dtrace not found]) | |
21 | + fi | |
22 | + AC_CHECK_HEADER([sys/sdt.h], [SDT_H_FOUND='yes'], | |
23 | + [SDT_H_FOUND='no'; | |
24 | + AC_MSG_ERROR([systemtap support needs sys/sdt.h header])]) | |
25 | + AC_DEFINE([HAVE_SYSTEMTAP], [1], [Define to 1 if using SystemTap probes.]) | |
26 | + AC_ARG_WITH([tapset-install-dir], | |
27 | + [AS_HELP_STRING([--with-tapset-install-dir], | |
28 | + [The absolute path where the tapset dir will be installed])], | |
29 | + [if test "x${withval}" = x; then | |
30 | + ABS_TAPSET_DIR="\$(datadir)/systemtap/tapset" | |
31 | + else | |
32 | + ABS_TAPSET_DIR="${withval}" | |
33 | + fi], [ABS_TAPSET_DIR="\$(datadir)/systemtap/tapset"]) | |
34 | + AC_SUBST(ABS_TAPSET_DIR) | |
35 | +fi | |
36 | + | |
37 | # Solaris needs some libraries for functions | |
38 | AC_SEARCH_LIBS(socket, [socket]) | |
39 | AC_SEARCH_LIBS(inet_ntoa, [nsl]) | |
444c1184 | 40 | @@ -650,6 +679,7 @@ AC_OUTPUT([ |
6df985df SS |
41 | relay/Makefile |
42 | server/Makefile | |
43 | tests/Makefile | |
44 | + tapset/Makefile | |
45 | ]) | |
46 | ||
47 | sh util/bindvar.sh | |
444c1184 MT |
48 | diff -up dhcp-4.2.4b1/Makefile.am.systemtap dhcp-4.2.4b1/Makefile.am |
49 | --- dhcp-4.2.4b1/Makefile.am.systemtap 2012-04-16 17:46:10.791228851 +0200 | |
50 | +++ dhcp-4.2.4b1/Makefile.am 2012-04-16 17:46:10.947226667 +0200 | |
6df985df SS |
51 | @@ -29,5 +29,8 @@ endif |
52 | ||
444c1184 | 53 | SUBDIRS += includes tests common omapip client dhcpctl relay server |
6df985df SS |
54 | |
55 | +SUBDIRS += tapset | |
56 | +#DIST_SUBDIRS = $(SUBDIRS) | |
57 | + | |
58 | nobase_include_HEADERS = dhcpctl/dhcpctl.h | |
59 | ||
444c1184 MT |
60 | diff -up dhcp-4.2.4b1/server/dhcp.c.systemtap dhcp-4.2.4b1/server/dhcp.c |
61 | --- dhcp-4.2.4b1/server/dhcp.c.systemtap 2012-04-16 17:46:10.816228501 +0200 | |
62 | +++ dhcp-4.2.4b1/server/dhcp.c 2012-04-16 17:48:11.528537555 +0200 | |
6df985df SS |
63 | @@ -36,7 +36,7 @@ |
64 | #include <errno.h> | |
65 | #include <limits.h> | |
66 | #include <sys/time.h> | |
67 | - | |
68 | +#include "trace.h" | |
69 | static void commit_leases_ackout(void *foo); | |
70 | static void maybe_return_agent_options(struct packet *packet, | |
71 | struct option_state *options); | |
72 | @@ -275,6 +275,8 @@ void dhcpdiscover (packet, ms_nulltp) | |
73 | dhcp_failover_state_t *peer; | |
74 | #endif | |
75 | ||
76 | + TRACE(DHCPD_DISCOVER_START()); | |
77 | + | |
78 | find_lease (&lease, packet, packet -> shared_network, | |
79 | 0, &peer_has_leases, (struct lease *)0, MDL); | |
80 | ||
81 | @@ -399,6 +401,8 @@ void dhcpdiscover (packet, ms_nulltp) | |
82 | out: | |
83 | if (lease) | |
84 | lease_dereference (&lease, MDL); | |
85 | + | |
86 | + TRACE(DHCPD_DISCOVER_DONE()); | |
87 | } | |
88 | ||
89 | void dhcprequest (packet, ms_nulltp, ip_lease) | |
444c1184 MT |
90 | @@ -421,6 +425,8 @@ void dhcprequest (packet, ms_nulltp, ip_ |
91 | #endif | |
6df985df SS |
92 | int have_requested_addr = 0; |
93 | ||
94 | + TRACE(DHCPD_REQUEST_START()); | |
95 | + | |
96 | oc = lookup_option (&dhcp_universe, packet -> options, | |
97 | DHO_DHCP_REQUESTED_ADDRESS); | |
98 | memset (&data, 0, sizeof data); | |
444c1184 | 99 | @@ -677,6 +683,9 @@ void dhcprequest (packet, ms_nulltp, ip_ |
6df985df SS |
100 | log_info ("%s: unknown lease %s.", msgbuf, piaddr (cip)); |
101 | ||
102 | out: | |
103 | + | |
104 | + TRACE(DHCPD_REQUEST_DONE()); | |
105 | + | |
106 | if (subnet) | |
107 | subnet_dereference (&subnet, MDL); | |
108 | if (lease) | |
444c1184 | 109 | @@ -695,6 +704,7 @@ void dhcprelease (packet, ms_nulltp) |
6df985df SS |
110 | const char *s; |
111 | char msgbuf [1024], cstr[16]; /* XXX */ | |
112 | ||
113 | + TRACE(DHCPD_RELEASE_START()); | |
114 | ||
115 | /* DHCPRELEASE must not specify address in requested-address | |
116 | option, but old protocol specs weren't explicit about this, | |
444c1184 | 117 | @@ -819,6 +829,8 @@ void dhcprelease (packet, ms_nulltp) |
6df985df SS |
118 | #endif |
119 | if (lease) | |
120 | lease_dereference (&lease, MDL); | |
121 | + | |
122 | + TRACE(DHCPD_RELEASE_DONE()); | |
123 | } | |
124 | ||
125 | void dhcpdecline (packet, ms_nulltp) | |
444c1184 | 126 | @@ -836,6 +848,8 @@ void dhcpdecline (packet, ms_nulltp) |
6df985df SS |
127 | struct option_cache *oc; |
128 | struct data_string data; | |
129 | ||
130 | + TRACE(DHCPD_DECLINE_START()); | |
131 | + | |
132 | /* DHCPDECLINE must specify address. */ | |
133 | if (!(oc = lookup_option (&dhcp_universe, packet -> options, | |
134 | DHO_DHCP_REQUESTED_ADDRESS))) | |
444c1184 | 135 | @@ -947,6 +961,8 @@ void dhcpdecline (packet, ms_nulltp) |
6df985df SS |
136 | option_state_dereference (&options, MDL); |
137 | if (lease) | |
138 | lease_dereference (&lease, MDL); | |
139 | + | |
140 | + TRACE(DHCPD_DECLINE_DONE()); | |
141 | } | |
142 | ||
143 | void dhcpinform (packet, ms_nulltp) | |
144 | @@ -970,6 +986,8 @@ void dhcpinform (packet, ms_nulltp) | |
444c1184 MT |
145 | struct interface_info *interface; |
146 | int result; | |
6df985df SS |
147 | |
148 | + TRACE(DHCPD_INFORM_START()); | |
149 | + | |
150 | /* The client should set ciaddr to its IP address, but apparently | |
151 | it's common for clients not to do this, so we'll use their IP | |
152 | source address if they didn't set ciaddr. */ | |
444c1184 MT |
153 | @@ -1327,6 +1345,8 @@ void dhcpinform (packet, ms_nulltp) |
154 | ||
6df985df SS |
155 | if (subnet) |
156 | subnet_dereference (&subnet, MDL); | |
157 | + | |
158 | + TRACE(DHCPD_INFORM_DONE()); | |
159 | } | |
160 | ||
161 | void nak_lease (packet, cip) | |
444c1184 | 162 | @@ -1343,6 +1363,8 @@ void nak_lease (packet, cip) |
6df985df SS |
163 | struct option_state *options = (struct option_state *)0; |
164 | struct option_cache *oc = (struct option_cache *)0; | |
165 | ||
166 | + TRACE(DHCPD_NAK_LEASE_START()); | |
167 | + | |
168 | option_state_allocate (&options, MDL); | |
169 | memset (&outgoing, 0, sizeof outgoing); | |
170 | memset (&raw, 0, sizeof raw); | |
444c1184 MT |
171 | @@ -1494,6 +1516,7 @@ void nak_lease (packet, cip) |
172 | packet->interface->name); | |
173 | } | |
174 | ||
6df985df SS |
175 | + TRACE(DHCPD_NAK_LEASE_DONE()); |
176 | } | |
177 | ||
178 | void ack_lease (packet, lease, offer, when, msg, ms_nulltp, hp) | |
444c1184 | 179 | @@ -1535,6 +1558,8 @@ void ack_lease (packet, lease, offer, wh |
6df985df SS |
180 | if (lease -> state) |
181 | return; | |
182 | ||
183 | + TRACE(DHCPD_ACK_LEASE_START()); | |
184 | + | |
185 | /* Save original cltt for comparison later. */ | |
186 | lease_cltt = lease->cltt; | |
187 | ||
444c1184 | 188 | @@ -2897,6 +2922,8 @@ void ack_lease (packet, lease, offer, wh |
6df985df SS |
189 | #endif |
190 | dhcp_reply(lease); | |
191 | } | |
192 | + | |
193 | + TRACE(DHCPD_ACK_LEASE_DONE()); | |
194 | } | |
195 | ||
196 | /* | |
444c1184 | 197 | @@ -3049,6 +3076,8 @@ void dhcp_reply (lease) |
6df985df SS |
198 | if (!state) |
199 | log_fatal ("dhcp_reply was supplied lease with no state!"); | |
200 | ||
201 | + TRACE(DHCPD_REPLY_START()); | |
202 | + | |
203 | /* Compose a response for the client... */ | |
204 | memset (&raw, 0, sizeof raw); | |
205 | memset (&d1, 0, sizeof d1); | |
444c1184 | 206 | @@ -3270,6 +3299,8 @@ void dhcp_reply (lease) |
6df985df SS |
207 | |
208 | free_lease_state (state, MDL); | |
209 | lease -> state = (struct lease_state *)0; | |
210 | + | |
211 | + TRACE(DHCPD_REPLY_DONE()); | |
212 | } | |
213 | ||
214 | int find_lease (struct lease **lp, | |
444c1184 | 215 | @@ -3292,6 +3323,8 @@ int find_lease (struct lease **lp, |
6df985df SS |
216 | struct data_string client_identifier; |
217 | struct hardware h; | |
218 | ||
219 | + TRACE(DHCPD_FIND_LEASE_START()); | |
220 | + | |
221 | #if defined(FAILOVER_PROTOCOL) | |
222 | /* Quick check to see if the peer has leases. */ | |
223 | if (peer_has_leases) { | |
444c1184 | 224 | @@ -4019,6 +4052,9 @@ int find_lease (struct lease **lp, |
6df985df SS |
225 | #if defined (DEBUG_FIND_LEASE) |
226 | log_info ("Not returning a lease."); | |
227 | #endif | |
228 | + | |
229 | + TRACE(DHCPD_FIND_LEASE_DONE()); | |
230 | + | |
231 | return 0; | |
232 | } | |
233 | ||
444c1184 MT |
234 | diff -up dhcp-4.2.4b1/server/dhcpd.c.systemtap dhcp-4.2.4b1/server/dhcpd.c |
235 | --- dhcp-4.2.4b1/server/dhcpd.c.systemtap 2012-04-16 17:46:10.928226933 +0200 | |
236 | +++ dhcp-4.2.4b1/server/dhcpd.c 2012-04-16 17:46:10.951226611 +0200 | |
237 | @@ -58,6 +58,8 @@ static const char url [] = | |
238 | # undef group | |
239 | #endif /* PARANOIA */ | |
6df985df SS |
240 | |
241 | +#include "trace.h" | |
242 | + | |
243 | static void usage(void); | |
244 | ||
245 | struct iaddr server_identifier; | |
444c1184 MT |
246 | @@ -859,6 +861,7 @@ main(int argc, char **argv) { |
247 | omapi_set_int_value ((omapi_object_t *)dhcp_control_object, | |
248 | (omapi_object_t *)0, "state", server_running); | |
249 | ||
250 | + TRACE(DHCPD_MAIN()); | |
6df985df SS |
251 | /* Receive packets and dispatch them... */ |
252 | dispatch (); | |
253 | ||
444c1184 MT |
254 | diff -up dhcp-4.2.4b1/server/dhcpv6.c.systemtap dhcp-4.2.4b1/server/dhcpv6.c |
255 | --- dhcp-4.2.4b1/server/dhcpv6.c.systemtap 2012-04-16 17:46:10.925226975 +0200 | |
256 | +++ dhcp-4.2.4b1/server/dhcpv6.c 2012-04-16 17:46:10.953226583 +0200 | |
6df985df SS |
257 | @@ -15,6 +15,7 @@ |
258 | */ | |
259 | ||
260 | #include "dhcpd.h" | |
261 | +#include "trace.h" | |
262 | ||
263 | #ifdef DHCPv6 | |
264 | ||
444c1184 | 265 | @@ -4198,6 +4199,8 @@ static void |
6df985df SS |
266 | dhcpv6_solicit(struct data_string *reply_ret, struct packet *packet) { |
267 | struct data_string client_id; | |
268 | ||
269 | + TRACE(DHCPD_6_SOLICIT_START()); | |
270 | + | |
271 | /* | |
272 | * Validate our input. | |
273 | */ | |
444c1184 | 274 | @@ -4211,6 +4214,8 @@ dhcpv6_solicit(struct data_string *reply |
6df985df SS |
275 | * Clean up. |
276 | */ | |
277 | data_string_forget(&client_id, MDL); | |
278 | + | |
279 | + TRACE(DHCPD_6_SOLICIT_DONE()); | |
280 | } | |
281 | ||
282 | /* | |
444c1184 | 283 | @@ -4224,6 +4229,8 @@ dhcpv6_request(struct data_string *reply |
6df985df SS |
284 | struct data_string client_id; |
285 | struct data_string server_id; | |
286 | ||
287 | + TRACE(DHCPD_6_REQUEST_START()); | |
288 | + | |
289 | /* | |
290 | * Validate our input. | |
291 | */ | |
444c1184 | 292 | @@ -4241,6 +4248,8 @@ dhcpv6_request(struct data_string *reply |
6df985df SS |
293 | */ |
294 | data_string_forget(&client_id, MDL); | |
295 | data_string_forget(&server_id, MDL); | |
296 | + | |
297 | + TRACE(DHCPD_6_REQUEST_DONE()); | |
298 | } | |
299 | ||
300 | /* Find a DHCPv6 packet's shared network from hints in the packet. | |
444c1184 | 301 | @@ -4353,6 +4362,8 @@ dhcpv6_confirm(struct data_string *reply |
6df985df SS |
302 | struct dhcpv6_packet *reply = (struct dhcpv6_packet *)reply_data; |
303 | int reply_ofs = (int)(offsetof(struct dhcpv6_packet, options)); | |
304 | ||
305 | + TRACE(DHCPD_6_CONFIRM_START()); | |
306 | + | |
307 | /* | |
308 | * Basic client message validation. | |
309 | */ | |
444c1184 | 310 | @@ -4539,6 +4550,8 @@ exit: |
6df985df SS |
311 | option_state_dereference(&cli_enc_opt_state, MDL); |
312 | if (opt_state != NULL) | |
313 | option_state_dereference(&opt_state, MDL); | |
314 | + | |
315 | + TRACE(DHCPD_6_CONFIRM_DONE()); | |
316 | } | |
317 | ||
318 | /* | |
444c1184 | 319 | @@ -4553,6 +4566,8 @@ dhcpv6_renew(struct data_string *reply, |
6df985df SS |
320 | struct data_string client_id; |
321 | struct data_string server_id; | |
322 | ||
323 | + TRACE(DHCPD_6_RENEW_START()); | |
324 | + | |
325 | /* | |
326 | * Validate the request. | |
327 | */ | |
444c1184 | 328 | @@ -4570,6 +4585,8 @@ dhcpv6_renew(struct data_string *reply, |
6df985df SS |
329 | */ |
330 | data_string_forget(&server_id, MDL); | |
331 | data_string_forget(&client_id, MDL); | |
332 | + | |
333 | + TRACE(DHCPD_6_RENEW_DONE()); | |
334 | } | |
335 | ||
336 | /* | |
444c1184 | 337 | @@ -4583,6 +4600,8 @@ static void |
6df985df SS |
338 | dhcpv6_rebind(struct data_string *reply, struct packet *packet) { |
339 | struct data_string client_id; | |
340 | ||
341 | + TRACE(DHCPD_6_REBIND_START()); | |
342 | + | |
343 | if (!valid_client_msg(packet, &client_id)) { | |
344 | return; | |
345 | } | |
444c1184 | 346 | @@ -4590,6 +4609,8 @@ dhcpv6_rebind(struct data_string *reply, |
6df985df SS |
347 | lease_to_client(reply, packet, &client_id, NULL); |
348 | ||
349 | data_string_forget(&client_id, MDL); | |
350 | + | |
351 | + TRACE(DHCPD_6_REBIND_DONE()); | |
352 | } | |
353 | ||
354 | static void | |
444c1184 | 355 | @@ -5034,6 +5055,8 @@ dhcpv6_decline(struct data_string *reply |
6df985df SS |
356 | struct data_string client_id; |
357 | struct data_string server_id; | |
358 | ||
359 | + TRACE(DHCPD_6_DECLINE_START()); | |
360 | + | |
361 | /* | |
362 | * Validate our input. | |
363 | */ | |
444c1184 | 364 | @@ -5054,6 +5077,8 @@ dhcpv6_decline(struct data_string *reply |
6df985df SS |
365 | |
366 | data_string_forget(&server_id, MDL); | |
367 | data_string_forget(&client_id, MDL); | |
368 | + | |
369 | + TRACE(DHCPD_6_DECLINE_DONE()); | |
370 | } | |
371 | ||
372 | static void | |
444c1184 | 373 | @@ -5502,6 +5527,8 @@ dhcpv6_release(struct data_string *reply |
6df985df SS |
374 | struct data_string client_id; |
375 | struct data_string server_id; | |
376 | ||
377 | + TRACE(DHCPD_6_RELEASE_START()); | |
378 | + | |
379 | /* | |
380 | * Validate our input. | |
381 | */ | |
444c1184 | 382 | @@ -5523,6 +5550,8 @@ dhcpv6_release(struct data_string *reply |
6df985df SS |
383 | |
384 | data_string_forget(&server_id, MDL); | |
385 | data_string_forget(&client_id, MDL); | |
386 | + | |
387 | + TRACE(DHCPD_6_RELEASE_DONE()); | |
388 | } | |
389 | ||
390 | /* | |
444c1184 | 391 | @@ -5535,6 +5564,8 @@ dhcpv6_information_request(struct data_s |
6df985df SS |
392 | struct data_string client_id; |
393 | struct data_string server_id; | |
394 | ||
395 | + TRACE(DHCPD_6_INFORMATION_REQUEST_START()); | |
396 | + | |
397 | /* | |
398 | * Validate our input. | |
399 | */ | |
444c1184 | 400 | @@ -5566,6 +5597,8 @@ dhcpv6_information_request(struct data_s |
6df985df SS |
401 | data_string_forget(&client_id, MDL); |
402 | } | |
403 | data_string_forget(&server_id, MDL); | |
404 | + | |
405 | + TRACE(DHCPD_6_INFORMATION_REQUEST_DONE()); | |
406 | } | |
407 | ||
408 | /* | |
444c1184 | 409 | @@ -5594,6 +5627,8 @@ dhcpv6_relay_forw(struct data_string *re |
6df985df SS |
410 | struct dhcpv6_relay_packet *reply; |
411 | int reply_ofs; | |
412 | ||
413 | + TRACE(DHCPD_6_RELAY_FORW_START()); | |
414 | + | |
415 | /* | |
416 | * Initialize variables for early exit. | |
417 | */ | |
444c1184 | 418 | @@ -5853,6 +5888,8 @@ exit: |
6df985df SS |
419 | if (enc_packet != NULL) { |
420 | packet_dereference(&enc_packet, MDL); | |
421 | } | |
422 | + | |
423 | + TRACE(DHCPD_6_RELAY_FORW_DONE()); | |
424 | } | |
425 | ||
426 | static void | |
444c1184 MT |
427 | diff -up dhcp-4.2.4b1/server/failover.c.systemtap dhcp-4.2.4b1/server/failover.c |
428 | --- dhcp-4.2.4b1/server/failover.c.systemtap 2012-03-19 23:29:49.000000000 +0100 | |
429 | +++ dhcp-4.2.4b1/server/failover.c 2012-04-16 17:46:10.955226555 +0200 | |
430 | @@ -36,6 +36,8 @@ | |
6df985df SS |
431 | #include "dhcpd.h" |
432 | #include <omapip/omapip_p.h> | |
433 | ||
434 | +#include "trace.h" | |
435 | + | |
436 | #if defined (FAILOVER_PROTOCOL) | |
437 | dhcp_failover_state_t *failover_states; | |
438 | static isc_result_t do_a_failover_option (omapi_object_t *, | |
444c1184 | 439 | @@ -1712,6 +1714,8 @@ isc_result_t dhcp_failover_set_state (dh |
6df985df SS |
440 | struct lease *l; |
441 | struct timeval tv; | |
442 | ||
443 | + TRACE(DHCPD_FAILOVER_SET_STATE_START(state->me.state, new_state)); | |
444 | + | |
445 | /* If we're in certain states where we're sending updates, and the peer | |
446 | * state changes, we need to re-schedule any pending updates just to | |
447 | * be on the safe side. This results in retransmission. | |
444c1184 | 448 | @@ -1939,6 +1943,8 @@ isc_result_t dhcp_failover_set_state (dh |
6df985df SS |
449 | break; |
450 | } | |
451 | ||
452 | + TRACE(DHCPD_FAILOVER_SET_STATE_DONE()); | |
453 | + | |
454 | return ISC_R_SUCCESS; | |
455 | } | |
456 | ||
444c1184 | 457 | @@ -2422,6 +2428,8 @@ dhcp_failover_pool_dobalance(dhcp_failov |
6df985df SS |
458 | if (state -> me.state != normal) |
459 | return 0; | |
460 | ||
461 | + TRACE(DHCPD_FAILOVER_POOL_DOBALANCE_START()); | |
462 | + | |
463 | state->last_balance = cur_time; | |
464 | ||
465 | for (s = shared_networks ; s ; s = s->next) { | |
444c1184 | 466 | @@ -2582,6 +2590,8 @@ dhcp_failover_pool_dobalance(dhcp_failov |
6df985df SS |
467 | if (leases_queued) |
468 | commit_leases(); | |
469 | ||
470 | + TRACE(DHCPD_FAILOVER_POOL_DOBALANCE_DONE()); | |
471 | + | |
472 | return leases_queued; | |
473 | } | |
474 | ||
444c1184 MT |
475 | diff -up dhcp-4.2.4b1/server/Makefile.am.systemtap dhcp-4.2.4b1/server/Makefile.am |
476 | --- dhcp-4.2.4b1/server/Makefile.am.systemtap 2012-04-16 17:46:10.914227129 +0200 | |
477 | +++ dhcp-4.2.4b1/server/Makefile.am 2012-04-16 17:46:10.956226541 +0200 | |
6df985df SS |
478 | @@ -4,7 +4,7 @@ dist_sysconf_DATA = dhcpd.conf |
479 | sbin_PROGRAMS = dhcpd | |
480 | dhcpd_SOURCES = dhcpd.c dhcp.c bootp.c confpars.c db.c class.c failover.c \ | |
481 | omapi.c mdb.c stables.c salloc.c ddns.c dhcpleasequery.c \ | |
482 | - dhcpv6.c mdb6.c ldap.c ldap_casa.c | |
483 | + dhcpv6.c mdb6.c ldap.c ldap_casa.c probes.d trace.h | |
484 | ||
485 | dhcpd_CFLAGS = $(LDAP_CFLAGS) | |
486 | dhcpd_LDADD = ../common/libdhcp.a ../omapip/libomapi.la \ | |
444c1184 | 487 | @@ -13,3 +13,13 @@ dhcpd_LDADD = ../common/libdhcp.a ../oma |
6df985df SS |
488 | man_MANS = dhcpd.8 dhcpd.conf.5 dhcpd.leases.5 |
489 | EXTRA_DIST = $(man_MANS) | |
490 | ||
491 | +if ENABLE_SYSTEMTAP | |
492 | +BUILT_SOURCES = probes.h | |
493 | +probes.h: probes.d | |
494 | + $(DTRACE) -C -h -s $< -o $@ | |
495 | + | |
496 | +probes.o: probes.d | |
497 | + $(DTRACE) -C -G -s $< -o $@ | |
498 | + | |
499 | +dhcpd_LDADD += probes.o | |
500 | +endif | |
444c1184 MT |
501 | diff -up dhcp-4.2.4b1/server/probes.d.systemtap dhcp-4.2.4b1/server/probes.d |
502 | --- dhcp-4.2.4b1/server/probes.d.systemtap 2012-04-16 17:46:10.956226541 +0200 | |
503 | +++ dhcp-4.2.4b1/server/probes.d 2012-04-16 17:46:10.956226541 +0200 | |
6df985df SS |
504 | @@ -0,0 +1,43 @@ |
505 | +provider dhcpd { | |
506 | + probe main(); | |
507 | + probe discover_start() | |
508 | + probe discover_done() | |
509 | + probe request_start() | |
510 | + probe request_done() | |
511 | + probe release_start() | |
512 | + probe release_done() | |
513 | + probe decline_start() | |
514 | + probe decline_done() | |
515 | + probe inform_start() | |
516 | + probe inform_done() | |
517 | + probe nak_lease_start() | |
518 | + probe nak_lease_done() | |
519 | + probe ack_lease_start() | |
520 | + probe ack_lease_done() | |
521 | + probe reply_start() | |
522 | + probe reply_done() | |
523 | + probe find_lease_start() | |
524 | + probe find_lease_done() | |
525 | + probe 6_solicit_start() | |
526 | + probe 6_solicit_done() | |
527 | + probe 6_request_start() | |
528 | + probe 6_request_done() | |
529 | + probe 6_confirm_start() | |
530 | + probe 6_confirm_done() | |
531 | + probe 6_renew_start() | |
532 | + probe 6_renew_done() | |
533 | + probe 6_rebind_start() | |
534 | + probe 6_rebind_done() | |
535 | + probe 6_decline_start() | |
536 | + probe 6_decline_done() | |
537 | + probe 6_release_start() | |
538 | + probe 6_release_done() | |
539 | + probe 6_information_request_start() | |
540 | + probe 6_information_request_done() | |
541 | + probe 6_relay_forw_start() | |
542 | + probe 6_relay_forw_done() | |
543 | + probe failover_pool_dobalance_start() | |
544 | + probe failover_pool_dobalance_done() | |
545 | + probe failover_set_state_start(int, int) /* state, new_state */ | |
546 | + probe failover_set_state_done() | |
547 | +}; | |
444c1184 MT |
548 | diff -up dhcp-4.2.4b1/server/trace.h.systemtap dhcp-4.2.4b1/server/trace.h |
549 | --- dhcp-4.2.4b1/server/trace.h.systemtap 2012-04-16 17:46:10.956226541 +0200 | |
550 | +++ dhcp-4.2.4b1/server/trace.h 2012-04-16 17:46:10.956226541 +0200 | |
6df985df SS |
551 | @@ -0,0 +1,11 @@ |
552 | +// trace.h | |
553 | + | |
554 | +#include "config.h" | |
555 | +#ifdef HAVE_SYSTEMTAP | |
556 | +// include the generated probes header and put markers in code | |
557 | +#include "probes.h" | |
558 | +#define TRACE(probe) probe | |
559 | +#else | |
560 | +// Wrap the probe to allow it to be removed when no systemtap available | |
561 | +#define TRACE(probe) | |
562 | +#endif | |
444c1184 MT |
563 | diff -up dhcp-4.2.4b1/tapset/dhcpd.stp.systemtap dhcp-4.2.4b1/tapset/dhcpd.stp |
564 | --- dhcp-4.2.4b1/tapset/dhcpd.stp.systemtap 2012-04-16 17:46:10.957226527 +0200 | |
565 | +++ dhcp-4.2.4b1/tapset/dhcpd.stp 2012-04-16 17:46:10.957226527 +0200 | |
6df985df SS |
566 | @@ -0,0 +1,212 @@ |
567 | +/* dhcpd tapset | |
568 | + Copyright (C) 2011, Red Hat Inc. | |
569 | + */ | |
570 | + | |
571 | +probe dhcpd_main = process("dhcpd").mark("main") | |
572 | +{ | |
573 | + probestr = sprintf("%s(locals: %s)", $$name, $$locals); | |
574 | + | |
575 | +} | |
576 | + | |
577 | +probe dhcpd_discover_start = process("dhcpd").mark("discover_start") | |
578 | +{ | |
579 | + probestr = sprintf("%s", $$name); | |
580 | +} | |
581 | + | |
582 | +probe dhcpd_discover_done = process("dhcpd").mark("discover_done") | |
583 | +{ | |
584 | + probestr = sprintf("%s", $$name); | |
585 | +} | |
586 | + | |
587 | +probe dhcpd_request_start = process("dhcpd").mark("request_start") | |
588 | +{ | |
589 | + probestr = sprintf("%s", $$name); | |
590 | +} | |
591 | + | |
592 | +probe dhcpd_request_done = process("dhcpd").mark("request_done") | |
593 | +{ | |
594 | + probestr = sprintf("%s", $$name); | |
595 | +} | |
596 | + | |
597 | +probe dhcpd_release_start = process("dhcpd").mark("release_start") | |
598 | +{ | |
599 | + probestr = sprintf("%s", $$name); | |
600 | +} | |
601 | + | |
602 | +probe dhcpd_release_done = process("dhcpd").mark("release_done") | |
603 | +{ | |
604 | + probestr = sprintf("%s", $$name); | |
605 | +} | |
606 | + | |
607 | +probe dhcpd_decline_start = process("dhcpd").mark("decline_start") | |
608 | +{ | |
609 | + probestr = sprintf("%s", $$name); | |
610 | +} | |
611 | + | |
612 | +probe dhcpd_decline_done = process("dhcpd").mark("decline_done") | |
613 | +{ | |
614 | + probestr = sprintf("%s", $$name); | |
615 | +} | |
616 | + | |
617 | +probe dhcpd_inform_start = process("dhcpd").mark("inform_start") | |
618 | +{ | |
619 | + probestr = sprintf("%s", $$name); | |
620 | +} | |
621 | + | |
622 | +probe dhcpd_inform_done = process("dhcpd").mark("inform_done") | |
623 | +{ | |
624 | + probestr = sprintf("%s", $$name); | |
625 | +} | |
626 | + | |
627 | +probe dhcpd_nak_lease_start = process("dhcpd").mark("nak_lease_start") | |
628 | +{ | |
629 | + probestr = sprintf("%s", $$name); | |
630 | +} | |
631 | + | |
632 | +probe dhcpd_nak_lease_done = process("dhcpd").mark("nak_lease_done") | |
633 | +{ | |
634 | + probestr = sprintf("%s", $$name); | |
635 | +} | |
636 | + | |
637 | +probe dhcpd_ack_lease_start = process("dhcpd").mark("ack_lease_start") | |
638 | +{ | |
639 | + probestr = sprintf("%s", $$name); | |
640 | +} | |
641 | + | |
642 | +probe dhcpd_ack_lease_done = process("dhcpd").mark("ack_lease_done") | |
643 | +{ | |
644 | + probestr = sprintf("%s", $$name); | |
645 | +} | |
646 | + | |
647 | +probe dhcpd_reply_start = process("dhcpd").mark("reply_start") | |
648 | +{ | |
649 | + probestr = sprintf("%s", $$name); | |
650 | +} | |
651 | + | |
652 | +probe dhcpd_reply_done = process("dhcpd").mark("reply_done") | |
653 | +{ | |
654 | + probestr = sprintf("%s", $$name); | |
655 | +} | |
656 | + | |
657 | +probe dhcpd_find_lease_start = process("dhcpd").mark("find_lease_start") | |
658 | +{ | |
659 | + probestr = sprintf("%s", $$name); | |
660 | +} | |
661 | + | |
662 | +probe dhcpd_find_lease_done = process("dhcpd").mark("find_lease_done") | |
663 | +{ | |
664 | + probestr = sprintf("%s", $$name); | |
665 | +} | |
666 | + | |
667 | +probe dhcpd_6_solicit_start = process("dhcpd").mark("6_solicit_start") | |
668 | +{ | |
669 | + probestr = sprintf("%s", $$name); | |
670 | +} | |
671 | + | |
672 | +probe dhcpd_6_solicit_done = process("dhcpd").mark("6_solicit_done") | |
673 | +{ | |
674 | + probestr = sprintf("%s", $$name); | |
675 | +} | |
676 | + | |
677 | +probe dhcpd_6_request_start = process("dhcpd").mark("6_request_start") | |
678 | +{ | |
679 | + probestr = sprintf("%s", $$name); | |
680 | +} | |
681 | + | |
682 | +probe dhcpd_6_request_done = process("dhcpd").mark("6_request_done") | |
683 | +{ | |
684 | + probestr = sprintf("%s", $$name); | |
685 | +} | |
686 | + | |
687 | +probe dhcpd_6_confirm_start = process("dhcpd").mark("6_confirm_start") | |
688 | +{ | |
689 | + probestr = sprintf("%s", $$name); | |
690 | +} | |
691 | + | |
692 | +probe dhcpd_6_confirm_done = process("dhcpd").mark("6_confirm_done") | |
693 | +{ | |
694 | + probestr = sprintf("%s", $$name); | |
695 | +} | |
696 | + | |
697 | +probe dhcpd_6_renew_start = process("dhcpd").mark("6_renew_start") | |
698 | +{ | |
699 | + probestr = sprintf("%s", $$name); | |
700 | +} | |
701 | + | |
702 | +probe dhcpd_6_renew_done = process("dhcpd").mark("6_renew_done") | |
703 | +{ | |
704 | + probestr = sprintf("%s", $$name); | |
705 | +} | |
706 | + | |
707 | +probe dhcpd_6_rebind_start = process("dhcpd").mark("6_rebind_start") | |
708 | +{ | |
709 | + probestr = sprintf("%s", $$name); | |
710 | +} | |
711 | + | |
712 | +probe dhcpd_6_rebind_done = process("dhcpd").mark("6_rebind_done") | |
713 | +{ | |
714 | + probestr = sprintf("%s", $$name); | |
715 | +} | |
716 | + | |
717 | +probe dhcpd_6_decline_start = process("dhcpd").mark("6_decline_start") | |
718 | +{ | |
719 | + probestr = sprintf("%s", $$name); | |
720 | +} | |
721 | + | |
722 | +probe dhcpd_6_decline_done = process("dhcpd").mark("6_decline_done") | |
723 | +{ | |
724 | + probestr = sprintf("%s", $$name); | |
725 | +} | |
726 | + | |
727 | +probe dhcpd_6_release_start = process("dhcpd").mark("6_release_start") | |
728 | +{ | |
729 | + probestr = sprintf("%s", $$name); | |
730 | +} | |
731 | + | |
732 | +probe dhcpd_6_release_done = process("dhcpd").mark("6_release_done") | |
733 | +{ | |
734 | + probestr = sprintf("%s", $$name); | |
735 | +} | |
736 | + | |
737 | +probe dhcpd_6_information_request_start = process("dhcpd").mark("6_information_request_start") | |
738 | +{ | |
739 | + probestr = sprintf("%s", $$name); | |
740 | +} | |
741 | + | |
742 | +probe dhcpd_6_information_request_done = process("dhcpd").mark("6_information_request_done") | |
743 | +{ | |
744 | + probestr = sprintf("%s", $$name); | |
745 | +} | |
746 | + | |
747 | +probe dhcpd_6_relay_forw_start = process("dhcpd").mark("6_relay_forw_start") | |
748 | +{ | |
749 | + probestr = sprintf("%s", $$name); | |
750 | +} | |
751 | + | |
752 | +probe dhcpd_6_relay_forw_done = process("dhcpd").mark("6_relay_forw_done") | |
753 | +{ | |
754 | + probestr = sprintf("%s", $$name); | |
755 | +} | |
756 | + | |
757 | +probe dhcpd_failover_pool_dobalance_start = process("dhcpd").mark("failover_pool_dobalance_start") | |
758 | +{ | |
759 | + probestr = sprintf("%s", $$name); | |
760 | +} | |
761 | + | |
762 | +probe dhcpd_failover_pool_dobalance_done = process("dhcpd").mark("failover_pool_dobalance_done") | |
763 | +{ | |
764 | + probestr = sprintf("%s", $$name); | |
765 | +} | |
766 | + | |
767 | + | |
768 | +probe dhcpd_failover_set_state_start = process("dhcpd").mark("failover_set_state_start") | |
769 | +{ | |
770 | + state = $arg1; | |
771 | + new_state = $arg2; | |
772 | + probestr = sprintf("%s(state=%d, new_state=%d)", $$name, state, new_state); | |
773 | +} | |
774 | + | |
775 | +probe dhcpd_failover_set_state_done = process("dhcpd").mark("failover_set_state_done") | |
776 | +{ | |
777 | + probestr = sprintf("%s", $$name); | |
778 | +} | |
444c1184 MT |
779 | diff -up dhcp-4.2.4b1/tapset/Makefile.am.systemtap dhcp-4.2.4b1/tapset/Makefile.am |
780 | --- dhcp-4.2.4b1/tapset/Makefile.am.systemtap 2012-04-16 17:46:10.957226527 +0200 | |
781 | +++ dhcp-4.2.4b1/tapset/Makefile.am 2012-04-16 17:46:10.957226527 +0200 | |
6df985df SS |
782 | @@ -0,0 +1,26 @@ |
783 | +# Makefile.am for dhcp/tapset | |
784 | +# Jiri Popelka | |
785 | + | |
786 | +.PHONY: clean-local install-data-hook uninstall-local | |
787 | + | |
788 | +# | |
789 | +EXTRA_DIST = dhcpd.stp | |
790 | +TAPSET_FILES = $(EXTRA_DIST) | |
791 | +TAPSET_INSTALL_DIR = $(DESTDIR)@ABS_TAPSET_DIR@ | |
792 | + | |
793 | +if ENABLE_SYSTEMTAP | |
794 | +all-local: $(TAPSET_FILES) | |
795 | + | |
796 | +clean-local: | |
797 | + | |
798 | +install-data-hook: | |
799 | + $(MKDIR_P) $(TAPSET_INSTALL_DIR) | |
800 | + $(INSTALL_DATA) $(TAPSET_FILES) $(TAPSET_INSTALL_DIR) | |
801 | + | |
802 | +uninstall-local: | |
803 | + @list='$(TAPSET_FILES)'; for p in $$list; do \ | |
804 | + echo " rm -f '$(TAPSET_INSTALL_DIR)/$$p'"; \ | |
805 | + rm -f "$(TAPSET_INSTALL_DIR)/$$p"; \ | |
806 | + done | |
807 | +endif | |
808 | + |