<div dir="ltr">Hi,<div><br></div><div>The userspace callstack context is only available for the kernel domain.</div><div><br></div><div>There are potential workarounds and solutions; take a look at the discussion in this mailing list thread from last year (hit "Next message"): <a href="https://lists.lttng.org/pipermail/lttng-dev/2024-December/030881.html">https://lists.lttng.org/pipermail/lttng-dev/2024-December/030881.html</a></div><div><br></div><div>Regards,</div><div><br></div><div>Christophe</div></div><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">On Mon, Oct 6, 2025 at 5:37 AM Sunku, Sai via lttng-dev <<a href="mailto:lttng-dev@lists.lttng.org">lttng-dev@lists.lttng.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class="msg6488481305085553015">
<div lang="EN-US" style="overflow-wrap: break-word;">
<div class="m_6488481305085553015WordSection1">
<p class="MsoNormal">Hello,<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">I have a complex, multithreaded benchmark that emits LTTng trace points at various stages. I am trying to trace all malloc calls made by this benchmark. I'm specifically trying to get malloc trace points also through LTTng so that I can
identify when the malloc call was made relative to other trace points from the benchmark. I also want to see the stack trace for each malloc call so that I can identify where in the benchmark the malloc call is coming from.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">If I preload the lttng libc wrapper with `LD_PRELOAD=liblttng-ust-libc-wrapper.so`, I'm able to see the trace points from malloc calls.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">But when I try to add the callstack-user context with this command `lttng add-context --userspace --channel 1 --type callstack-user`, I get an error saying "Error: callstack-user: UST invalid context"<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">I've successfully added user space stack traces for kernel trace points with a similar command `lttng add-context --kernel --type callstack-user`<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Is the callstack-user context only available for kernel trace points? Is there another way to get the call stack for malloc calls?<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Thank you,<u></u><u></u></p>
<p class="MsoNormal">Sai Sunku<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
</div>
</div></blockquote></div>