[master] improve thread support reporting

4083.	[cleanup]	Print of the number of CPUs and UDP listeners
			in the log and in "rndc status" output; indicate
			whether threads are supported in "named -V" output.
			[RT #38811]
This commit is contained in:
Evan Hunt 2015-03-04 15:56:33 -08:00
parent f2f3880223
commit da4a7772eb
4 changed files with 19 additions and 4 deletions

View file

@ -1,3 +1,8 @@
4083. [cleanup] Print of the number of CPUs and UDP listeners
in the log and in "rndc status" output; indicate
whether threads are supported in "named -V" output.
[RT #38811]
4082. [bug] Incrementally sign large inline zone deltas.
[RT #37927]

View file

@ -670,6 +670,11 @@ parse_command_line(int argc, char *argv[]) {
JSON_C_VERSION);
printf("linked to libjson-c version: %s\n",
json_c_version());
#endif
#ifdef ISC_PLATFORM_USETHREADS
printf("threads support is enabled\n");
#else
printf("threads support is disabled\n");
#endif
exit(0);
case 'x':
@ -742,9 +747,11 @@ create_managers(void) {
if (ns_g_udpdisp > ns_g_cpus)
ns_g_udpdisp = ns_g_cpus;
#endif
#ifdef ISC_PLATFORM_USETHREADS
isc_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_SERVER,
ISC_LOG_INFO, "using %u UDP listener%s per interface",
ns_g_udpdisp, ns_g_udpdisp == 1 ? "" : "s");
#endif
result = isc_taskmgr_create(ns_g_mctx, ns_g_cpus, 0, &ns_g_taskmgr);
if (result != ISC_R_SUCCESS) {

View file

@ -8459,8 +8459,11 @@ ns_server_status(ns_server_t *server, isc_buffer_t **text) {
snprintf(line, sizeof(line), "UDP listeners per interface: %u\n",
ns_g_udpdisp);
CHECK(putstr(text, line));
#else
snprintf(line, sizeof(line), "CPUs found: N/A (threads disabled)\n");
CHECK(putstr(text, line));
#endif
snprintf(line, sizeof(line), "number of zones: %u (%u automatic)\n",
zonecount, automatic);
CHECK(putstr(text, line));

View file

@ -137,7 +137,7 @@ state_key_init(void) {
return (result);
}
#else
geoip_state_t prev_state;
static geoip_state_t saved_state;
#endif
static void
@ -193,7 +193,7 @@ set_state(unsigned int family, isc_uint32_t ipnum, const geoipv6_t *ipnum6,
} else
clean_state(state);
#else
state = &prev_state;
state = &saved_state;
clean_state(state);
#endif
@ -231,7 +231,7 @@ get_state_for(unsigned int family, isc_uint32_t ipnum,
if (state == NULL)
return (NULL);
#else
state = &prev_state;
state = &saved_state;
#endif
if (state->family == family &&