[DTrace-devel] [PATCH 4/6] Add macro to access stack slots past the register spill area

Eugene Loh eugene.loh at oracle.com
Tue Mar 8 05:42:13 UTC 2022


Reviewed-by: Eugene Loh <eugene.loh at oracle.com>
FWIW, it'd be nice if the ASCII-art figure that appears just above this 
change (describing the stack layout of a clause function) would show 
where the DT_STK_SP(n) appear... or a one-line comment for the below 
addition that explains that these slots come out of scratch memory.

On 3/7/22 2:50 PM, Kris Van Hees via DTrace-devel wrote:
> Signed-off-by: Kris Van Hees <kris.van.hees at oracle.com>
> ---
>   libdtrace/dt_dctx.h | 3 +++
>   1 file changed, 3 insertions(+)
>
> diff --git a/libdtrace/dt_dctx.h b/libdtrace/dt_dctx.h
> index 7d38dfd8..77eb9a92 100644
> --- a/libdtrace/dt_dctx.h
> +++ b/libdtrace/dt_dctx.h
> @@ -159,6 +159,9 @@ typedef struct dt_dctx {
>   #define DT_STK_SPILL_BASE	(DT_STK_DCTX - DT_STK_SLOT_SZ)
>   #define DT_STK_SPILL(n)		(DT_STK_SPILL_BASE - (n) * DT_STK_SLOT_SZ)
>   
> +#define DT_STK_SP_BASE		DT_STK_SPILL(DT_STK_NREGS)
> +#define DT_STK_SP(n)		(DT_STK_SP_BASE - (n) * DT_STK_SLOT_SZ)
> +
>   #define DT_STK_SCRATCH_BASE	(-MAX_BPF_STACK)
>   #define DT_STK_SCRATCH_SZ	(MAX_BPF_STACK + DT_STK_SPILL(DT_STK_NREGS - 1))
>   



More information about the DTrace-devel mailing list