]>
Commit | Line | Data |
---|---|---|
6df985df SS |
1 | diff -up dhcp-4.2.2/configure.ac.systemtap dhcp-4.2.2/configure.ac |
2 | --- dhcp-4.2.2/configure.ac.systemtap 2011-09-21 15:13:35.515434854 +0200 | |
3 | +++ dhcp-4.2.2/configure.ac 2011-09-21 15:13:35.574434049 +0200 | |
4 | @@ -485,6 +485,35 @@ else | |
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]) | |
40 | @@ -631,6 +660,7 @@ AC_OUTPUT([ | |
41 | relay/Makefile | |
42 | server/Makefile | |
43 | tests/Makefile | |
44 | + tapset/Makefile | |
45 | ]) | |
46 | ||
47 | sh util/bindvar.sh | |
48 | diff -up dhcp-4.2.2/Makefile.am.systemtap dhcp-4.2.2/Makefile.am | |
49 | --- dhcp-4.2.2/Makefile.am.systemtap 2011-09-21 15:13:35.339437258 +0200 | |
50 | +++ dhcp-4.2.2/Makefile.am 2011-09-21 15:13:35.574434049 +0200 | |
51 | @@ -29,5 +29,8 @@ endif | |
52 | ||
53 | SUBDIRS += includes tests common dst omapip client dhcpctl relay server | |
54 | ||
55 | +SUBDIRS += tapset | |
56 | +#DIST_SUBDIRS = $(SUBDIRS) | |
57 | + | |
58 | nobase_include_HEADERS = dhcpctl/dhcpctl.h | |
59 | ||
60 | diff -up dhcp-4.2.2/server/dhcp.c.systemtap dhcp-4.2.2/server/dhcp.c | |
61 | --- dhcp-4.2.2/server/dhcp.c.systemtap 2011-09-21 15:13:35.362436945 +0200 | |
62 | +++ dhcp-4.2.2/server/dhcp.c 2011-09-21 15:13:35.576434021 +0200 | |
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) | |
90 | @@ -422,6 +426,8 @@ void dhcprequest (packet, ms_nulltp, ip_ | |
91 | int have_server_identifier = 0; | |
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); | |
99 | @@ -679,6 +685,9 @@ void dhcprequest (packet, ms_nulltp, ip_ | |
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) | |
109 | @@ -697,6 +706,7 @@ void dhcprelease (packet, ms_nulltp) | |
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, | |
117 | @@ -821,6 +831,8 @@ void dhcprelease (packet, ms_nulltp) | |
118 | #endif | |
119 | if (lease) | |
120 | lease_dereference (&lease, MDL); | |
121 | + | |
122 | + TRACE(DHCPD_RELEASE_DONE()); | |
123 | } | |
124 | ||
125 | void dhcpdecline (packet, ms_nulltp) | |
126 | @@ -838,6 +850,8 @@ void dhcpdecline (packet, ms_nulltp) | |
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))) | |
135 | @@ -949,6 +963,8 @@ void dhcpdecline (packet, ms_nulltp) | |
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) | |
145 | struct in_addr from; | |
146 | isc_boolean_t zeroed_ciaddr; | |
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. */ | |
153 | @@ -1320,6 +1338,8 @@ void dhcpinform (packet, ms_nulltp) | |
154 | from, &to, (struct hardware *)0); | |
155 | if (subnet) | |
156 | subnet_dereference (&subnet, MDL); | |
157 | + | |
158 | + TRACE(DHCPD_INFORM_DONE()); | |
159 | } | |
160 | ||
161 | void nak_lease (packet, cip) | |
162 | @@ -1336,6 +1356,8 @@ void nak_lease (packet, cip) | |
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); | |
171 | @@ -1474,6 +1496,8 @@ void nak_lease (packet, cip) | |
172 | errno = 0; | |
173 | result = send_packet(packet->interface, packet, &raw, | |
174 | outgoing.packet_length, from, &to, NULL); | |
175 | + | |
176 | + TRACE(DHCPD_NAK_LEASE_DONE()); | |
177 | } | |
178 | ||
179 | void ack_lease (packet, lease, offer, when, msg, ms_nulltp, hp) | |
180 | @@ -1515,6 +1539,8 @@ void ack_lease (packet, lease, offer, wh | |
181 | if (lease -> state) | |
182 | return; | |
183 | ||
184 | + TRACE(DHCPD_ACK_LEASE_START()); | |
185 | + | |
186 | /* Save original cltt for comparison later. */ | |
187 | lease_cltt = lease->cltt; | |
188 | ||
189 | @@ -2877,6 +2903,8 @@ void ack_lease (packet, lease, offer, wh | |
190 | #endif | |
191 | dhcp_reply(lease); | |
192 | } | |
193 | + | |
194 | + TRACE(DHCPD_ACK_LEASE_DONE()); | |
195 | } | |
196 | ||
197 | /* | |
198 | @@ -3029,6 +3057,8 @@ void dhcp_reply (lease) | |
199 | if (!state) | |
200 | log_fatal ("dhcp_reply was supplied lease with no state!"); | |
201 | ||
202 | + TRACE(DHCPD_REPLY_START()); | |
203 | + | |
204 | /* Compose a response for the client... */ | |
205 | memset (&raw, 0, sizeof raw); | |
206 | memset (&d1, 0, sizeof d1); | |
207 | @@ -3236,6 +3266,8 @@ void dhcp_reply (lease) | |
208 | ||
209 | free_lease_state (state, MDL); | |
210 | lease -> state = (struct lease_state *)0; | |
211 | + | |
212 | + TRACE(DHCPD_REPLY_DONE()); | |
213 | } | |
214 | ||
215 | int find_lease (struct lease **lp, | |
216 | @@ -3258,6 +3290,8 @@ int find_lease (struct lease **lp, | |
217 | struct data_string client_identifier; | |
218 | struct hardware h; | |
219 | ||
220 | + TRACE(DHCPD_FIND_LEASE_START()); | |
221 | + | |
222 | #if defined(FAILOVER_PROTOCOL) | |
223 | /* Quick check to see if the peer has leases. */ | |
224 | if (peer_has_leases) { | |
225 | @@ -3985,6 +4019,9 @@ int find_lease (struct lease **lp, | |
226 | #if defined (DEBUG_FIND_LEASE) | |
227 | log_info ("Not returning a lease."); | |
228 | #endif | |
229 | + | |
230 | + TRACE(DHCPD_FIND_LEASE_DONE()); | |
231 | + | |
232 | return 0; | |
233 | } | |
234 | ||
235 | diff -up dhcp-4.2.2/server/dhcpd.c.systemtap dhcp-4.2.2/server/dhcpd.c | |
236 | --- dhcp-4.2.2/server/dhcpd.c.systemtap 2011-09-21 15:13:35.471435455 +0200 | |
237 | +++ dhcp-4.2.2/server/dhcpd.c 2011-09-21 15:14:47.686449112 +0200 | |
238 | @@ -63,6 +63,8 @@ static const char url [] = | |
239 | int keep_capabilities = 0; | |
240 | #endif | |
241 | ||
242 | +#include "trace.h" | |
243 | + | |
244 | static void usage(void); | |
245 | ||
246 | struct iaddr server_identifier; | |
247 | @@ -887,7 +889,7 @@ main(int argc, char **argv) { | |
248 | log_info ("Dropped all capabilities."); | |
249 | } | |
250 | #endif | |
251 | - | |
252 | + TRACE(DHCPD_MAIN()); | |
253 | /* Receive packets and dispatch them... */ | |
254 | dispatch (); | |
255 | ||
256 | diff -up dhcp-4.2.2/server/dhcpv6.c.systemtap dhcp-4.2.2/server/dhcpv6.c | |
257 | --- dhcp-4.2.2/server/dhcpv6.c.systemtap 2011-09-21 15:13:35.528434676 +0200 | |
258 | +++ dhcp-4.2.2/server/dhcpv6.c 2011-09-21 15:13:35.579433979 +0200 | |
259 | @@ -15,6 +15,7 @@ | |
260 | */ | |
261 | ||
262 | #include "dhcpd.h" | |
263 | +#include "trace.h" | |
264 | ||
265 | #ifdef DHCPv6 | |
266 | ||
267 | @@ -4171,6 +4172,8 @@ static void | |
268 | dhcpv6_solicit(struct data_string *reply_ret, struct packet *packet) { | |
269 | struct data_string client_id; | |
270 | ||
271 | + TRACE(DHCPD_6_SOLICIT_START()); | |
272 | + | |
273 | /* | |
274 | * Validate our input. | |
275 | */ | |
276 | @@ -4184,6 +4187,8 @@ dhcpv6_solicit(struct data_string *reply | |
277 | * Clean up. | |
278 | */ | |
279 | data_string_forget(&client_id, MDL); | |
280 | + | |
281 | + TRACE(DHCPD_6_SOLICIT_DONE()); | |
282 | } | |
283 | ||
284 | /* | |
285 | @@ -4197,6 +4202,8 @@ dhcpv6_request(struct data_string *reply | |
286 | struct data_string client_id; | |
287 | struct data_string server_id; | |
288 | ||
289 | + TRACE(DHCPD_6_REQUEST_START()); | |
290 | + | |
291 | /* | |
292 | * Validate our input. | |
293 | */ | |
294 | @@ -4214,6 +4221,8 @@ dhcpv6_request(struct data_string *reply | |
295 | */ | |
296 | data_string_forget(&client_id, MDL); | |
297 | data_string_forget(&server_id, MDL); | |
298 | + | |
299 | + TRACE(DHCPD_6_REQUEST_DONE()); | |
300 | } | |
301 | ||
302 | /* Find a DHCPv6 packet's shared network from hints in the packet. | |
303 | @@ -4326,6 +4335,8 @@ dhcpv6_confirm(struct data_string *reply | |
304 | struct dhcpv6_packet *reply = (struct dhcpv6_packet *)reply_data; | |
305 | int reply_ofs = (int)(offsetof(struct dhcpv6_packet, options)); | |
306 | ||
307 | + TRACE(DHCPD_6_CONFIRM_START()); | |
308 | + | |
309 | /* | |
310 | * Basic client message validation. | |
311 | */ | |
312 | @@ -4512,6 +4523,8 @@ exit: | |
313 | option_state_dereference(&cli_enc_opt_state, MDL); | |
314 | if (opt_state != NULL) | |
315 | option_state_dereference(&opt_state, MDL); | |
316 | + | |
317 | + TRACE(DHCPD_6_CONFIRM_DONE()); | |
318 | } | |
319 | ||
320 | /* | |
321 | @@ -4526,6 +4539,8 @@ dhcpv6_renew(struct data_string *reply, | |
322 | struct data_string client_id; | |
323 | struct data_string server_id; | |
324 | ||
325 | + TRACE(DHCPD_6_RENEW_START()); | |
326 | + | |
327 | /* | |
328 | * Validate the request. | |
329 | */ | |
330 | @@ -4543,6 +4558,8 @@ dhcpv6_renew(struct data_string *reply, | |
331 | */ | |
332 | data_string_forget(&server_id, MDL); | |
333 | data_string_forget(&client_id, MDL); | |
334 | + | |
335 | + TRACE(DHCPD_6_RENEW_DONE()); | |
336 | } | |
337 | ||
338 | /* | |
339 | @@ -4556,6 +4573,8 @@ static void | |
340 | dhcpv6_rebind(struct data_string *reply, struct packet *packet) { | |
341 | struct data_string client_id; | |
342 | ||
343 | + TRACE(DHCPD_6_REBIND_START()); | |
344 | + | |
345 | if (!valid_client_msg(packet, &client_id)) { | |
346 | return; | |
347 | } | |
348 | @@ -4563,6 +4582,8 @@ dhcpv6_rebind(struct data_string *reply, | |
349 | lease_to_client(reply, packet, &client_id, NULL); | |
350 | ||
351 | data_string_forget(&client_id, MDL); | |
352 | + | |
353 | + TRACE(DHCPD_6_REBIND_DONE()); | |
354 | } | |
355 | ||
356 | static void | |
357 | @@ -5009,6 +5030,8 @@ dhcpv6_decline(struct data_string *reply | |
358 | struct data_string client_id; | |
359 | struct data_string server_id; | |
360 | ||
361 | + TRACE(DHCPD_6_DECLINE_START()); | |
362 | + | |
363 | /* | |
364 | * Validate our input. | |
365 | */ | |
366 | @@ -5029,6 +5052,8 @@ dhcpv6_decline(struct data_string *reply | |
367 | ||
368 | data_string_forget(&server_id, MDL); | |
369 | data_string_forget(&client_id, MDL); | |
370 | + | |
371 | + TRACE(DHCPD_6_DECLINE_DONE()); | |
372 | } | |
373 | ||
374 | static void | |
375 | @@ -5479,6 +5504,8 @@ dhcpv6_release(struct data_string *reply | |
376 | struct data_string client_id; | |
377 | struct data_string server_id; | |
378 | ||
379 | + TRACE(DHCPD_6_RELEASE_START()); | |
380 | + | |
381 | /* | |
382 | * Validate our input. | |
383 | */ | |
384 | @@ -5500,6 +5527,8 @@ dhcpv6_release(struct data_string *reply | |
385 | ||
386 | data_string_forget(&server_id, MDL); | |
387 | data_string_forget(&client_id, MDL); | |
388 | + | |
389 | + TRACE(DHCPD_6_RELEASE_DONE()); | |
390 | } | |
391 | ||
392 | /* | |
393 | @@ -5512,6 +5541,8 @@ dhcpv6_information_request(struct data_s | |
394 | struct data_string client_id; | |
395 | struct data_string server_id; | |
396 | ||
397 | + TRACE(DHCPD_6_INFORMATION_REQUEST_START()); | |
398 | + | |
399 | /* | |
400 | * Validate our input. | |
401 | */ | |
402 | @@ -5543,6 +5574,8 @@ dhcpv6_information_request(struct data_s | |
403 | data_string_forget(&client_id, MDL); | |
404 | } | |
405 | data_string_forget(&server_id, MDL); | |
406 | + | |
407 | + TRACE(DHCPD_6_INFORMATION_REQUEST_DONE()); | |
408 | } | |
409 | ||
410 | /* | |
411 | @@ -5571,6 +5604,8 @@ dhcpv6_relay_forw(struct data_string *re | |
412 | struct dhcpv6_relay_packet *reply; | |
413 | int reply_ofs; | |
414 | ||
415 | + TRACE(DHCPD_6_RELAY_FORW_START()); | |
416 | + | |
417 | /* | |
418 | * Initialize variables for early exit. | |
419 | */ | |
420 | @@ -5828,6 +5863,8 @@ exit: | |
421 | if (enc_packet != NULL) { | |
422 | packet_dereference(&enc_packet, MDL); | |
423 | } | |
424 | + | |
425 | + TRACE(DHCPD_6_RELAY_FORW_DONE()); | |
426 | } | |
427 | ||
428 | static void | |
429 | diff -up dhcp-4.2.2/server/failover.c.systemtap dhcp-4.2.2/server/failover.c | |
430 | --- dhcp-4.2.2/server/failover.c.systemtap 2011-05-11 16:21:00.000000000 +0200 | |
431 | +++ dhcp-4.2.2/server/failover.c 2011-09-21 15:13:35.584433913 +0200 | |
432 | @@ -35,6 +35,8 @@ | |
433 | #include "dhcpd.h" | |
434 | #include <omapip/omapip_p.h> | |
435 | ||
436 | +#include "trace.h" | |
437 | + | |
438 | #if defined (FAILOVER_PROTOCOL) | |
439 | dhcp_failover_state_t *failover_states; | |
440 | static isc_result_t do_a_failover_option (omapi_object_t *, | |
441 | @@ -1711,6 +1713,8 @@ isc_result_t dhcp_failover_set_state (dh | |
442 | struct lease *l; | |
443 | struct timeval tv; | |
444 | ||
445 | + TRACE(DHCPD_FAILOVER_SET_STATE_START(state->me.state, new_state)); | |
446 | + | |
447 | /* If we're in certain states where we're sending updates, and the peer | |
448 | * state changes, we need to re-schedule any pending updates just to | |
449 | * be on the safe side. This results in retransmission. | |
450 | @@ -1938,6 +1942,8 @@ isc_result_t dhcp_failover_set_state (dh | |
451 | break; | |
452 | } | |
453 | ||
454 | + TRACE(DHCPD_FAILOVER_SET_STATE_DONE()); | |
455 | + | |
456 | return ISC_R_SUCCESS; | |
457 | } | |
458 | ||
459 | @@ -2420,6 +2426,8 @@ dhcp_failover_pool_dobalance(dhcp_failov | |
460 | if (state -> me.state != normal) | |
461 | return 0; | |
462 | ||
463 | + TRACE(DHCPD_FAILOVER_POOL_DOBALANCE_START()); | |
464 | + | |
465 | state->last_balance = cur_time; | |
466 | ||
467 | for (s = shared_networks ; s ; s = s->next) { | |
468 | @@ -2580,6 +2588,8 @@ dhcp_failover_pool_dobalance(dhcp_failov | |
469 | if (leases_queued) | |
470 | commit_leases(); | |
471 | ||
472 | + TRACE(DHCPD_FAILOVER_POOL_DOBALANCE_DONE()); | |
473 | + | |
474 | return leases_queued; | |
475 | } | |
476 | ||
477 | diff -up dhcp-4.2.2/server/Makefile.am.systemtap dhcp-4.2.2/server/Makefile.am | |
478 | --- dhcp-4.2.2/server/Makefile.am.systemtap 2011-09-21 15:13:35.517434828 +0200 | |
479 | +++ dhcp-4.2.2/server/Makefile.am 2011-09-21 15:13:35.585433900 +0200 | |
480 | @@ -4,7 +4,7 @@ dist_sysconf_DATA = dhcpd.conf | |
481 | sbin_PROGRAMS = dhcpd | |
482 | dhcpd_SOURCES = dhcpd.c dhcp.c bootp.c confpars.c db.c class.c failover.c \ | |
483 | omapi.c mdb.c stables.c salloc.c ddns.c dhcpleasequery.c \ | |
484 | - dhcpv6.c mdb6.c ldap.c ldap_casa.c | |
485 | + dhcpv6.c mdb6.c ldap.c ldap_casa.c probes.d trace.h | |
486 | ||
487 | dhcpd_CFLAGS = $(LDAP_CFLAGS) | |
488 | dhcpd_LDADD = ../common/libdhcp.a ../omapip/libomapi.la \ | |
489 | @@ -14,3 +14,13 @@ dhcpd_LDADD = ../common/libdhcp.a ../oma | |
490 | man_MANS = dhcpd.8 dhcpd.conf.5 dhcpd.leases.5 | |
491 | EXTRA_DIST = $(man_MANS) | |
492 | ||
493 | +if ENABLE_SYSTEMTAP | |
494 | +BUILT_SOURCES = probes.h | |
495 | +probes.h: probes.d | |
496 | + $(DTRACE) -C -h -s $< -o $@ | |
497 | + | |
498 | +probes.o: probes.d | |
499 | + $(DTRACE) -C -G -s $< -o $@ | |
500 | + | |
501 | +dhcpd_LDADD += probes.o | |
502 | +endif | |
503 | diff -up dhcp-4.2.2/server/probes.d.systemtap dhcp-4.2.2/server/probes.d | |
504 | --- dhcp-4.2.2/server/probes.d.systemtap 2011-09-21 15:13:35.585433900 +0200 | |
505 | +++ dhcp-4.2.2/server/probes.d 2011-09-21 15:13:35.585433900 +0200 | |
506 | @@ -0,0 +1,43 @@ | |
507 | +provider dhcpd { | |
508 | + probe main(); | |
509 | + probe discover_start() | |
510 | + probe discover_done() | |
511 | + probe request_start() | |
512 | + probe request_done() | |
513 | + probe release_start() | |
514 | + probe release_done() | |
515 | + probe decline_start() | |
516 | + probe decline_done() | |
517 | + probe inform_start() | |
518 | + probe inform_done() | |
519 | + probe nak_lease_start() | |
520 | + probe nak_lease_done() | |
521 | + probe ack_lease_start() | |
522 | + probe ack_lease_done() | |
523 | + probe reply_start() | |
524 | + probe reply_done() | |
525 | + probe find_lease_start() | |
526 | + probe find_lease_done() | |
527 | + probe 6_solicit_start() | |
528 | + probe 6_solicit_done() | |
529 | + probe 6_request_start() | |
530 | + probe 6_request_done() | |
531 | + probe 6_confirm_start() | |
532 | + probe 6_confirm_done() | |
533 | + probe 6_renew_start() | |
534 | + probe 6_renew_done() | |
535 | + probe 6_rebind_start() | |
536 | + probe 6_rebind_done() | |
537 | + probe 6_decline_start() | |
538 | + probe 6_decline_done() | |
539 | + probe 6_release_start() | |
540 | + probe 6_release_done() | |
541 | + probe 6_information_request_start() | |
542 | + probe 6_information_request_done() | |
543 | + probe 6_relay_forw_start() | |
544 | + probe 6_relay_forw_done() | |
545 | + probe failover_pool_dobalance_start() | |
546 | + probe failover_pool_dobalance_done() | |
547 | + probe failover_set_state_start(int, int) /* state, new_state */ | |
548 | + probe failover_set_state_done() | |
549 | +}; | |
550 | diff -up dhcp-4.2.2/server/trace.h.systemtap dhcp-4.2.2/server/trace.h | |
551 | --- dhcp-4.2.2/server/trace.h.systemtap 2011-09-21 15:13:35.585433900 +0200 | |
552 | +++ dhcp-4.2.2/server/trace.h 2011-09-21 15:13:35.585433900 +0200 | |
553 | @@ -0,0 +1,11 @@ | |
554 | +// trace.h | |
555 | + | |
556 | +#include "config.h" | |
557 | +#ifdef HAVE_SYSTEMTAP | |
558 | +// include the generated probes header and put markers in code | |
559 | +#include "probes.h" | |
560 | +#define TRACE(probe) probe | |
561 | +#else | |
562 | +// Wrap the probe to allow it to be removed when no systemtap available | |
563 | +#define TRACE(probe) | |
564 | +#endif | |
565 | diff -up dhcp-4.2.2/tapset/dhcpd.stp.systemtap dhcp-4.2.2/tapset/dhcpd.stp | |
566 | --- dhcp-4.2.2/tapset/dhcpd.stp.systemtap 2011-09-21 15:13:35.586433886 +0200 | |
567 | +++ dhcp-4.2.2/tapset/dhcpd.stp 2011-09-21 15:13:35.586433886 +0200 | |
568 | @@ -0,0 +1,212 @@ | |
569 | +/* dhcpd tapset | |
570 | + Copyright (C) 2011, Red Hat Inc. | |
571 | + */ | |
572 | + | |
573 | +probe dhcpd_main = process("dhcpd").mark("main") | |
574 | +{ | |
575 | + probestr = sprintf("%s(locals: %s)", $$name, $$locals); | |
576 | + | |
577 | +} | |
578 | + | |
579 | +probe dhcpd_discover_start = process("dhcpd").mark("discover_start") | |
580 | +{ | |
581 | + probestr = sprintf("%s", $$name); | |
582 | +} | |
583 | + | |
584 | +probe dhcpd_discover_done = process("dhcpd").mark("discover_done") | |
585 | +{ | |
586 | + probestr = sprintf("%s", $$name); | |
587 | +} | |
588 | + | |
589 | +probe dhcpd_request_start = process("dhcpd").mark("request_start") | |
590 | +{ | |
591 | + probestr = sprintf("%s", $$name); | |
592 | +} | |
593 | + | |
594 | +probe dhcpd_request_done = process("dhcpd").mark("request_done") | |
595 | +{ | |
596 | + probestr = sprintf("%s", $$name); | |
597 | +} | |
598 | + | |
599 | +probe dhcpd_release_start = process("dhcpd").mark("release_start") | |
600 | +{ | |
601 | + probestr = sprintf("%s", $$name); | |
602 | +} | |
603 | + | |
604 | +probe dhcpd_release_done = process("dhcpd").mark("release_done") | |
605 | +{ | |
606 | + probestr = sprintf("%s", $$name); | |
607 | +} | |
608 | + | |
609 | +probe dhcpd_decline_start = process("dhcpd").mark("decline_start") | |
610 | +{ | |
611 | + probestr = sprintf("%s", $$name); | |
612 | +} | |
613 | + | |
614 | +probe dhcpd_decline_done = process("dhcpd").mark("decline_done") | |
615 | +{ | |
616 | + probestr = sprintf("%s", $$name); | |
617 | +} | |
618 | + | |
619 | +probe dhcpd_inform_start = process("dhcpd").mark("inform_start") | |
620 | +{ | |
621 | + probestr = sprintf("%s", $$name); | |
622 | +} | |
623 | + | |
624 | +probe dhcpd_inform_done = process("dhcpd").mark("inform_done") | |
625 | +{ | |
626 | + probestr = sprintf("%s", $$name); | |
627 | +} | |
628 | + | |
629 | +probe dhcpd_nak_lease_start = process("dhcpd").mark("nak_lease_start") | |
630 | +{ | |
631 | + probestr = sprintf("%s", $$name); | |
632 | +} | |
633 | + | |
634 | +probe dhcpd_nak_lease_done = process("dhcpd").mark("nak_lease_done") | |
635 | +{ | |
636 | + probestr = sprintf("%s", $$name); | |
637 | +} | |
638 | + | |
639 | +probe dhcpd_ack_lease_start = process("dhcpd").mark("ack_lease_start") | |
640 | +{ | |
641 | + probestr = sprintf("%s", $$name); | |
642 | +} | |
643 | + | |
644 | +probe dhcpd_ack_lease_done = process("dhcpd").mark("ack_lease_done") | |
645 | +{ | |
646 | + probestr = sprintf("%s", $$name); | |
647 | +} | |
648 | + | |
649 | +probe dhcpd_reply_start = process("dhcpd").mark("reply_start") | |
650 | +{ | |
651 | + probestr = sprintf("%s", $$name); | |
652 | +} | |
653 | + | |
654 | +probe dhcpd_reply_done = process("dhcpd").mark("reply_done") | |
655 | +{ | |
656 | + probestr = sprintf("%s", $$name); | |
657 | +} | |
658 | + | |
659 | +probe dhcpd_find_lease_start = process("dhcpd").mark("find_lease_start") | |
660 | +{ | |
661 | + probestr = sprintf("%s", $$name); | |
662 | +} | |
663 | + | |
664 | +probe dhcpd_find_lease_done = process("dhcpd").mark("find_lease_done") | |
665 | +{ | |
666 | + probestr = sprintf("%s", $$name); | |
667 | +} | |
668 | + | |
669 | +probe dhcpd_6_solicit_start = process("dhcpd").mark("6_solicit_start") | |
670 | +{ | |
671 | + probestr = sprintf("%s", $$name); | |
672 | +} | |
673 | + | |
674 | +probe dhcpd_6_solicit_done = process("dhcpd").mark("6_solicit_done") | |
675 | +{ | |
676 | + probestr = sprintf("%s", $$name); | |
677 | +} | |
678 | + | |
679 | +probe dhcpd_6_request_start = process("dhcpd").mark("6_request_start") | |
680 | +{ | |
681 | + probestr = sprintf("%s", $$name); | |
682 | +} | |
683 | + | |
684 | +probe dhcpd_6_request_done = process("dhcpd").mark("6_request_done") | |
685 | +{ | |
686 | + probestr = sprintf("%s", $$name); | |
687 | +} | |
688 | + | |
689 | +probe dhcpd_6_confirm_start = process("dhcpd").mark("6_confirm_start") | |
690 | +{ | |
691 | + probestr = sprintf("%s", $$name); | |
692 | +} | |
693 | + | |
694 | +probe dhcpd_6_confirm_done = process("dhcpd").mark("6_confirm_done") | |
695 | +{ | |
696 | + probestr = sprintf("%s", $$name); | |
697 | +} | |
698 | + | |
699 | +probe dhcpd_6_renew_start = process("dhcpd").mark("6_renew_start") | |
700 | +{ | |
701 | + probestr = sprintf("%s", $$name); | |
702 | +} | |
703 | + | |
704 | +probe dhcpd_6_renew_done = process("dhcpd").mark("6_renew_done") | |
705 | +{ | |
706 | + probestr = sprintf("%s", $$name); | |
707 | +} | |
708 | + | |
709 | +probe dhcpd_6_rebind_start = process("dhcpd").mark("6_rebind_start") | |
710 | +{ | |
711 | + probestr = sprintf("%s", $$name); | |
712 | +} | |
713 | + | |
714 | +probe dhcpd_6_rebind_done = process("dhcpd").mark("6_rebind_done") | |
715 | +{ | |
716 | + probestr = sprintf("%s", $$name); | |
717 | +} | |
718 | + | |
719 | +probe dhcpd_6_decline_start = process("dhcpd").mark("6_decline_start") | |
720 | +{ | |
721 | + probestr = sprintf("%s", $$name); | |
722 | +} | |
723 | + | |
724 | +probe dhcpd_6_decline_done = process("dhcpd").mark("6_decline_done") | |
725 | +{ | |
726 | + probestr = sprintf("%s", $$name); | |
727 | +} | |
728 | + | |
729 | +probe dhcpd_6_release_start = process("dhcpd").mark("6_release_start") | |
730 | +{ | |
731 | + probestr = sprintf("%s", $$name); | |
732 | +} | |
733 | + | |
734 | +probe dhcpd_6_release_done = process("dhcpd").mark("6_release_done") | |
735 | +{ | |
736 | + probestr = sprintf("%s", $$name); | |
737 | +} | |
738 | + | |
739 | +probe dhcpd_6_information_request_start = process("dhcpd").mark("6_information_request_start") | |
740 | +{ | |
741 | + probestr = sprintf("%s", $$name); | |
742 | +} | |
743 | + | |
744 | +probe dhcpd_6_information_request_done = process("dhcpd").mark("6_information_request_done") | |
745 | +{ | |
746 | + probestr = sprintf("%s", $$name); | |
747 | +} | |
748 | + | |
749 | +probe dhcpd_6_relay_forw_start = process("dhcpd").mark("6_relay_forw_start") | |
750 | +{ | |
751 | + probestr = sprintf("%s", $$name); | |
752 | +} | |
753 | + | |
754 | +probe dhcpd_6_relay_forw_done = process("dhcpd").mark("6_relay_forw_done") | |
755 | +{ | |
756 | + probestr = sprintf("%s", $$name); | |
757 | +} | |
758 | + | |
759 | +probe dhcpd_failover_pool_dobalance_start = process("dhcpd").mark("failover_pool_dobalance_start") | |
760 | +{ | |
761 | + probestr = sprintf("%s", $$name); | |
762 | +} | |
763 | + | |
764 | +probe dhcpd_failover_pool_dobalance_done = process("dhcpd").mark("failover_pool_dobalance_done") | |
765 | +{ | |
766 | + probestr = sprintf("%s", $$name); | |
767 | +} | |
768 | + | |
769 | + | |
770 | +probe dhcpd_failover_set_state_start = process("dhcpd").mark("failover_set_state_start") | |
771 | +{ | |
772 | + state = $arg1; | |
773 | + new_state = $arg2; | |
774 | + probestr = sprintf("%s(state=%d, new_state=%d)", $$name, state, new_state); | |
775 | +} | |
776 | + | |
777 | +probe dhcpd_failover_set_state_done = process("dhcpd").mark("failover_set_state_done") | |
778 | +{ | |
779 | + probestr = sprintf("%s", $$name); | |
780 | +} | |
781 | diff -up dhcp-4.2.2/tapset/Makefile.am.systemtap dhcp-4.2.2/tapset/Makefile.am | |
782 | --- dhcp-4.2.2/tapset/Makefile.am.systemtap 2011-09-21 15:13:35.586433886 +0200 | |
783 | +++ dhcp-4.2.2/tapset/Makefile.am 2011-09-21 15:13:35.586433886 +0200 | |
784 | @@ -0,0 +1,26 @@ | |
785 | +# Makefile.am for dhcp/tapset | |
786 | +# Jiri Popelka | |
787 | + | |
788 | +.PHONY: clean-local install-data-hook uninstall-local | |
789 | + | |
790 | +# | |
791 | +EXTRA_DIST = dhcpd.stp | |
792 | +TAPSET_FILES = $(EXTRA_DIST) | |
793 | +TAPSET_INSTALL_DIR = $(DESTDIR)@ABS_TAPSET_DIR@ | |
794 | + | |
795 | +if ENABLE_SYSTEMTAP | |
796 | +all-local: $(TAPSET_FILES) | |
797 | + | |
798 | +clean-local: | |
799 | + | |
800 | +install-data-hook: | |
801 | + $(MKDIR_P) $(TAPSET_INSTALL_DIR) | |
802 | + $(INSTALL_DATA) $(TAPSET_FILES) $(TAPSET_INSTALL_DIR) | |
803 | + | |
804 | +uninstall-local: | |
805 | + @list='$(TAPSET_FILES)'; for p in $$list; do \ | |
806 | + echo " rm -f '$(TAPSET_INSTALL_DIR)/$$p'"; \ | |
807 | + rm -f "$(TAPSET_INSTALL_DIR)/$$p"; \ | |
808 | + done | |
809 | +endif | |
810 | + |