[DTrace-devel] [PATCH 4/6] Add macro to access stack slots past the register spill area
Kris Van Hees
kris.van.hees at oracle.com
Tue Mar 8 06:02:39 UTC 2022
On Tue, Mar 08, 2022 at 12:42:13AM -0500, Eugene Loh via DTrace-devel wrote:
> 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.
Indeed, and in fact I am modifying the patch to also remove the SCRATCH_*
macros (and their ref in the comment block) because there is no code that
uses them at this point.
> 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))
>
> _______________________________________________
> DTrace-devel mailing list
> DTrace-devel at oss.oracle.com
> https://oss.oracle.com/mailman/listinfo/dtrace-devel
More information about the DTrace-devel
mailing list