<html><body><div style="font-family: arial, helvetica, sans-serif; font-size: 12pt; color: #000000"><div><span id="zwchr" data-marker="__DIVIDER__">----- On May 11, 2020, at 5:09 PM, lttng-dev <lttng-dev@lists.lttng.org> wrote:<br></span></div><div data-marker="__QUOTED_TEXT__"><blockquote style="border-left:2px solid #1010FF;margin-left:5px;padding-left:5px;color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;"><div dir="ltr">Hi,<br><div>As part of a big software safety certification effort, we are looking into making sure that some functions of our API do not allocate memory and do not use any blocking syscalls.</div><br><div>This part is done and is working (using kmem_mm_page_{alloc,free} for memory allocations for now). However, if we do get memory allocations, we want to know where they're from. To do this, I've been looking at using the callstack-user context. However, I have a hard time getting more than 1 callstack-user address.</div><br><div>I'm on 5.3.0-46-generic, i.e. CONFIG_ARCH_STACKWALK-compatible, from what I could find. I tried creating a minimal version using -fno-omit-frame-pointer & without any optimization, but I still get only one address in the callstack_user context when I know there should be at least a few.</div><br><div>Note that this is running inside a Docker container, but lttng-modules is installed on the host, and a root session-daemon is running inside the Docker container. Also, I installed LTTng using the stable-2.11 Ubuntu PPA.</div><br><div>Is there something I might be doing wrong? Am I supposed to compile lttng-modules from source in order to use the callstack-* contexts? I couldn't find much documentation about this, other than the brief mention in the 2.11 docs.</div></div></blockquote><div><br></div><div>How does your test program issue the system call ? Is it directly with syscall() (see syscall(2) man page), or<br data-mce-bogus="1"></div><div>does it call into libc ? Is your entire libc compiled with -fno-omit-frame-pointer ?<br data-mce-bogus="1"></div><div><br data-mce-bogus="1"></div><div>As soon as one library in the chain to the system call is compiled without frame pointers, this is where the<br data-mce-bogus="1"></div><div>stack walk stops. This is usually libc.<br data-mce-bogus="1"></div><div><br data-mce-bogus="1"></div><div>Thanks,<br data-mce-bogus="1"></div><div><br data-mce-bogus="1"></div><div>Mathieu</div></div><div><br data-mce-bogus="1"></div><div data-marker="__SIG_POST__">-- <br></div><div>Mathieu Desnoyers<br>EfficiOS Inc.<br>http://www.efficios.com</div></div></body></html>