From: Remi Gacogne Date: Thu, 14 Sep 2023 13:05:43 +0000 (+0200) Subject: rec: Properly record coverage data when exiting X-Git-Tag: rec-5.0.0-alpha2~20^2~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3810b63d83e7132cafe6fc88a7ba0015fb219903;p=thirdparty%2Fpdns.git rec: Properly record coverage data when exiting --- diff --git a/pdns/recursordist/Makefile.am b/pdns/recursordist/Makefile.am index f75a0962d3..8c482ab8fc 100644 --- a/pdns/recursordist/Makefile.am +++ b/pdns/recursordist/Makefile.am @@ -114,6 +114,7 @@ pdns_recursor_SOURCES = \ channel.cc channel.hh \ circular_buffer.hh \ comment.hh \ + coverage.cc coverage.hh \ credentials.cc credentials.hh \ dns.hh dns.cc \ dns_random.hh \ diff --git a/pdns/recursordist/coverage.cc b/pdns/recursordist/coverage.cc new file mode 120000 index 0000000000..5b8a2c82f4 --- /dev/null +++ b/pdns/recursordist/coverage.cc @@ -0,0 +1 @@ +../coverage.cc \ No newline at end of file diff --git a/pdns/recursordist/coverage.hh b/pdns/recursordist/coverage.hh new file mode 120000 index 0000000000..da12b36c72 --- /dev/null +++ b/pdns/recursordist/coverage.hh @@ -0,0 +1 @@ +../coverage.hh \ No newline at end of file diff --git a/pdns/recursordist/rec_channel_rec.cc b/pdns/recursordist/rec_channel_rec.cc index 2373e5f802..bbff8289a2 100644 --- a/pdns/recursordist/rec_channel_rec.cc +++ b/pdns/recursordist/rec_channel_rec.cc @@ -28,6 +28,7 @@ #include "rec-lua-conf.hh" #include "aggressive_nsec.hh" +#include "coverage.hh" #include "validate-recursor.hh" #include "filterpo.hh" @@ -1586,8 +1587,12 @@ void doExitGeneric(bool nicely) g_log << Logger::Error << "Exiting on user request" << endl; g_rcc.~RecursorControlChannel(); - if (!g_pidfname.empty()) + if (!g_pidfname.empty()) { unlink(g_pidfname.c_str()); // we can at least try.. + } + + pdns::coverage::dumpCoverageData(); + if (nicely) { RecursorControlChannel::stop = true; }