[DTrace-devel] restoring how DTrace adds probes
Eugene Loh
eugene.loh at oracle.com
Mon Jun 8 17:56:18 PDT 2020
I'll try drafting something from scratch that is shorter (no background
discussion) and takes your feedback into account. First, just a few
questions.
On 06/08/2020 02:21 PM, Kris Van Hees wrote:
> You are missing an important step... legacy DTrace would open the
> /dev/dtrace/dtrace pseudo-device file to obtain a file descriptor to issue
> ioctl requests on. That open request got handled by the dtrace kernel module,
> and one of the first things it does is:
> dtrace_probe_provide(NULL, NULL);
How would you feel about replacing the current dt_provimpl_t member
int (*populate)(dtrace_hdl_t *dtp);
with
int (*populate)(dtrace_hdl_t *dtp, const dtrace_probedesc_t *spec)
One could call it with spec==NULL to get "all" (pre-defined) probes or
with non-NULL spec to try to create a probe on demand.
And, what about renaming from "populate" to "provide" to connect more
directly to the legacy implementation?
>> *) We should clean up these two functions:
>> - dtrace_probe_iter()
>> - dt_probe_iter()
>> Once again, we should revert somewhat to the legacy implementation.
>> That is, dt_probe_iter() used to be a static function that was used
>> simply as a callback within dtrace_probe_iter(). In the current
>> version, dt_probe_iter() is no longer a static function. On the other
>> hand, it is still used only by dtrace_probe_iter(). And
>> dtrace_probe_iter() has become simply a wrapper for dt_probe_iter().
>> Therefore:
>> - move probe iteration from dt_probe_iter() into dtrace_probe_iter()
>> - if dt_probe_iter() is still needed, make it static once again
> That code is still in need of further refining as we move towards supporting
> wildcard probe descriptions in full. So, we will need to evaluate the
> interacton between dtrace_probe_iter and dt_probe_iter(). Note that the
> dtrace_probe_iter() is the function that is exported as part of the libdtrace
> API whereas dt_probe_iter() provides the implementation that is planned to be
> called from other parts of libdtrace itself,
Okay, I suppose, but just to be clear: is this new? In both legacy and
v2, dt_probe_iter() is used only by dtrace_probe_iter(), while
dtrace_probe_iter() is called both from outside (cmd/dtrace.c) and
inside (dt_probe_info) libdtrace.
More information about the DTrace-devel
mailing list