|
unbound 0.1
|
This program estimates DNS name server performance. More...
#include "config.h"#include <signal.h>#include "util/log.h"#include "util/locks.h"#include "util/net_help.h"#include "util/data/msgencode.h"#include "util/data/msgreply.h"#include "util/data/msgparse.h"#include "sldns/sbuffer.h"#include "sldns/wire2str.h"#include "sldns/str2wire.h"#include <sys/time.h>Data Structures | |
| struct | perfinfo |
| Global info for perf. More... | |
| struct | perfio |
| I/O port for perf. More... | |
Macros | |
| #define | START_IO_INTERVAL 10 |
| number of msec between starting io ports | |
| #define | IO_TIMEOUT 10 |
| number of msec timeout on io ports | |
Functions | |
| static void | usage (char *nm) |
| usage information for perf | |
| static RETSIGTYPE | perf_sigh (int sig) |
| signal handler for user quit | |
| static int | perf_tv_smaller (struct timeval *t1, struct timeval *t2) |
| timeval compare, t1 < t2 | |
| static void | perf_tv_add (struct timeval *t1, struct timeval *t2) |
| timeval add, t1 += t2 | |
| static void | perf_tv_subtract (struct timeval *t1, struct timeval *t2) |
| timeval subtract, t1 -= t2 | |
| static void | perfsetup (struct perfinfo *info) |
| setup perf test environment | |
| static void | perffree (struct perfinfo *info) |
| cleanup perf test environment | |
| static void | perfsend (struct perfinfo *info, size_t n, struct timeval *now) |
| send new query for io | |
| static void | perfreply (struct perfinfo *info, size_t n, struct timeval *now) |
| got reply for io | |
| static void | perftimeout (struct perfinfo *info, size_t n, struct timeval *now) |
| got timeout for io | |
| static void | stat_printout (struct perfinfo *info, struct timeval *now, struct timeval *elapsed) |
| print nice stats about qps | |
| static void | perfselect (struct perfinfo *info) |
| wait for new events for performance test | |
| static void | perfendstats (struct perfinfo *info) |
| show end stats | |
| static void | perfmain (struct perfinfo *info) |
| perform the performance test | |
| static int | qlist_parse_line (sldns_buffer *buf, char *p) |
| parse a query line to a packet into buffer | |
| static void | qlist_grow_capacity (struct perfinfo *info) |
| grow query list capacity | |
| static void | qlist_add_line (struct perfinfo *info, char *line, int no) |
| setup query list in info | |
| static void | qlist_read_file (struct perfinfo *info, char *fname) |
| setup query list in info | |
| int | main (int argc, char *argv[]) |
| main program for perf | |
Variables | |
| static struct perfinfo * | sig_info |
| signal handler global info | |
| int | optind |
| getopt global, in case header files fail to declare it. | |
| char * | optarg |
| getopt global, in case header files fail to declare it. | |
This program estimates DNS name server performance.
| #define START_IO_INTERVAL 10 |
number of msec between starting io ports
Referenced by perfsetup().
| #define IO_TIMEOUT 10 |
number of msec timeout on io ports
Referenced by perfsend().
|
static |
usage information for perf
References usage().
|
static |
signal handler for user quit
References perfinfo::exit, log_assert, perf_sigh(), perfinfo::quiet, and sig_info.
Referenced by perf_sigh(), and perfsetup().
|
static |
timeval compare, t1 < t2
References perf_tv_smaller().
Referenced by perf_tv_smaller(), and perfselect().
|
static |
timeval add, t1 += t2
References perf_tv_add().
Referenced by perf_tv_add(), perfsend(), and perfsetup().
|
static |
timeval subtract, t1 -= t2
References perf_tv_subtract().
Referenced by perf_tv_subtract(), perfendstats(), and perfselect().
|
static |
setup perf test environment
References addr_is_ip6(), perfinfo::dest, perfinfo::destlen, fatal_exit(), perfio::fd, perfio::id, perfio::info, perfinfo::io, perfinfo::io_num, perfinfo::maxfd, perf_sigh(), perf_tv_add(), perfsetup(), perfinfo::rset, sig_info, perfinfo::since, sock_strerror(), perfinfo::start, START_IO_INTERVAL, and perfio::timeout.
Referenced by perfmain(), and perfsetup().
|
static |
cleanup perf test environment
References perfio::fd, perfio::info, perfinfo::io, perfinfo::io_num, perffree(), perfinfo::qlist_data, perfinfo::qlist_len, perfinfo::qlist_size, and sock_close().
Referenced by perffree(), and perfmain().
|
static |
send new query for io
References perfinfo::dest, perfinfo::destlen, perfio::fd, perfio::info, perfinfo::io, IO_TIMEOUT, log_err(), perfinfo::numsent, perf_tv_add(), perfsend(), perfinfo::qlist_data, perfinfo::qlist_idx, perfinfo::qlist_len, perfinfo::qlist_size, sock_strerror(), and perfio::timeout.
Referenced by perfreply(), perfsend(), and perftimeout().
|
static |
got reply for io
References perfinfo::buf, perfinfo::by_rcode, perfio::fd, perfio::info, perfinfo::io, log_err(), perfinfo::numrecv, perfreply(), perfsend(), sldns_buffer_begin(), sldns_buffer_capacity(), and sock_strerror().
Referenced by perfreply(), and perfselect().
|
static |
got timeout for io
References perfio::info, perfsend(), and perftimeout().
Referenced by perfselect(), and perftimeout().
|
static |
print nice stats about qps
References perfio::info, perfinfo::numrecv, perfinfo::numsent, perfinfo::quiet, perfinfo::since, stat_printout(), perfinfo::total_recv, and perfinfo::total_sent.
Referenced by perfendstats(), perfselect(), and stat_printout().
|
static |
wait for new events for performance test
References perfinfo::duration, perfinfo::exit, fatal_exit(), perfio::fd, perfio::info, perfinfo::io, perfinfo::io_num, log_err(), perfinfo::maxfd, perf_tv_smaller(), perf_tv_subtract(), perfreply(), perfselect(), perftimeout(), perfinfo::rset, perfinfo::since, perfinfo::start, stat_printout(), and perfio::timeout.
Referenced by perfmain(), and perfselect().
|
static |
show end stats
References perfinfo::by_rcode, fatal_exit(), perfinfo::io_num, perf_tv_subtract(), perfendstats(), perfinfo::quiet, perfinfo::since, sldns_wire2str_rcode_buf(), perfinfo::start, stat_printout(), perfinfo::total_recv, and perfinfo::total_sent.
Referenced by perfendstats(), and perfmain().
|
static |
perform the performance test
References perfinfo::exit, perfendstats(), perffree(), perfmain(), perfselect(), and perfsetup().
Referenced by main(), and perfmain().
|
static |
parse a query line to a packet into buffer
References attach_edns_record(), edns_data::bits, EDNS_ADVERTISED_SIZE, EDNS_DO, edns_data::edns_present, query_info::local_alias, query_info::qclass, qinfo_query_encode(), qlist_parse_line(), query_info::qname, query_info::qname_len, query_info::qtype, sldns_buffer_begin(), sldns_buffer_write_u16_at(), sldns_get_rr_class_by_name(), sldns_get_rr_type_by_name(), sldns_str2wire_dname(), and edns_data::udp_size.
Referenced by qlist_add_line(), and qlist_parse_line().
|
static |
grow query list capacity
References fatal_exit(), perfinfo::qlist_capacity, perfinfo::qlist_data, qlist_grow_capacity(), and perfinfo::qlist_len.
Referenced by qlist_add_line(), and qlist_grow_capacity().
|
static |
setup query list in info
References perfinfo::buf, fatal_exit(), memdup(), qlist_add_line(), perfinfo::qlist_capacity, perfinfo::qlist_data, qlist_grow_capacity(), perfinfo::qlist_len, qlist_parse_line(), perfinfo::qlist_size, sldns_buffer_begin(), sldns_buffer_limit(), and sldns_buffer_write_u16_at().
Referenced by main(), qlist_add_line(), and qlist_read_file().
|
static |
setup query list in info
References qlist_add_line(), qlist_read_file(), and perfinfo::qlist_size.
Referenced by main(), and qlist_read_file().
| int main | ( | int | argc, |
| char * | argv[] ) |
main program for perf
References perfinfo::buf, perfinfo::dest, perfinfo::destlen, perfinfo::duration, perfinfo::exit, extstrtoaddr(), fatal_exit(), perfinfo::io_num, log_ident_set(), log_init(), main, optarg, optind, perfmain(), qlist_add_line(), qlist_read_file(), perfinfo::qlist_size, perfinfo::quiet, sldns_buffer_free(), sldns_buffer_new(), and usage().
|
static |
signal handler global info
Referenced by perf_sigh(), and perfsetup().