1
0
Fork 0

Merging upstream version 2.14.0.

Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
Daniel Baumann 2025-02-09 09:12:07 +01:00
parent 9824aa74b3
commit 2d0d862dd6
Signed by: daniel
GPG key ID: FBB4F0E80A80222F
45 changed files with 1468 additions and 192 deletions

27
CHANGES
View file

@ -1,3 +1,30 @@
2024-01-18 Jerry Lundström
Release 2.14.0
This release rewords connection statistics, adds names to threads and
fixes a bug with using TSIG in more than one thread.
In "Connection Statistics", reconnections has been renamed to
connection attempts and now includes both the initial connection
attempt and following reconnections.
If supported, threads will now be named after what they do, such as
"perf-send-<num>" and "perf-recv-<num>".
The TSIG context was shared between all threads and would case a crash
if more than one sending thread was used. This has been fixed and TSIG
contexts are now per thread.
81dc36b TSIG context per thread
55011c6 Thread names
8bdd480 thread names
17c680d Set thread names for dnsperf
54e641d Add library function to set thread names
fb19440 Dockerfile
a80de21 Reword connection statistics
688a4fd Reword connection statistics
2023-08-23 Jerry Lundström
Release 2.13.1

View file

@ -1,4 +1,4 @@
# Copyright 2019-2023 OARC, Inc.
# Copyright 2019-2024 OARC, Inc.
# Copyright 2017-2018 Akamai Technologies
# Copyright 2006-2016 Nominum, Inc.
# All rights reserved.

View file

@ -14,7 +14,7 @@
@SET_MAKE@
# Copyright 2019-2023 OARC, Inc.
# Copyright 2019-2024 OARC, Inc.
# Copyright 2017-2018 Akamai Technologies
# Copyright 2006-2016 Nominum, Inc.
# All rights reserved.

View file

