s4 dns_server Bind9: Log opertion durations
authorGary Lockyer <gary@catalyst.net.nz>
Thu, 4 Apr 2019 22:13:15 +0000 (11:13 +1300)
committerAndrew Bartlett <abartlet@samba.org>
Tue, 7 May 2019 05:03:26 +0000 (05:03 +0000)
commit3d42e257a617e4c20d814e87a6920bfb4bb69134
treee532d7feca1fdc63d7160a7f4778ca8143af514a
parent200995880893b379de2fe2f9269baab6678cd6f6
s4 dns_server Bind9: Log opertion durations

Add duration debug logging to the samba bind9 dlz driver and the
dnsserver_common routines.  This should aid future diagnosis of
performance issues, and could be used to monitor DNS performance.

The logs are currently Human readable text only, i.e. no JSON formatted
output.

Log lines are of the form:

<function>: DNS timing: result: [<result>] \
duration: (<duration>) zone: [<zone>] name: [<name>] \
data: [<data>]

e.g.

dns_common_wildcard_lookup: DNS timing: result: [WERR_OK] \
duration: (111) zone: [] \
name: [DC=_ldap._tcp.Default-First-Site-Name._sites.ForestDnsZones,\
DC=chgdcpassword.samba.example.com,CN=MicrosoftDNS,DC=DomainDnsZones,\
DC=chgdcpassword,DC=samba,DC=example,DC=com] data: []

Enabled by setting log level to "dns:10"

durations are in microseconds.

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Tue May  7 05:03:26 UTC 2019 on sn-devel-184
source4/dns_server/dlz_bind9.c
source4/dns_server/dnsserver_common.c
source4/dns_server/dnsserver_common.h