]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
rec: Properly record coverage data when exiting
authorRemi Gacogne <remi.gacogne@powerdns.com>
Thu, 14 Sep 2023 13:05:43 +0000 (15:05 +0200)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Mon, 9 Oct 2023 10:43:23 +0000 (12:43 +0200)
pdns/recursordist/Makefile.am
pdns/recursordist/coverage.cc [new symlink]
pdns/recursordist/coverage.hh [new symlink]
pdns/recursordist/rec_channel_rec.cc

index f75a0962d35bd102cbcfb385c13f0c2ff8a1113f..8c482ab8fca6a5ced67b97507f1d07ce5ecf4422 100644 (file)
@@ -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 (symlink)
index 0000000..5b8a2c8
--- /dev/null
@@ -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 (symlink)
index 0000000..da12b36
--- /dev/null
@@ -0,0 +1 @@
+../coverage.hh
\ No newline at end of file
index 2373e5f802692dfdfaad9d3389a2e8b3715fc6af..bbff8289a24dae822a1bdfb131abac0069eec709 100644 (file)
@@ -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;
   }