@ -100,7 +100,7 @@ The contrib directory contains additional software related to `dnsperf` and
## License
```
Copyright 2019-2023 OARC, Inc.
Copyright 2019-2024 OARC, Inc.
Copyright 2017-2018 Akamai Technologies
Copyright 2006-2016 Nominum, Inc.
All rights reserved.

1345
configure vendored

File diff suppressed because it is too large Load diff

View file

@ -1,4 +1,4 @@
# Copyright 2019-2023 OARC, Inc.
# Copyright 2019-2024 OARC, Inc.
# Copyright 2017-2018 Akamai Technologies
# Copyright 2006-2016 Nominum, Inc.
# All rights reserved.
@ -16,12 +16,16 @@
# limitations under the License.
AC_PREREQ(2.64)
AC_INIT([dnsperf], [2.13.1], [admin@dns-oarc.net], [dnsperf], [https://github.com/DNS-OARC/dnsperf/issues])
AC_INIT([dnsperf], [2.14.0], [admin@dns-oarc.net], [dnsperf], [https://github.com/DNS-OARC/dnsperf/issues])
AM_INIT_AUTOMAKE([-Wall -Werror foreign subdir-objects])
AC_CONFIG_SRCDIR([src/dnsperf.c])
AC_CONFIG_HEADER([src/config.h])
AC_CONFIG_MACRO_DIR([m4])
# for pthread_setname_np
# needs to be called before any macros that run the C compiler
AC_GNU_SOURCE
# Checks for programs.
AC_PROG_CC
AM_PROG_CC_C_O
@ -55,6 +59,8 @@ AM_EXTRA_RECURSIVE_TARGETS([gcov])
# Checks for support.
AX_PTHREAD
AC_CHECK_FUNCS([pthread_setname_np pthread_set_name_np])
AC_CHECK_HEADERS([pthread_np.h], [], [], [#include <pthread.h>])
AC_CHECK_LIB([m], [sqrt])
AC_CHECK_HEADERS([stdatomic.h])
AM_CONDITIONAL([HAVE_STDATOMIC], [test "x$ac_cv_header_stdatomic_h" != "xno"])

View file

@ -1,6 +1,6 @@
#!/usr/bin/env python
#
# Copyright 2019-2023 OARC, Inc.
# Copyright 2019-2024 OARC, Inc.
# Copyright 2017-2018 Akamai Technologies
# Copyright 2006-2016 Nominum, Inc.
# All rights reserved.

View file

@ -1,4 +1,4 @@
.\" Copyright 2019-2023 OARC, Inc.
.\" Copyright 2019-2024 OARC, Inc.
.\" Copyright 2017-2018 Akamai Technologies
.\" Copyright 2006-2016 Nominum, Inc.
.\" All rights reserved.

View file

@ -1,4 +1,4 @@
# Copyright 2019-2023 OARC, Inc.
# Copyright 2019-2024 OARC, Inc.
# Copyright 2017-2018 Akamai Technologies
# Copyright 2006-2016 Nominum, Inc.
# All rights reserved.

View file

@ -1,4 +1,4 @@
# Copyright 2019-2023 OARC, Inc.
# Copyright 2019-2024 OARC, Inc.
# Copyright 2017-2018 Akamai Technologies
# Copyright 2006-2016 Nominum, Inc.
# All rights reserved.

View file

@ -14,7 +14,7 @@
@SET_MAKE@
# Copyright 2019-2023 OARC, Inc.
# Copyright 2019-2024 OARC, Inc.
# Copyright 2017-2018 Akamai Technologies
# Copyright 2006-2016 Nominum, Inc.
# All rights reserved.

View file

@ -1,5 +1,5 @@
/*
* Copyright 2019-2023 OARC, Inc.
* Copyright 2019-2024 OARC, Inc.
* Copyright 2017-2018 Akamai Technologies
* Copyright 2006-2016 Nominum, Inc.
* All rights reserved.

View file

@ -24,15 +24,27 @@
/* Define to 1 if you have the `nghttp2' library (-lnghttp2). */
#undef HAVE_LIBNGHTTP2
/* Define to 1 if you have the <minix/config.h> header file. */
#undef HAVE_MINIX_CONFIG_H
/* Define to 1 if you have the <nghttp2.h> header file. */
#undef HAVE_NGHTTP2_H
/* Define if you have POSIX threads libraries and header files. */
#undef HAVE_PTHREAD
/* Define to 1 if you have the <pthread_np.h> header file. */
#undef HAVE_PTHREAD_NP_H
/* Have PTHREAD_PRIO_INHERIT. */
#undef HAVE_PTHREAD_PRIO_INHERIT
/* Define to 1 if you have the `pthread_setname_np' function. */
#undef HAVE_PTHREAD_SETNAME_NP
/* Define to 1 if you have the `pthread_set_name_np' function. */
#undef HAVE_PTHREAD_SET_NAME_NP
/* Define to 1 if you have the <stdatomic.h> header file. */
#undef HAVE_STDATOMIC_H
@ -63,6 +75,9 @@
/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
/* Define to 1 if you have the <wchar.h> header file. */
#undef HAVE_WCHAR_H
/* Define to the sub-directory where libtool stores uninstalled libraries. */
#undef LT_OBJDIR
@ -96,6 +111,94 @@
backward compatibility; new code need not use it. */
#undef STDC_HEADERS
/* Enable extensions on AIX 3, Interix. */
#ifndef _ALL_SOURCE
# undef _ALL_SOURCE
#endif
/* Enable general extensions on macOS. */
#ifndef _DARWIN_C_SOURCE
# undef _DARWIN_C_SOURCE
#endif
/* Enable general extensions on Solaris. */
#ifndef __EXTENSIONS__
# undef __EXTENSIONS__
#endif
/* Enable GNU extensions on systems that have them. */
#ifndef _GNU_SOURCE
# undef _GNU_SOURCE
#endif
/* Enable X/Open compliant socket functions that do not require linking
with -lxnet on HP-UX 11.11. */
#ifndef _HPUX_ALT_XOPEN_SOCKET_API
# undef _HPUX_ALT_XOPEN_SOCKET_API
#endif
/* Identify the host operating system as Minix.
This macro does not affect the system headers' behavior.
A future release of Autoconf may stop defining this macro. */
#ifndef _MINIX
# undef _MINIX
#endif
/* Enable general extensions on NetBSD.
Enable NetBSD compatibility extensions on Minix. */
#ifndef _NETBSD_SOURCE
# undef _NETBSD_SOURCE
#endif
/* Enable OpenBSD compatibility extensions on NetBSD.
Oddly enough, this does nothing on OpenBSD. */
#ifndef _OPENBSD_SOURCE
# undef _OPENBSD_SOURCE
#endif
/* Define to 1 if needed for POSIX-compatible behavior. */
#ifndef _POSIX_SOURCE
# undef _POSIX_SOURCE
#endif
/* Define to 2 if needed for POSIX-compatible behavior. */
#ifndef _POSIX_1_SOURCE
# undef _POSIX_1_SOURCE
#endif
/* Enable POSIX-compatible threading on Solaris. */
#ifndef _POSIX_PTHREAD_SEMANTICS
# undef _POSIX_PTHREAD_SEMANTICS
#endif
/* Enable extensions specified by ISO/IEC TS 18661-5:2014. */
#ifndef __STDC_WANT_IEC_60559_ATTRIBS_EXT__
# undef __STDC_WANT_IEC_60559_ATTRIBS_EXT__
#endif
/* Enable extensions specified by ISO/IEC TS 18661-1:2014. */
#ifndef __STDC_WANT_IEC_60559_BFP_EXT__
# undef __STDC_WANT_IEC_60559_BFP_EXT__
#endif
/* Enable extensions specified by ISO/IEC TS 18661-2:2015. */
#ifndef __STDC_WANT_IEC_60559_DFP_EXT__
# undef __STDC_WANT_IEC_60559_DFP_EXT__
#endif
/* Enable extensions specified by ISO/IEC TS 18661-4:2015. */
#ifndef __STDC_WANT_IEC_60559_FUNCS_EXT__
# undef __STDC_WANT_IEC_60559_FUNCS_EXT__
#endif
/* Enable extensions specified by ISO/IEC TS 18661-3:2015. */
#ifndef __STDC_WANT_IEC_60559_TYPES_EXT__
# undef __STDC_WANT_IEC_60559_TYPES_EXT__
#endif
/* Enable extensions specified by ISO/IEC TR 24731-2:2010. */
#ifndef __STDC_WANT_LIB_EXT2__
# undef __STDC_WANT_LIB_EXT2__
#endif
/* Enable extensions specified by ISO/IEC 24747:2009. */
#ifndef __STDC_WANT_MATH_SPEC_FUNCS__
# undef __STDC_WANT_MATH_SPEC_FUNCS__
#endif
/* Enable extensions on HP NonStop. */
#ifndef _TANDEM_SOURCE
# undef _TANDEM_SOURCE
#endif
/* Enable X/Open extensions. Define to 500 only if necessary
to make mbstate_t available. */
#ifndef _XOPEN_SOURCE
# undef _XOPEN_SOURCE
#endif
/* Version number of package */
#undef VERSION

