Mirror of the lttng-dev mailing list
 help / color / mirror / Atom feed
From: Kienan Stewart via lttng-dev <lttng-dev@lists.lttng.org>
To: David Aldrich <david.aldrich.ntml@gmail.com>, lttng-dev@lists.lttng.org
Subject: Re: Not capturing ust events
Date: Thu, 8 May 2025 09:51:24 -0400	[thread overview]
Message-ID: <90aac2a4-0a4f-4d2a-a90f-c96c9be820af@efficios.com> (raw)
In-Reply-To: <CAJK_iejrz-U0-XK1hmoH9=TCLcErZTVE16XdyKzXX0buJuuoCQ@mail.gmail.com>

Hi David,

On 5/7/25 12:50 PM, David Aldrich via lttng-dev wrote:
> Hi
> 
> I am just getting started with LTTng. I am trying to use
> lttng_ust_tracef() initially.
> 
> I am running LTTng version 2.13 on Ubuntu 24.04 LTS, and viewing using
> TraceCompass 10.3.0 on Windows 11.
> 
> I use  lttng_ust_tracef() in just one source file:
> 
> #include <lttng/tracef.h>
> <snip>
> {
>      int my_integer = 0;
>      string my_string = "Normal";
>      lttng_ust_tracef("TaskManager: %d (%s)", my_integer, my_string.c_str());
> }
> 
> I build with CMake and link to the lttng-ust library:
> 
> target_link_libraries(${_lib_name} lttng-ust)
> 
> On the target I created a session and enabled the event:
> 

Was the lttng-sessiond already started (as the root user) when you can 
`lttng create my_proj`?

Is your user a member of the `tracing` group?

> $ lttng create my_proj
> $ lttng enable-event --userspace 'lttng_ust_tracef:*'
> 


> I have to run the application as root:
> 

Do you have a particular reason to use `lttng-record-trace`? It looks 
like `lttng-record-trace` will set up a new session rather than use the 
one you created earlier.

> sudo -E lttng-record-trace -a ./my_app

Should you application run as root normally?

Your commands could look like:

```
lttng create my_proj
lttng enable-event --userspace 'lttng_ust_tracef:*'
lttng start
./my_app
lttng stop
lttng view # [Optional]
```

> 
> When I import the trace directory into TraceCompass I tick both the
> kernel and ust event boxes, and create an experiment, but then only
> 'kernel' shows under the experiments and Traces in the tree view, no
> ust branch is shown.
> 
> I guess this isn't much to go on, but if anyone has any ideas why it's
> not capturing ust events, I would be grateful.
> 

You can also run the application with the environment variable 
`LTTNG_UST_DEBUG=1`, which will produce some output on stderr that you 
can use to diagnose issues.

The verbose log from lttng-sessiond may also help. (Run it with `-vvv 
--verbose-consumer`)

> Finally, which 'event_type' should I search for in the event viewer
> for lttng_ust_tracef events?
> 

The event type is `lttng_ust_tracef:event`.

> Best regards
> David

thanks,
kienan


  reply	other threads:[~2025-05-08 13:51 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-07 16:50 David Aldrich via lttng-dev
2025-05-08 13:51 ` Kienan Stewart via lttng-dev [this message]
2025-05-08 17:02   ` David Aldrich via lttng-dev
2025-05-08 17:25     ` Kienan Stewart via lttng-dev
2025-05-08 17:59       ` David Aldrich via lttng-dev

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=90aac2a4-0a4f-4d2a-a90f-c96c9be820af@efficios.com \
    --to=lttng-dev@lists.lttng.org \
    --cc=david.aldrich.ntml@gmail.com \
    --cc=kstewart@efficios.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox