[lttng-dev] Record stacktraces at userspace tracing domain

Alexander Krabler Alexander.Krabler at kuka.com
Thu Dec 12 11:52:11 EST 2024


Hi Mathieu,
 
On 2024-12-11 10:43, Mathieu Desnoyers via lttng-dev wrote:
> Another approach then is to add tracepoints within your C++ standard
> library functions. Then you can use the caller ip of _those_ functions
> and pass them to the tracepoint as "ip" context override.
That's difficult, as this would require to modify very much code locations and may also be difficult due to inlining.
Also it would just add one extra level, but I think that's not enough.

I'm rather thinking of something similar to this:
LTTNG_UST_TRACEPOINT_EVENT(
    ust,
    malloc_callstack,
    LTTNG_UST_TP_ARGS(
        unsigned int, callstack_length,
        int*, callstack
    ),
    LTTNG_UST_TP_FIELDS(
        lttng_ust_field_sequence_hex(int, callstack, callstack, unsigned int, callstack_length)
    )
)

And then use backtrace/libunwind to retrieve the required information and put it into the tracepoint.

Thanks,
Alexander


More information about the lttng-dev mailing list