[DTrace-devel] [PATCH 15/16] Use eventfd rather than a condition variable to signal process death

Eugene Loh eugene.loh at oracle.com
Fri Mar 26 18:45:14 PDT 2021


Reviewed-by: Eugene Loh <eugene.loh at oracle.com>
Plus a few comments below.

On 3/19/21 12:55 AM, Kris Van Hees wrote:

> The proc handling code uses a conditional variable(dph_cv)  that is

conditional->condition

And did that double space mean to have a dash or something?


> broadcast using pthread.  THe original code would periodically check

THe -> The

> the cv in dtrace_sleep(), called from the main consumer loop.
>
> Now that the buffer handling implementation uses epoll(), dtrace_sleep()
> has become obsolete.  An eventfd is now used to communicate that there
> are process notifications waiting to be processed.

Good to know about dtrace_sleep() obsolete, but there still seem to be 
vestigial references to dtrace_sleep in dt_proc.c, dtrace.h, and 
libdtrace.ver.

Actually, dph_cv is still in the source code too!  Check 
libdtrace/dt_proc.h.

Also (though I think you already know), 
test/unittest/proc/tst.self-grab.sh should be added to the set of tests 
that now pass (and therefore need xfail removed and Copyright year updated).

> diff --git a/libdtrace/dt_open.c b/libdtrace/dt_open.c
> +	dtp->dt_proc_fd = eventfd(0, EFD_CLOEXEC | EFD_NONBLOCK);

I'm not familiar with eventfd.  Do we need to check the return value for 
!= -1 (not that this section of code checks much for errors at all!)?



More information about the DTrace-devel mailing list