[DTrace-devel] [PATCH v4] trace: print alloca pointers as actual pointer values
Kris Van Hees
kris.van.hees at oracle.com
Wed Sep 17 15:29:34 UTC 2025
On Wed, Sep 17, 2025 at 04:03:33PM +0100, Nick Alcock wrote:
> On 16 Sep 2025, Kris Van Hees verbalised:
>
> > Because alloca pointers are stored internally as offsets into the
> > scratchmem area, they were printed as small integers. They are
> > now printed as actual pointer values into kernel space.
> >
> > Signed-off-by: Kris Van Hees <kris.van.hees at oracle.com>
>
> So... the change is to generate real pointers for children of alloca
> nodes too, and scalarize more aggressively? I don't really see what the
> second part has to do with this change (and more specifically why it
> didn't cause problems before now).
It doesn't cause problems - it is just not what should happen. Since an alloca
pointer is a pointer into kernel space one would expect (and legacy behaviour
shows this) that printing it would give us an address value in kernel space.
Without this patchm we print the *offset* into the scratch memory area, which
is certainly not a valid pointer in kernel space.
Because of how code generation is done, it unfortunately requires slightly more
complex logic to know which values to convert into actual pointer values in
order to store them in the trace output buffer. An extra complication is that,
if we are storing the pointer value into the trace event buffer, some versions
of the verifier will complain if it is a value that is marked as an address
into a BPF map. That is why it needs to be scalarized.
More information about the DTrace-devel
mailing list