[DTrace-devel] [PATCH 2/4] provider, cg: add reject_clasue() callback

Kris Van Hees kris.van.hees at oracle.com
Tue Jul 15 15:10:44 UTC 2025


On Tue, Jul 15, 2025 at 11:35:23AM +0100, Nick Alcock wrote:
> On 15 Jul 2025, Kris Van Hees spake thusly:
> 
> > Future providers will require functionality to determine whether a
> > clause for one of its probes needs to be rejected for some reason.
> > 
> > Since the callback is invoked during trampoline creation, rejection
> > must result in a compilation error.  The callback is responsible for
> > this.  If it returns, the clause is accepted.
> >
> > Signed-off-by: Kris Van Hees <kris.van.hees at oracle.com>
> 
> Reviewed-by: Nick Alcock <nick.alcock at oracle.com>
> 
> modulo the comment nit below.
> 
> > +	/*
> > +	 * Ensure the clause is valid for the probe.  Call the reject_clause()
> > +	 * hook if defined, otherwise apply default checks.  Rejection of the
> > +	 * clause must be reported as a compilation error.
> > +	 */
> > +	if (prp->prov->impl->reject_clause != NULL)
> > +		prp->prov->impl->reject_clause(prp, sdp->dtsd_clauseflags);
> 
> This change applies default checks *and* the reject_clause() checks, if
> any, not one or the other.

Well, actually, the comment needs updating because with this patch there is
no default yet.



More information about the DTrace-devel mailing list