From: Witold Kręcicki Date: Fri, 7 Feb 2020 11:54:22 +0000 (+0100) Subject: xxx processed counter X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7f4a8bf853001d6ca89c07da044c58c917c35d1b;p=thirdparty%2Fbind9.git xxx processed counter --- diff --git a/lib/isc/task.c b/lib/isc/task.c index 7517854e9fe..66f497869f2 100644 --- a/lib/isc/task.c +++ b/lib/isc/task.c @@ -153,6 +153,7 @@ struct isc__taskqueue { isc_thread_t thread; unsigned int threadid; isc__taskmgr_t *manager; + uint64_t eprocessed; }; struct isc__taskmgr { @@ -1124,6 +1125,7 @@ dispatch(isc__taskmgr_t *manager, unsigned int threadid) { * have a task to do. We must reacquire the queue * lock before exiting the 'if (task != NULL)' block. */ + manager->queues[threadid].eprocessed++; UNLOCK(&manager->queues[threadid].lock); RUNTIME_CHECK( atomic_fetch_sub_explicit(&manager->tasks_ready, @@ -1443,6 +1445,7 @@ isc_taskmgr_create(isc_mem_t *mctx, unsigned int workers, manager->queues[i].manager = manager; manager->queues[i].threadid = i; + manager->queues[i].eprocessed = 0; isc_thread_create(run, &manager->queues[i], &manager->queues[i].thread); char name[21]; @@ -1538,7 +1541,11 @@ isc_taskmgr_destroy(isc_taskmgr_t **managerp) { */ wake_all_queues(manager); UNLOCK(&manager->lock); - + FILE * f = fopen("/tmp/foobar","w"); + for (i=0; i< manager->workers; i++) { + fprintf(f, "%d: %lu\n", i, manager->queues[i].eprocessed); + } + fclose(f); /* * Wait for all the worker threads to exit. */