[lttng-dev] Userspace LTTng tracing in a non-privileged container

Sasha Goldshtein goldshtn at gmail.com
Tue Jan 30 09:50:06 UTC 2018


I'd like to use LTTng from within a non-privileged Docker container to
user-space tracing (enable-event --userspace --tracepoint etc.).
I would like to trace a .NET Core application, which uses LTTng events to
GC, JIT, assembly loading, and other events. My testing environment is a
host with an Ubuntu 14.04 container.

I can install LTTng within the target container, but the session daemon
the following message while loading:

modprobe: ERROR: ../libkmod/libkmod.c:556 kmod_search_moddep() could
not open moddep file '/lib/modules /4.12.9-200.fc25.x86_64/modules.dep.bin'
Error: Unable to load module lttng-tracer
DEBUG1 [1830/1830]: Failed to open /proc/lttng (in init_kernel_tracer() at
Error: Unable to remove module lttng-tracer
Warning: No kernel tracer available

Subsequent commands seem to work, but there are no traces produced.
What I ran was:

lttng create mysession --output /tmp
lttng enable-event --userspace --tracepoint DotNETRuntime:GC*
lttng start
lttng stop
lttng destroy

Is there a way to use the LTTng session daemon in non-privileged mode,
if I'm only interested in userspace tracing? I would like to avoid
LTTng on the host system, or running privileged. In fact, the ideal workflow
for me is to have a separate container image with LTTng and "attach" that
container image (using docker --pid --net) to the target container that I
to analyze. But I'd settle for having LTTng in the target container if
that's the
only option.

By the way, running LTTng from the host when the target application is in a
container doesn't work either (i.e. no traces are produced). Running LTTng
from the host when the target application is also on the host produces
results successfully.

Any suggestions would be very much appreciated.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.lttng.org/pipermail/lttng-dev/attachments/20180130/5492a73c/attachment.html>

More information about the lttng-dev mailing list