2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-31 06:25:31 +00:00

Get the tests working with liburcu

Mostly a few qp-trie details to adjust.
This commit is contained in:
Tony Finch
2023-03-08 14:52:30 +00:00
parent 9882a6ef90
commit c890b9b124
8 changed files with 16 additions and 10 deletions

View File

@@ -6,6 +6,7 @@ AM_CFLAGS += \
AM_CPPFLAGS += \
$(LIBISC_CFLAGS) \
$(LIBDNS_CFLAGS) \
$(LIBURCU_CFLAGS) \
$(LIBUV_CFLAGS) \
-DFUZZDIR=\"$(abs_srcdir)\" \
-I$(top_srcdir)/lib/dns \

View File

@@ -16,10 +16,10 @@
#include <stdbool.h>
#include <stdint.h>
#include <isc/qsbr.h>
#include <isc/random.h>
#include <isc/refcount.h>
#include <isc/rwlock.h>
#include <isc/urcu.h>
#include <isc/util.h>
#include <dns/qp.h>

View File

@@ -18,8 +18,8 @@
#include <isc/hashmap.h>
#include <isc/ht.h>
#include <isc/list.h>
#include <isc/qsbr.h>
#include <isc/rwlock.h>
#include <isc/urcu.h>
#include <isc/util.h>
#include <dns/fixedname.h>

View File

@@ -18,6 +18,7 @@
#include <unistd.h>
#include <isc/async.h>
#include <isc/barrier.h>
#include <isc/list.h>
#include <isc/log.h>
#include <isc/loop.h>
@@ -25,7 +26,6 @@
#include <isc/mem.h>
#include <isc/mutex.h>
#include <isc/os.h>
#include <isc/qsbr.h>
#include <isc/random.h>
#include <isc/refcount.h>
#include <isc/rwlock.h>
@@ -33,6 +33,7 @@
#include <isc/tid.h>
#include <isc/time.h>
#include <isc/timer.h>
#include <isc/urcu.h>
#include <isc/util.h>
#include <isc/uv.h>
@@ -883,6 +884,9 @@ int
main(void) {
isc_loopmgr_t *loopmgr = NULL;
isc_mem_t *mctx = NULL;
setlinebuf(stdout);
uint32_t nloops;
const char *env_workers = getenv("ISC_TASK_WORKERS");

View File

@@ -22,11 +22,11 @@
#define UNIT_TESTING
#include <cmocka.h>
#include <isc/qsbr.h>
#include <isc/random.h>
#include <isc/refcount.h>
#include <isc/result.h>
#include <isc/string.h>
#include <isc/urcu.h>
#include <isc/util.h>
#include <dns/name.h>

View File

@@ -27,10 +27,10 @@
#include <isc/loop.h>
#include <isc/magic.h>
#include <isc/mem.h>
#include <isc/qsbr.h>
#include <isc/random.h>
#include <isc/refcount.h>
#include <isc/rwlock.h>
#include <isc/urcu.h>
#include <isc/util.h>
#include <dns/log.h>
@@ -373,8 +373,7 @@ many_transactions(void *arg) {
for (size_t n = 0; n < TRANSACTION_COUNT; n++) {
TRACE("transaction %zu", n);
one_transaction(qpm);
isc__qsbr_quiescent_state(isc_loop_current(loopmgr));
isc_loopmgr_wakeup(loopmgr);
rcu_quiescent_state();
}
dns_qpmulti_destroy(&qpm);
@@ -387,6 +386,7 @@ ISC_RUN_TEST_IMPL(qpmulti) {
setup_items();
isc_loop_setup(isc_loop_main(loopmgr), many_transactions, NULL);
isc_loopmgr_run(loopmgr);
rcu_barrier();
isc_loopmgr_destroy(&loopmgr);
isc_log_destroy(&dns_lctx);
}

View File

@@ -4,6 +4,7 @@ AM_CPPFLAGS += \
$(LIBISC_CFLAGS) \
$(LIBDNS_CFLAGS) \
$(LIBNS_CFLAGS) \
$(LIBURCU_CFLAGS) \
$(LIBUV_CFLAGS) \
-I$(top_srcdir)/lib/isc \
-I$(top_srcdir)/lib/dns

View File

@@ -18,9 +18,9 @@
#include <isc/buffer.h>
#include <isc/loop.h>
#include <isc/magic.h>
#include <isc/qsbr.h>
#include <isc/refcount.h>
#include <isc/rwlock.h>
#include <isc/urcu.h>
#include <isc/util.h>
#include <dns/name.h>
@@ -255,10 +255,10 @@ qp_test_dumpchunks(dns_qp_t *qp) {
dumpqp(qp, "qp");
for (qp_chunk_t c = 0; c < qp->chunk_max; c++) {
printf("qp %p chunk %u base %p "
"used %u free %u immutable %u phase %u\n",
"used %u free %u immutable %u discounted %u\n",
qp, c, qp->base->ptr[c], qp->usage[c].used,
qp->usage[c].free, qp->usage[c].immutable,
qp->usage[c].phase);
qp->usage[c].discounted);
used += qp->usage[c].used;
free += qp->usage[c].free;
}