[DTrace-devel] [PATCH] cc, bpf: fix CTF error reporting

Kris Van Hees kvanhees at kvh-deb-bpf.us.oracle.com
Tue Jan 30 15:24:24 UTC 2024


On Mon, Jan 29, 2024 at 07:02:32PM +0000, Nick Alcock wrote:
> When there are CTF errors, dt_link_construct reports
> 
> Error: Success
> 
> To report a CTF error, you have to set the dt_errno to EDT_CTF (see
> dtrace_errmsg()).
> 
> Signed-off-by: Nick Alcock <nick.alcock at oracle.com>
> ---
>  libdtrace/dt_cc.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/libdtrace/dt_cc.c b/libdtrace/dt_cc.c
> index 3b0a4f9db9ef..a2f2839cdc0a 100644
> --- a/libdtrace/dt_cc.c
> +++ b/libdtrace/dt_cc.c
> @@ -1242,6 +1242,7 @@ dt_link_construct(dtrace_hdl_t *dtp, const dt_probe_t *prp, dtrace_difo_t *dp,
>  
>   err_ctf:
>  	dtp->dt_ctferr = ctf_errno(dtp->dt_shared_ctf);
> +	dt_set_errno(dtp, EDT_CTF);
>  	return -1;

Surely this ought to be:

	return dt_set_errno(dtp, EDT_CTF);

>  }
>  
> -- 
> 2.43.0.272.gce700b77fd
> 
> 



More information about the DTrace-devel mailing list