[DTrace-devel] [PATCH 07/10] options: setting procfspath doesn't require a PCB

Kris Van Hees kris.van.hees at oracle.com
Tue Aug 22 16:51:32 UTC 2023


On Wed, Aug 02, 2023 at 02:26:57PM +0100, Nick Alcock via DTrace-devel wrote:
> /proc is used for all sorts of things these days, not all of which require
> the compiler to have been running at all.

This commit msg does not match the patch below.  (See more below...)

> Signed-off-by: Nick Alcock <nick.alcock at oracle.com>
> ---
>  libdtrace/dt_options.c | 3 ---
>  1 file changed, 3 deletions(-)
> 
> diff --git a/libdtrace/dt_options.c b/libdtrace/dt_options.c
> index 3631dfe2ee2d..ce7212a1dc12 100644
> --- a/libdtrace/dt_options.c
> +++ b/libdtrace/dt_options.c
> @@ -479,9 +479,6 @@ dt_opt_procfs_path(dtrace_hdl_t *dtp, const char *arg, uintptr_t option)
>  	if (arg == NULL)
>  		return dt_set_errno(dtp, EDT_BADOPTVAL);
>  
> -	if (dtp->dt_pcb != NULL)
> -		return dt_set_errno(dtp, EDT_BADOPTCTX);
> -

The commit msg mentions that setting the path to procfs does not require the
compiler to have been running, yet this conditional actually checks that the
compiler has *not* been running.  And the error code itself also indicates
that ("Option cannot be used from within a D program") which disallows setting
this option from a pragma.

And it makes sense that the path to procfs should not be allowed to be changed
once DTrace starts a compilation.

So, this patch seems wrong.

>  	if ((proc = strdup(arg)) == NULL)
>  		return dt_set_errno(dtp, EDT_NOMEM);
>  
> -- 
> 2.41.0.270.g68fa1d84b5
> 
> 



More information about the DTrace-devel mailing list