Re: Function tracing not working
Mathieu Desnoyers via lttng-dev <[email protected]> Mon, 2 Jun 2025 13:22:55 -0400
| Newsgroups | org.lttng.lists.lttng-dev |
|---|---|
| Message-ID | <[email protected]> |
On 2025-06-02 10:37, David Aldrich via lttng-dev wrote: > Hi, > > I am trying to use lttng-ust-cyg-profile. > > Our application is large so, so far, I only compile main.cpp with > compiler option '-finstrument-functions' (I don't specify option > '-pg'). > > Our app must be run as root so I run it, and capture with lttng, like this: > > lttng create app_trace > lttng enable-event --userspace 'lttng_ust_tracef:*' > lttng enable-channel --kernel --session app_trace kernel_channel > lttng enable-event --kernel --all --channel kernel_channel --session app_trace > export LD_PRELOAD=liblttng-ust-cyg-profile.so > lttng start > sudo -E ./myapp > lttng stop > > I notice that many events get discarded: > > Warning: 198522 events were discarded, please refer to the > documentation on channel configuration. > > I then import into TraceCompass. I see the traces in the Resources > View, but when I expand Experiment > Views, all 3 'LTTng-UST > CallStack' entries are striked through so I can't select them. So I > can't visualise the function calls. > > Any idea what I am doing wrong please? AFAIK, the "LD_PRELOAD" environment variable is cleared by sudo when running its child process for security purposes. Thanks, Mathieu > > Best regards, David -- Mathieu Desnoyers EfficiOS Inc. https://www.efficios.com