diff --git a/CHANGES b/CHANGES
index 5fdda08453..9562912080 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,6 @@
+3484. [bug] Some statistics were incorrectly rendered in XML.
+ [RT #32587]
+
3483. [placeholder]
3482. [func] dig +nssearch now prints name servers that don't
diff --git a/bin/named/bind9.xsl b/bin/named/bind9.xsl
index 3f9ed75aa4..2d8772abe8 100644
--- a/bin/named/bind9.xsl
+++ b/bin/named/bind9.xsl
@@ -366,7 +366,7 @@
Resolver Statistics (Common)
+
+
+
+ ADB Statistics for View
+
+
+
+
+
+ even
+ odd
+
+
+
+
+
+ |
+
+
+ |
+
+
+
+
+
+
+ Cache Statistics for View
+
+
+
+
+
+ even
+ odd
+
+
+
+
+
+ |
+
+
+ |
+
+
+
+
+
+
Cache DB RRsets for View
@@ -614,6 +663,12 @@
+
+ Tasks Ready |
+
+
+ |
+
Tasks
@@ -624,6 +679,7 @@
References |
State |
Quantum |
+ Events |
@@ -649,6 +705,9 @@
|
+
+
+ |
diff --git a/bin/named/bind9.xsl.h b/bin/named/bind9.xsl.h
index 15710d740f..91cb49165f 100644
--- a/bin/named/bind9.xsl.h
+++ b/bin/named/bind9.xsl.h
@@ -371,7 +371,7 @@ static char xslmsg[] =
" \n"
" Resolver Statistics (Common)
\n"
" \n"
- " \n"
+ " \n"
" \n"
" \n"
" \n"
@@ -411,6 +411,55 @@ static char xslmsg[] =
" \n"
"
\n"
" \n"
+ "\n"
+ "\n"
+ " \n"
+ " ADB Statistics for View
\n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " even\n"
+ " odd\n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " | \n"
+ " \n"
+ " \n"
+ " | \n"
+ "
\n"
+ " \n"
+ "
\n"
+ " \n"
+ "\n"
+ " \n"
+ " Cache Statistics for View
\n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " even\n"
+ " odd\n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " | \n"
+ " \n"
+ " \n"
+ " | \n"
+ "
\n"
+ " \n"
+ "
\n"
+ " \n"
+ "\n"
+ "\n"
" Cache DB RRsets for View
\n"
" \n"
" \n"
@@ -619,6 +668,12 @@ static char xslmsg[] =
" \n"
" \n"
" \n"
+ " \n"
+ " Tasks Ready | \n"
+ " \n"
+ " \n"
+ " | \n"
+ "
\n"
"
\n"
"
\n"
" Tasks
\n"
@@ -629,6 +684,7 @@ static char xslmsg[] =
" References | \n"
" State | \n"
" Quantum | \n"
+ " Events | \n"
" \n"
" \n"
" \n"
@@ -654,6 +710,9 @@ static char xslmsg[] =
" \n"
" \n"
" | \n"
+ " \n"
+ " \n"
+ " | \n"
" \n"
" \n"
" \n"
diff --git a/bin/named/statschannel.c b/bin/named/statschannel.c
index fc42adf37f..abec3b68ad 100644
--- a/bin/named/statschannel.c
+++ b/bin/named/statschannel.c
@@ -971,21 +971,28 @@ generatexml(ns_server_t *server, int *buflen, xmlChar **buf) {
TRY0(xmlTextWriterEndElement(writer)); /* cache */
}
- TRY0(xmlTextWriterStartElement(writer, ISC_XMLCHAR
- "cachestats"));
- TRY0(dns_cache_renderxml(view->cache, writer));
- TRY0(xmlTextWriterEndElement(writer)); /* cachestats */
-
- if (view->adbstats != NULL) {
+ /* */
+ TRY0(xmlTextWriterStartElement(writer, ISC_XMLCHAR "counters"));
+ TRY0(xmlTextWriterWriteAttribute(writer, ISC_XMLCHAR "type",
+ ISC_XMLCHAR "adbstat"));
+ if (view->resstats != NULL) {
result = dump_counters(view->adbstats,
isc_statsformat_xml, writer,
- "adbstat", adbstats_xmldesc,
+ NULL, adbstats_xmldesc,
dns_adbstats_max,
adbstats_index, adbstat_values,
ISC_STATSDUMP_VERBOSE);
if (result != ISC_R_SUCCESS)
goto error;
}
+ TRY0(xmlTextWriterEndElement(writer)); /* */
+
+ /* */
+ TRY0(xmlTextWriterStartElement(writer, ISC_XMLCHAR "counters"));
+ TRY0(xmlTextWriterWriteAttribute(writer, ISC_XMLCHAR "type",
+ ISC_XMLCHAR "cachestats"));
+ TRY0(dns_cache_renderxml(view->cache, writer));
+ TRY0(xmlTextWriterEndElement(writer)); /* */
TRY0(xmlTextWriterEndElement(writer)); /* view */
@@ -1074,7 +1081,6 @@ generatexml(ns_server_t *server, int *buflen, xmlChar **buf) {
resstat_values, 0);
if (result != ISC_R_SUCCESS)
goto error;
-
TRY0(xmlTextWriterEndElement(writer)); /* counters type=resstat */
TRY0(xmlTextWriterStartElement(writer, ISC_XMLCHAR "counters"));
diff --git a/lib/dns/cache.c b/lib/dns/cache.c
index 3b23aba15b..cd0c875eae 100644
--- a/lib/dns/cache.c
+++ b/lib/dns/cache.c
@@ -1400,15 +1400,14 @@ static int
renderstat(const char *name, isc_uint64_t value, xmlTextWriterPtr writer) {
int xmlrc;
- TRY0(xmlTextWriterStartElement(writer, ISC_XMLCHAR "cachestat"));
- TRY0(xmlTextWriterStartElement(writer, ISC_XMLCHAR "name"));
- TRY0(xmlTextWriterWriteString(writer, ISC_XMLCHAR name));
- TRY0(xmlTextWriterEndElement(writer)); /* name */
- TRY0(xmlTextWriterStartElement(writer, ISC_XMLCHAR "value"));
+ TRY0(xmlTextWriterStartElement(writer, ISC_XMLCHAR "counter"));
+ TRY0(xmlTextWriterWriteAttribute(writer,
+ ISC_XMLCHAR "name", ISC_XMLCHAR name));
TRY0(xmlTextWriterWriteFormatString(writer,
- "%" ISC_PRINT_QUADFORMAT "u", value));
- TRY0(xmlTextWriterEndElement(writer)); /* value */
- TRY0(xmlTextWriterEndElement(writer)); /* cachestat */
+ "%" ISC_PRINT_QUADFORMAT "u",
+ value));
+ TRY0(xmlTextWriterEndElement(writer)); /* counter */
+
error:
return (xmlrc);
}