]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Add tracing probes to the isc_job unit
authorOndřej Surý <ondrej@isc.org>
Mon, 30 Jan 2023 15:20:40 +0000 (16:20 +0100)
committerOndřej Surý <ondrej@isc.org>
Mon, 21 Aug 2023 16:39:53 +0000 (18:39 +0200)
Add tracing probes to isc_job unit:

 * libisc:job_cb_before - before the job callback is called
 * libisc:job_cb_after - after the job callback is called

lib/isc/job.c
lib/isc/probes.d
tests/isc/job_test.c

index 963248df15c8777c69e1c9b4531afbc45869daa9..78bbb03d0922f4e8ae18f88800bb67f17fbc1a77 100644 (file)
@@ -35,6 +35,7 @@
 
 #include "job_p.h"
 #include "loop_p.h"
+#include "probes.h"
 
 /*
  * Public: #include <isc/job.h>
@@ -70,8 +71,12 @@ isc__job_cb(uv_idle_t *handle) {
             job != NULL;
             job = next, next = job ? ISC_LIST_NEXT(job, link) : NULL)
        {
+               isc_job_cb cb = job->cb;
+               void *cbarg = job->cbarg;
                ISC_LIST_UNLINK(jobs, job, link);
-               job->cb(job->cbarg);
+               LIBISC_JOB_CB_BEFORE(job, cb, cbarg);
+               cb(cbarg);
+               LIBISC_JOB_CB_AFTER(job, cb, cbarg);
        }
 
        if (ISC_LIST_EMPTY(loop->run_jobs)) {
index f482f78976eef4b894d7bb001fffae7cc323d232..dccedcb113db2b2db39cc57522625fb4336b94dd 100644 (file)
  */
 
 provider libisc {
+       probe job_cb_after(void *, void *, void *);
+       probe job_cb_before(void *, void *, void *);
+
+       probe rwlock_destroy(void *);
+       probe rwlock_downgrade(void *);
        probe rwlock_init(void *);
-       probe rwlock_rdlock_req(void *);
        probe rwlock_rdlock_acq(void *);
-       probe rwlock_wrlock_req(void *);
-       probe rwlock_wrlock_acq(void *);
+       probe rwlock_rdlock_req(void *);
+       probe rwlock_rdunlock(void *);
        probe rwlock_tryrdlock(void *, int);
+       probe rwlock_tryupgrade(void *, int);
        probe rwlock_trywrlock(void *, int);
-       probe rwlock_rdunlock(void *);
+       probe rwlock_wrlock_acq(void *);
+       probe rwlock_wrlock_req(void *);
        probe rwlock_wrunlock(void *);
-       probe rwlock_downgrade(void *);
-       probe rwlock_tryupgrade(void *, int);
-       probe rwlock_destroy(void *);
 };
index 5e05dbdcbcae967b14ea086c72709a0b2cbce662..4a353a86ebe8d7b759c73348250c713ec5346364 100644 (file)
@@ -31,8 +31,6 @@
 #include <isc/result.h>
 #include <isc/util.h>
 
-#include "job.c"
-
 #include <tests/isc.h>
 
 static atomic_uint scheduled;