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

Nick Alcock nick.alcock at oracle.com
Tue Jul 15 10:35:23 UTC 2025


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.

-- 
NULL && (void)



More information about the DTrace-devel mailing list