From 5bee815f7f9045db667bf9a1b0d5fddd94c704e4 Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Wed, 4 Sep 2019 11:16:53 +0000 Subject: Use stopwatches --- src/clients/s6-dnsip4.c | 1 + src/clients/s6-dnsip6.c | 1 + src/clients/s6-dnsmx.c | 1 + src/clients/s6-dnsname.c | 3 ++- src/clients/s6-dnsns.c | 1 + src/clients/s6-dnsq.c | 1 + src/clients/s6-dnsqr.c | 1 + src/clients/s6-dnssoa.c | 1 + src/clients/s6-dnssrv.c | 1 + src/clients/s6-dnstxt.c | 1 + src/clients/s6dns_generic_filter_main.c | 1 + 11 files changed, 12 insertions(+), 1 deletion(-) (limited to 'src/clients') diff --git a/src/clients/s6-dnsip4.c b/src/clients/s6-dnsip4.c index 5d5ef54..8458099 100644 --- a/src/clients/s6-dnsip4.c +++ b/src/clients/s6-dnsip4.c @@ -39,6 +39,7 @@ int main (int argc, char const *const *argv) argc -= subgetopt_here.ind ; argv += subgetopt_here.ind ; if (argc < 1) dieusage() ; + tain_now_set_stopwatch() ; tain_now_g() ; if (t) tain_from_millisecs(&deadline, t) ; else deadline = tain_infinite_relative ; tain_add_g(&deadline, &deadline) ; diff --git a/src/clients/s6-dnsip6.c b/src/clients/s6-dnsip6.c index 62c337b..7e59f80 100644 --- a/src/clients/s6-dnsip6.c +++ b/src/clients/s6-dnsip6.c @@ -39,6 +39,7 @@ int main (int argc, char const *const *argv) argc -= subgetopt_here.ind ; argv += subgetopt_here.ind ; if (argc < 1) dieusage() ; + tain_now_set_stopwatch() ; tain_now_g() ; if (t) tain_from_millisecs(&deadline, t) ; else deadline = tain_infinite_relative ; tain_add_g(&deadline, &deadline) ; diff --git a/src/clients/s6-dnsmx.c b/src/clients/s6-dnsmx.c index 41fe089..c28894e 100644 --- a/src/clients/s6-dnsmx.c +++ b/src/clients/s6-dnsmx.c @@ -38,6 +38,7 @@ int main (int argc, char const *const *argv) argc -= subgetopt_here.ind ; argv += subgetopt_here.ind ; if (argc < 1) dieusage() ; + tain_now_set_stopwatch() ; tain_now_g() ; if (t) tain_from_millisecs(&deadline, t) ; else deadline = tain_infinite_relative ; tain_add_g(&deadline, &deadline) ; diff --git a/src/clients/s6-dnsname.c b/src/clients/s6-dnsname.c index 87debde..ab1fd4b 100644 --- a/src/clients/s6-dnsname.c +++ b/src/clients/s6-dnsname.c @@ -52,7 +52,8 @@ int main (int argc, char const *const *argv) ip.is6 = 1 ; } else if (!ip4_scan(argv[0], ip.ip)) dieusage() ; - + + tain_now_set_stopwatch() ; tain_now_g() ; if (t) tain_from_millisecs(&deadline, t) ; else deadline = tain_infinite_relative ; tain_add_g(&deadline, &deadline) ; diff --git a/src/clients/s6-dnsns.c b/src/clients/s6-dnsns.c index b54ff24..a1a6b09 100644 --- a/src/clients/s6-dnsns.c +++ b/src/clients/s6-dnsns.c @@ -38,6 +38,7 @@ int main (int argc, char const *const *argv) argc -= subgetopt_here.ind ; argv += subgetopt_here.ind ; if (argc < 1) dieusage() ; + tain_now_set_stopwatch() ; tain_now_g() ; if (t) tain_from_millisecs(&deadline, t) ; else deadline = tain_infinite_relative ; tain_add_g(&deadline, &deadline) ; diff --git a/src/clients/s6-dnsq.c b/src/clients/s6-dnsq.c index 9f36716..3113025 100644 --- a/src/clients/s6-dnsq.c +++ b/src/clients/s6-dnsq.c @@ -75,6 +75,7 @@ int main (int argc, char const *const *argv) } if (debuglevel & 1) dbh.post_recv = &s6dns_debug_dumpdt_post_recv ; if (debuglevel & 2) { dbh.pre_send = &s6dns_debug_dumpdt_pre_send ; dbh.post_send = &s6dns_debug_dumpdt_post_send ; } + tain_now_set_stopwatch() ; tain_now_g() ; tain_add_g(&deadline, &deadline) ; if (!s6dns_engine_init_r_g(&s6dns_engine_here, &servers, 0, d.s, d.len, qtype, &dbh, &deadline)) diff --git a/src/clients/s6-dnsqr.c b/src/clients/s6-dnsqr.c index ed66ff9..186ae75 100644 --- a/src/clients/s6-dnsqr.c +++ b/src/clients/s6-dnsqr.c @@ -52,6 +52,7 @@ int main (int argc, char const *const *argv) dbh.external = where ; if (debuglevel & 1) dbh.post_recv = &s6dns_debug_dumpdt_post_recv ; if (debuglevel & 2) { dbh.pre_send = &s6dns_debug_dumpdt_pre_send ; dbh.post_send = &s6dns_debug_dumpdt_post_send ; } + tain_now_set_stopwatch() ; tain_now_g() ; tain_add_g(&deadline, &deadline) ; if (!s6dns_init()) strerr_diefu1sys(111, "s6dns_init") ; diff --git a/src/clients/s6-dnssoa.c b/src/clients/s6-dnssoa.c index 68fa4d4..9d42d8f 100644 --- a/src/clients/s6-dnssoa.c +++ b/src/clients/s6-dnssoa.c @@ -39,6 +39,7 @@ int main (int argc, char const *const *argv) argc -= subgetopt_here.ind ; argv += subgetopt_here.ind ; if (argc < 1) dieusage() ; + tain_now_set_stopwatch() ; tain_now_g() ; if (t) tain_from_millisecs(&deadline, t) ; else deadline = tain_infinite_relative ; tain_add_g(&deadline, &deadline) ; diff --git a/src/clients/s6-dnssrv.c b/src/clients/s6-dnssrv.c index ecc3db6..0845ffb 100644 --- a/src/clients/s6-dnssrv.c +++ b/src/clients/s6-dnssrv.c @@ -39,6 +39,7 @@ int main (int argc, char const *const *argv) argc -= subgetopt_here.ind ; argv += subgetopt_here.ind ; if (argc < 3) dieusage() ; + tain_now_set_stopwatch() ; tain_now_g() ; if (t) tain_from_millisecs(&deadline, t) ; else deadline = tain_infinite_relative ; tain_add_g(&deadline, &deadline) ; diff --git a/src/clients/s6-dnstxt.c b/src/clients/s6-dnstxt.c index df5aee1..622f9bb 100644 --- a/src/clients/s6-dnstxt.c +++ b/src/clients/s6-dnstxt.c @@ -43,6 +43,7 @@ int main (int argc, char const *const *argv) argc -= subgetopt_here.ind ; argv += subgetopt_here.ind ; if (argc < 1) dieusage() ; + tain_now_set_stopwatch() ; tain_now(&stamp) ; if (t) tain_from_millisecs(&deadline, t) ; else deadline = tain_infinite_relative ; tain_add(&deadline, &deadline, &stamp) ; diff --git a/src/clients/s6dns_generic_filter_main.c b/src/clients/s6dns_generic_filter_main.c index ba9534e..c7373b2 100644 --- a/src/clients/s6dns_generic_filter_main.c +++ b/src/clients/s6dns_generic_filter_main.c @@ -78,6 +78,7 @@ int s6dns_generic_filter_main (int argc, char const *const *argv, char const *co if (maxconn > SKADNS_MAXCONCURRENCY) maxconn = SKADNS_MAXCONCURRENCY ; if (maxlines < maxconn) maxlines = maxconn ; + tain_now_set_stopwatch() ; tain_now_g() ; tain_addsec_g(&deadline, 2) ; if (!skadns_startf_g(&a, &deadline)) -- cgit v1.2.3