View file

@ -1,5 +1,5 @@
/*
* Copyright 2019-2023 OARC, Inc.
* Copyright 2019-2024 OARC, Inc.
* Copyright 2017-2018 Akamai Technologies
* Copyright 2006-2016 Nominum, Inc.
* All rights reserved.

View file

@ -1,5 +1,5 @@
/*
* Copyright 2019-2023 OARC, Inc.
* Copyright 2019-2024 OARC, Inc.
* Copyright 2017-2018 Akamai Technologies
* Copyright 2006-2016 Nominum, Inc.
* All rights reserved.

View file

@ -1,5 +1,5 @@
/*
* Copyright 2019-2023 OARC, Inc.
* Copyright 2019-2024 OARC, Inc.
* Copyright 2017-2018 Akamai Technologies
* Copyright 2006-2016 Nominum, Inc.
* All rights reserved.

View file

@ -1,5 +1,5 @@
/*
* Copyright 2019-2023 OARC, Inc.
* Copyright 2019-2024 OARC, Inc.
* Copyright 2017-2018 Akamai Technologies
* Copyright 2006-2016 Nominum, Inc.
* All rights reserved.

View file

@ -1,4 +1,4 @@
.\" Copyright 2019-2023 OARC, Inc.
.\" Copyright 2019-2024 OARC, Inc.
.\" Copyright 2017-2018 Akamai Technologies
.\" Copyright 2006-2016 Nominum, Inc.
.\" All rights reserved.

View file

@ -1,5 +1,5 @@
/*
* Copyright 2019-2023 OARC, Inc.
* Copyright 2019-2024 OARC, Inc.
* Copyright 2017-2018 Akamai Technologies
* Copyright 2006-2016 Nominum, Inc.
* All rights reserved.
@ -86,7 +86,7 @@ typedef struct {
uint32_t bufsize;
bool edns;
bool dnssec;
perf_tsigkey_t* tsigkey;
const char* tsigkey;
perf_ednsoption_t* edns_option;
uint32_t max_outstanding;
uint32_t max_qps;
@ -129,7 +129,7 @@ typedef struct {
uint64_t latency_min;
uint64_t latency_max;
uint64_t num_conn_reconnect;
uint64_t num_conn_attempts;
uint64_t num_conn_completed;
uint64_t conn_latency_sum;
@ -294,7 +294,7 @@ diff_stats(const config_t* config, stats_t* last, stats_t* now, stats_t* diff)
diff->latency_min = 0; /* not enough data */
diff->latency_max = 0;
diff->num_conn_reconnect = now->num_conn_reconnect - last->num_conn_reconnect;
diff->num_conn_attempts = now->num_conn_attempts - last->num_conn_attempts;
diff->num_conn_completed = now->num_conn_completed - last->num_conn_completed;
diff->conn_latency_sum = now->conn_latency_sum - last->conn_latency_sum;
@ -438,16 +438,16 @@ print_statistics(const config_t* config, const times_t* times, stats_t* stats, u
printf("\n");
if (!stats->num_conn_completed && !stats->num_conn_reconnect) {
if (!stats->num_conn_completed && !stats->num_conn_attempts) {
fflush(stdout);
return;
}
printf("Connection Statistics:\n\n");
printf(" Reconnections: %" PRIu64 " (%.2lf%% of %" PRIu64 " connections)\n\n",
stats->num_conn_reconnect,
PERF_SAFE_DIV(100.0 * stats->num_conn_reconnect, stats->num_conn_completed),
stats->num_conn_completed);
printf(" Connection attempts: %" PRIu64 " (%" PRIu64 " successful, %.2lf%%)\n\n",
stats->num_conn_attempts,
stats->num_conn_completed,
PERF_SAFE_DIV(100.0 * stats->num_conn_completed, stats->num_conn_attempts));
latency_avg = PERF_SAFE_DIV(stats->conn_latency_sum, stats->num_conn_completed);
printf(" Average Latency (s): %u.%06u",
(unsigned int)(latency_avg / MILLION),
@ -518,7 +518,7 @@ sum_stats(const config_t* config, stats_t* total)
total->latency_max = stats->latency_max;
total->num_conn_completed += stats->num_conn_completed;
total->num_conn_reconnect += stats->num_conn_reconnect;
total->num_conn_attempts += stats->num_conn_attempts;
total->conn_latency_sum += stats->conn_latency_sum;
total->conn_latency_sum_squares += stats->conn_latency_sum_squares;
@ -582,7 +582,6 @@ setup(int argc, char** argv, config_t* config)
in_port_t local_port = DEFAULT_LOCAL_PORT;
const char* filename = NULL;
const char* edns_option = NULL;
const char* tsigkey = NULL;
const char* mode = 0;
const char* doh_uri = DEFAULT_DOH_URI;
const char* doh_method = DEFAULT_DOH_METHOD;
@ -646,7 +645,7 @@ setup(int argc, char** argv, config_t* config)
&config->dnssec);
perf_opt_add('y', perf_opt_string, "[alg:]name:secret",
"the TSIG algorithm, name and secret (base64)", NULL,
&tsigkey);
&config->tsigkey);
perf_opt_add('q', perf_opt_uint, "num_queries",
"the maximum number of queries outstanding",
stringify(DEFAULT_MAX_OUTSTANDING),
@ -753,8 +752,11 @@ setup(int argc, char** argv, config_t* config)
if (config->dnssec || edns_option != NULL)
config->edns = true;
if (tsigkey != NULL)
config->tsigkey = perf_tsig_parsekey(tsigkey);
if (config->tsigkey) {
// check TSIG key to die earlier than in threads
perf_tsigkey_t* k = perf_tsig_parsekey(config->tsigkey);
perf_tsig_destroykey(&k);
}
if (edns_option != NULL)
config->edns_option = perf_edns_parseoption(edns_option);
@ -802,8 +804,6 @@ cleanup(config_t* config)
close(mainpipe[i]);
close(intrpipe[i]);
}
if (config->tsigkey != NULL)
perf_tsig_destroykey(&config->tsigkey);
if (config->edns_option != NULL)
perf_edns_destroyoption(&config->edns_option);
}
@ -909,6 +909,7 @@ do_send(void* arg)
perf_result_t result;
bool all_fail;
unsigned char socketbits[(MAX_SOCKETS / 8) + 1] = {};
perf_tsigkey_t* tsigkey = 0;
tinfo = (threadinfo_t*)arg;
config = tinfo->config;
@ -917,6 +918,9 @@ do_send(void* arg)
max_packet_size = config->edns ? MAX_EDNS_PACKET : MAX_UDP_PACKET;
perf_buffer_init(&msg, packet_buffer, max_packet_size);
perf_buffer_init(&lines, input_data, sizeof(input_data));
if (config->tsigkey) {
tsigkey = perf_tsig_parsekey(config->tsigkey);
}
if (tinfo->max_qps > 0) {
q_step = MILLION / tinfo->max_qps;
@ -1072,7 +1076,7 @@ do_send(void* arg)
perf_buffer_usedregion(&lines, &used);
result = perf_dns_buildrequest(&used, qid,
config->edns, config->dnssec, config->input_format == input_format_text_update,
config->tsigkey, config->edns_option,
tsigkey, config->edns_option,
&msg);
break;
@ -1156,6 +1160,10 @@ do_send(void* arg)
tinfo->done_sending = true;
if (write(mainpipe[1], "", 1)) { // lgtm [cpp/empty-block]
}
if (tsigkey) {
perf_tsig_destroykey(&tsigkey);
}
return NULL;
}
@ -1502,7 +1510,8 @@ static void perf__net_event(struct perf_net_socket* sock, perf_socket_event_t ev
break;
case perf_socket_event_reconnecting:
stats->num_conn_reconnect++;
case perf_socket_event_connecting:
stats->num_conn_attempts++;
break;
default:
@ -1512,7 +1521,7 @@ static void perf__net_event(struct perf_net_socket* sock, perf_socket_event_t ev
static void
threadinfo_init(threadinfo_t* tinfo, const config_t* config,
const times_t* times)
const times_t* times, int idx)
{
unsigned int offset, socket_offset, i;
@ -1581,8 +1590,13 @@ threadinfo_init(threadinfo_t* tinfo, const config_t* config,
}
tinfo->current_sock = 0;
char name[16]; // glibc is limited to 16 characters
PERF_THREAD(&tinfo->receiver, do_recv, tinfo);
snprintf(name, sizeof(name), "perf-recv-%04d", idx);
perf_os_thread_setname(tinfo->receiver, name);
PERF_THREAD(&tinfo->sender, do_send, tinfo);
snprintf(name, sizeof(name), "perf-send-%04d", idx);
perf_os_thread_setname(tinfo->sender, name);
}
static void
@ -1652,7 +1666,7 @@ int main(int argc, char** argv)
perf_log_fatal("out of memory");
}
for (i = 0; i < config.threads; i++)
threadinfo_init(&threads[i], &config, &times);
threadinfo_init(&threads[i], &config, &times, i);
if (config.stats_interval > 0) {
stats_thread.config = &config;
stats_thread.times = &times;

View file

@ -1,5 +1,5 @@
/*
* Copyright 2019-2023 OARC, Inc.
* Copyright 2019-2024 OARC, Inc.
* Copyright 2017-2018 Akamai Technologies
* Copyright 2006-2016 Nominum, Inc.
* All rights reserved.

View file

@ -1,5 +1,5 @@
/*
* Copyright 2019-2023 OARC, Inc.
* Copyright 2019-2024 OARC, Inc.
* Copyright 2017-2018 Akamai Technologies
* Copyright 2006-2016 Nominum, Inc.
* All rights reserved.

View file

@ -1,5 +1,5 @@
/*
* Copyright 2019-2023 OARC, Inc.
* Copyright 2019-2024 OARC, Inc.
* Copyright 2017-2018 Akamai Technologies
* Copyright 2006-2016 Nominum, Inc.
* All rights reserved.

View file

@ -1,5 +1,5 @@
/*
* Copyright 2019-2023 OARC, Inc.
* Copyright 2019-2024 OARC, Inc.
* Copyright 2017-2018 Akamai Technologies
* Copyright 2006-2016 Nominum, Inc.
* All rights reserved.

View file

@ -1,5 +1,5 @@
/*
* Copyright 2019-2023 OARC, Inc.
* Copyright 2019-2024 OARC, Inc.
* Copyright 2017-2018 Akamai Technologies
* Copyright 2006-2016 Nominum, Inc.
* All rights reserved.

View file

@ -1,5 +1,5 @@
/*
* Copyright 2019-2023 OARC, Inc.
* Copyright 2019-2024 OARC, Inc.
* Copyright 2017-2018 Akamai Technologies
* Copyright 2006-2016 Nominum, Inc.
* All rights reserved.

View file

@ -1,5 +1,5 @@
/*
* Copyright 2019-2023 OARC, Inc.
* Copyright 2019-2024 OARC, Inc.
* Copyright 2017-2018 Akamai Technologies
* Copyright 2006-2016 Nominum, Inc.
* All rights reserved.

View file

@ -1,5 +1,5 @@
/*
* Copyright 2019-2023 OARC, Inc.
* Copyright 2019-2024 OARC, Inc.
* Copyright 2017-2018 Akamai Technologies
* Copyright 2006-2016 Nominum, Inc.
* All rights reserved.

View file

@ -1,5 +1,5 @@
/*
* Copyright 2019-2023 OARC, Inc.
* Copyright 2019-2024 OARC, Inc.
* Copyright 2017-2018 Akamai Technologies
* Copyright 2006-2016 Nominum, Inc.
* All rights reserved.

View file

@ -1,5 +1,5 @@
/*
* Copyright 2019-2023 OARC, Inc.
* Copyright 2019-2024 OARC, Inc.
* Copyright 2017-2018 Akamai Technologies
* Copyright 2006-2016 Nominum, Inc.
* All rights reserved.

View file

@ -1,5 +1,5 @@
/*
* Copyright 2019-2023 OARC, Inc.
* Copyright 2019-2024 OARC, Inc.
* Copyright 2017-2018 Akamai Technologies
* Copyright 2006-2016 Nominum, Inc.
* All rights reserved.

View file

@ -1,5 +1,5 @@
/*
* Copyright 2019-2023 OARC, Inc.
* Copyright 2019-2024 OARC, Inc.
* Copyright 2017-2018 Akamai Technologies
* Copyright 2006-2016 Nominum, Inc.
* All rights reserved.

View file

@ -1,5 +1,5 @@
/*
* Copyright 2019-2023 OARC, Inc.
* Copyright 2019-2024 OARC, Inc.
* Copyright 2017-2018 Akamai Technologies
* Copyright 2006-2016 Nominum, Inc.
* All rights reserved.

View file

@ -1,5 +1,5 @@
/*
* Copyright 2019-2023 OARC, Inc.
* Copyright 2019-2024 OARC, Inc.
* Copyright 2017-2018 Akamai Technologies
* Copyright 2006-2016 Nominum, Inc.
* All rights reserved.
@ -32,6 +32,10 @@
#include <string.h>
#include <poll.h>
#if defined(HAVE_PTHREAD_NP_H)
#include <pthread_np.h>
#endif /* if defined(HAVE_PTHREAD_NP_H) */
void perf_os_blocksignal(int sig, bool block)
{
sigset_t sset;
@ -149,3 +153,23 @@ perf_os_waituntilanywritable(struct perf_net_socket** socks, unsigned int nfds,
return (PERF_R_SUCCESS);
}
}
void perf_os_thread_setname(pthread_t thread, const char* name)
{
#if defined(HAVE_PTHREAD_SETNAME_NP) && !defined(__APPLE__)
/*
* macOS has pthread_setname_np but only works on the
* current thread so it's not used here
*/
#if defined(__NetBSD__)
(void)pthread_setname_np(thread, name, NULL);
#else /* if defined(__NetBSD__) */
(void)pthread_setname_np(thread, name);
#endif /* if defined(__NetBSD__) */
#elif defined(HAVE_PTHREAD_SET_NAME_NP)
(void)pthread_set_name_np(thread, name);
#else /* if defined(HAVE_PTHREAD_SETNAME_NP) && !defined(__APPLE__) */
(void)(thread);
(void)(name);
#endif /* if defined(HAVE_PTHREAD_SETNAME_NP) && !defined(__APPLE__) */
}

View file

@ -1,5 +1,5 @@
/*
* Copyright 2019-2023 OARC, Inc.
* Copyright 2019-2024 OARC, Inc.
* Copyright 2017-2018 Akamai Technologies
* Copyright 2006-2016 Nominum, Inc.
* All rights reserved.
@ -25,6 +25,7 @@
#include <inttypes.h>
#include <stdbool.h>
#include <pthread.h>
void perf_os_blocksignal(int sig, bool block);
@ -41,4 +42,6 @@ perf_result_t
perf_os_waituntilanywritable(struct perf_net_socket** socks, unsigned int nfds, int pipe_fd,
int64_t timeout);
void perf_os_thread_setname(pthread_t thread, const char* name);
#endif

View file

@ -1,5 +1,5 @@
/*
* Copyright 2019-2023 OARC, Inc.
* Copyright 2019-2024 OARC, Inc.
* Copyright 2017-2018 Akamai Technologies
* Copyright 2006-2016 Nominum, Inc.
* All rights reserved.

View file

@ -1,5 +1,5 @@
/*
* Copyright 2019-2023 OARC, Inc.
* Copyright 2019-2024 OARC, Inc.
* Copyright 2017-2018 Akamai Technologies
* Copyright 2006-2016 Nominum, Inc.
* All rights reserved.

View file

@ -1,6 +1,6 @@
#!/bin/sh
#
# Copyright 2019-2023 OARC, Inc.
# Copyright 2019-2024 OARC, Inc.
# Copyright 2017-2018 Akamai Technologies
# Copyright 2006-2016 Nominum, Inc.
# All rights reserved.

View file

@ -1,4 +1,4 @@
.\" Copyright 2019-2023 OARC, Inc.
.\" Copyright 2019-2024 OARC, Inc.
.\" Copyright 2017-2018 Akamai Technologies
.\" Copyright 2006-2016 Nominum, Inc.
.\" All rights reserved.

View file

@ -1,5 +1,5 @@
/*
* Copyright 2019-2023 OARC, Inc.
* Copyright 2019-2024 OARC, Inc.
* Copyright 2017-2018 Akamai Technologies
* Copyright 2006-2016 Nominum, Inc.
* All rights reserved.
@ -149,7 +149,8 @@ static uint64_t num_queries_outstanding;
static uint64_t num_responses_received;
static uint64_t num_queries_timed_out;
static uint64_t rcodecounts[16];
static uint64_t num_reconnections;
static uint64_t num_conn_completed;
static uint64_t num_conn_attempts;
static uint64_t time_now;
static uint64_t time_of_program_start;
@ -489,10 +490,12 @@ static void perf__net_event(struct perf_net_socket* sock, perf_socket_event_t ev
case perf_socket_event_connected:
b->connections++;
b->conn_latency_sum += elapsed_time / (double)MILLION;
num_conn_completed++;
break;
case perf_socket_event_reconnecting:
num_reconnections++;
case perf_socket_event_connecting:
num_conn_attempts++;
break;
default:
@ -545,8 +548,7 @@ print_statistics(void)
perf_dns_rcode_strings[i], rcodecounts[i],
(rcodecounts[i] * 100.0) / num_responses_received);
}
printf("\n");
printf(" Reconnection(s): %" PRIu64 "\n", num_reconnections);
printf("\n\n");
printf(" Run time (s): %u.%06u\n",
(unsigned int)(run_time / MILLION),
(unsigned int)(run_time % MILLION));
@ -569,6 +571,10 @@ print_statistics(void)
printf(" Maximum throughput: %.6lf qps\n", max_throughput);
printf(" Lost at that point: %.2f%%\n", loss_at_max_throughput);
printf("\n");
printf(" Connection attempts: %" PRIu64 " (%" PRIu64 " successful, %.2lf%%)\n\n",
num_conn_attempts,
num_conn_completed,
PERF_SAFE_DIV(100.0 * num_conn_completed, num_conn_attempts));
}
/*

View file

@ -1,5 +1,5 @@
/*
* Copyright 2019-2023 OARC, Inc.
* Copyright 2019-2024 OARC, Inc.
* Copyright 2017-2018 Akamai Technologies
* Copyright 2006-2016 Nominum, Inc.
* All rights reserved.

View file

@ -1,5 +1,5 @@
/*
* Copyright 2019-2023 OARC, Inc.
* Copyright 2019-2024 OARC, Inc.
* Copyright 2017-2018 Akamai Technologies
* Copyright 2006-2016 Nominum, Inc.
* All rights reserved.

View file

@ -1,5 +1,5 @@
/*
* Copyright 2019-2023 OARC, Inc.
* Copyright 2019-2024 OARC, Inc.
* Copyright 2017-2018 Akamai Technologies
* Copyright 2006-2016 Nominum, Inc.
* All rights reserved.

View file

@ -1,5 +1,5 @@
/*
* Copyright 2019-2023 OARC, Inc.
* Copyright 2019-2024 OARC, Inc.
* Copyright 2017-2018 Akamai Technologies
* Copyright 2006-2016 Nominum, Inc.
* All rights reserved.

View file

@ -1,5 +1,5 @@
/*
* Copyright 2019-2023 OARC, Inc.
* Copyright 2019-2024 OARC, Inc.
* Copyright 2017-2018 Akamai Technologies
* Copyright 2006-2016 Nominum, Inc.
* All rights reserved.

View file

@ -1,5 +1,5 @@
/*
* Copyright 2019-2023 OARC, Inc.
* Copyright 2019-2024 OARC, Inc.
* Copyright 2017-2018 Akamai Technologies
* Copyright 2006-2016 Nominum, Inc.
* All rights reserved.