[DTrace-devel] [PATCH 5/6] speculations, bpf: check for nonexistent CTF before using it

Eugene Loh eugene.loh at oracle.com
Fri Mar 4 21:06:15 UTC 2022


I do not understand why the commit subject refers to speculations.

Anyhow check out
https://oss.oracle.com/pipermail/dtrace-devel/2022-February/001807.html
If we want that patch then set_task_offsets() goes away entirely.

On 3/2/22 8:44 AM, Nick Alcock via DTrace-devel wrote:
> This turns coredumps into a not-all-that-much-more-helpful "no such file
> or directory" error (but turning DT_DEBUG on at least tells you which
> file is missing, i.e. some ctfa file)
>
> Signed-off-by: Nick Alcock <nick.alcock at oracle.com>
> ---
>   libdtrace/dt_bpf.c | 3 +++
>   1 file changed, 3 insertions(+)
>
> diff --git a/libdtrace/dt_bpf.c b/libdtrace/dt_bpf.c
> index 8b5513547d85..9b7344d02221 100644
> --- a/libdtrace/dt_bpf.c
> +++ b/libdtrace/dt_bpf.c
> @@ -141,6 +141,9 @@ set_task_offsets(dtrace_hdl_t *dtp)
>   	ctf_membinfo_t ctm;
>   	ctf_file_t *cfp = dtp->dt_shared_ctf;
>   
> +	if (!cfp)
> +		return dt_set_errno(dtp, EDT_NOCTF);
> +
>   	type = ctf_lookup_by_name(cfp, "struct task_struct");
>   	if (type == CTF_ERR)
>   		return -1;



More information about the DTrace-devel mailing list