[DTrace-devel] [PATCH 1/3] String constants should be marked as DT_NF_DPTR

Eugene Loh eugene.loh at oracle.com
Thu Oct 6 17:53:18 UTC 2022


Reviewed-by: Eugene Loh <eugene.loh at oracle.com>
though I'm not familiar with this stuff.

On 10/6/22 12:20, Kris Van Hees via DTrace-devel wrote:
> Although string constants are represented using a scalar offset into the
> string constant table, the generated BPF code uses actual pointers into
> the string constant table.  They are therefore pointers to DTrace-managed
> storage (DT_NF_DPTR).
>
> Signed-off-by: Kris Van Hees <kris.van.hees at oracle.com>
> ---
>   libdtrace/dt_parser.c | 1 +
>   1 file changed, 1 insertion(+)
>
> diff --git a/libdtrace/dt_parser.c b/libdtrace/dt_parser.c
> index a59ca0f9..6fc48c83 100644
> --- a/libdtrace/dt_parser.c
> +++ b/libdtrace/dt_parser.c
> @@ -1318,6 +1318,7 @@ dt_node_string(char *string)
>   	dnp = dt_node_alloc(DT_NODE_STRING);
>   	dnp->dn_op = DT_TOK_STRING;
>   	dnp->dn_string = string;
> +	dnp->dn_flags |= DT_NF_DPTR;
>   	dt_node_type_assign(dnp, DT_STR_CTFP(dtp), DT_STR_TYPE(dtp));
>   
>   	return dnp;



More information about the DTrace-devel mailing list