[DTrace-devel] [PATCH 6/7] Implement the lockstat provider

Eugene Loh eugene.loh at oracle.com
Sun May 14 06:01:53 UTC 2023


On 5/13/23 16:44, Kris Van Hees wrote:

> On Sat, May 13, 2023 at 02:20:36PM -0400, Eugene Loh via DTrace-devel wrote:
>> Again, a patch that is implementing a new provider needs tests, including
>> "dtrace -l", "dtrace -lv", probe firings, and probe arguments.
> This is not implementing a new provider - this is implementing a provider that
> DTrace is supposed to provide, and thus there are tests in the testsuite
> already for it.  Sure, we can add more tests, but there are tests already.
> They still need to have xfail removed, but that's easy enough.  The v2 of these
> patches will definitely cover that.

Yeah, sorry, I simply meant new to DTv2.  Removing xfails would be great.

>> On 5/9/23 18:32, Kris Van Hees via DTrace-devel wrote:
>>> diff --git a/libdtrace/dt_prov_lockstat.c b/libdtrace/dt_prov_lockstat.c
>>> +static void enable(dtrace_hdl_t *dtp, dt_probe_t *prp)
>>> +{
>>> +	int	i;
>>> +
>>> +	for (i = 0; i < ARRAY_SIZE(probes); i++) {
>>> +		probe_dep_t		*dep = &probes[i];
>>> +		dtrace_probedesc_t	pd;
>>> +
>>> +		if (strcmp(prp->desc->prb, dep->name) != 0)
>>> +			continue;
>>> +
>>> +		if (dtrace_str2desc(dtp, dep->spec, dep->str, &pd) == -1)
>>> +			return;
>>> +
>>> +		dt_probe_iter(dtp, &pd, add_dependency, NULL, prp);
>>> +
>>> +		free((void *)pd.prv);
>>> +		free((void *)pd.mod);
>>> +		free((void *)pd.fun);
>>> +		free((void *)pd.prb);
>>> +	}
>>> +
>>> +	/*
>>> +	 * Finally, ensure we're in the list of enablings as well.
>>> +	 * (This ensures that, among other things, the probes map
>>> +	 * gains entries for us.)
>> I'm having trouble understanding "the probes map gains entries for us."
> We mention this in other providers as well...  It means that the probes BPF
> map will contain data for the probe being added.


Okay.  Maybe it's just me.  The phrasing strikes me somehow as opaque.




More information about the DTrace-devel mailing list