bind9/lib/dns/probes-dns.d
Ondřej Surý 592f3cc671
Add DTRACE probes to dns_delegdb
Instrument the delegation cache (introduced to back both NS-based and
DELEG-based delegations) with 11 USDT probes in the libdns provider so
that hit rate, eviction pressure, and lookup latency can be measured
without recompiling or enabling logging.

The probes are:

- delegdb_lookup_start / delegdb_lookup_done wrap dns_delegdb_lookup()
  and pass the query name plus the result code.

- delegdb_insert_start / delegdb_insert_done wrap dns_delegset_insert().
  The early SHUTTINGDOWN return is funneled through the cleanup label
  so the done probe fires on every path.

- delegdb_cleanup_start / delegdb_cleanup_done bracket the SIEVE-based
  eviction triggered when the cache goes overmem, reporting the number
  of bytes requested and actually reclaimed.  An additional per-node
  delegdb_evict probe (guarded by _ENABLED() because it fires inside
  the loop) exposes which zones are being evicted.

- delegdb_create, delegdb_reuse, and delegdb_shutdown trace the per-view
  lifecycle across server reloads.

- delegdb_delete traces rndc flush-delegation paths, reporting whether
  a subtree or single name was removed.

Name arguments are stringified with dns_name_format() behind
LIBDNS_*_ENABLED() guards so that the hot lookup and insert paths remain
zero-cost when no consumer is attached.
2026-04-20 13:14:19 +02:00

41 lines
1.6 KiB
D

/*
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
*
* SPDX-License-Identifier: MPL-2.0
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, you can obtain one at https://mozilla.org/MPL/2.0/.
*
* See the COPYRIGHT file distributed with this work for additional
* information regarding copyright ownership.
*/
provider libdns {
probe delegdb_cleanup_done(void *, int);
probe delegdb_cleanup_start(void *, int);
probe delegdb_create(void *);
probe delegdb_delete(void *, char *, int, int);
probe delegdb_evict(void *, void *, char *);
probe delegdb_insert_done(void *, char *, int);
probe delegdb_insert_start(void *, char *);
probe delegdb_lookup_done(void *, char *, int);
probe delegdb_lookup_start(void *, char *);
probe delegdb_reuse(void *);
probe delegdb_shutdown(void *);
probe xfrin_axfr_finalize_begin(void *, char *);
probe xfrin_axfr_finalize_end(void *, char *, int);
probe xfrin_connected(void *, char *, int);
probe xfrin_done_callback_begin(void *, char *, int);
probe xfrin_done_callback_end(void *, char *, int);
probe xfrin_read(void *, char *, int);
probe xfrin_recv_answer(void *, char *, void *);
probe xfrin_recv_done(void *, char *, int);
probe xfrin_recv_parsed(void *, char *, int);
probe xfrin_recv_question(void *, char *, void *);
probe xfrin_recv_send_request(void *, char *);
probe xfrin_recv_start(void *, char *, int);
probe xfrin_recv_try_axfr(void *, char *, int);
probe xfrin_sent(void *, char *, int);
probe xfrin_start(void *, char *);
};