Re: [lttng-dev] Trying to understand use of lttng enable-event --kernel --userspace-probe=

Brian Hutchinson via lttng-dev <[email protected]>
Newsgroups org.lttng.lists.lttng-dev
Message-ID <CAFZh4h95d=U6wj6RxR-z3kDMwJD58cC+DLC5O6UNSsKcschr3w@mail.gmail.com>
On Wed, May 17, 2023 at 12:08 PM Mathieu Desnoyers
<[email protected]> wrote:
>
> On 2023-05-16 22:11, Brian Hutchinson via lttng-dev wrote:
> > Hi,
> >
> > I'm trying to figure out how to use uprobes with lttng.
> >
> > I can't use a normal uprobe for a line number just using the address I
> > want to probe obtained from objdump?  As in:
> >
> > echo 'p /usr/local/bin/my_app:0x2c3a8' >>
> > /sys/kernel/debug/tracing/uprobe_events
> >
> > ... which isn't a function entry, it's just a line of code I want to probe on.
> >
> > This link says it has to be elf or sdt:
> > https://lttng.org/man/1/lttng-enable-event/v2.11/#doc-opt--userspace-probe
> >
> > So can I not probe on just a line of code by specifying an address???
> >
> > It doesn't look like these methods above will do what I'm wanting to
> > do.  I've tried to find examples of using enable-event --kernel
> > --userspace-probe= but there doesn't appear to be many.
> >
>
> There are examples here:
>
> https://lttng.org/docs/v2.13/#doc-enabling-disabling-events

I added a function that's called when the event I want to probe occurs.

I tried to enable the event with:
root@localhost:/usr/local/bin# lttng enable-event --kernel
--userspace-probe=/usr/local/bin/my_app:my_probe_event
Error: Missing event name(s).

... and:

root@localhost:/usr/local/bin# lttng enable-event --kernel
--userspace-probe=elf:/usr/local/bin/my_app:my_probe_event
Error: Missing event name(s).

I can do ${CROSS_COMPILE}objdump -d and verify that the symbol above
for the function I added is indeed there.

What am I doing wrong?

>
> Indeed inserting a lttng-modules uprobe within functions is not
> supported at the moment, mainly because we prefer to err towards safety
> and don't have the validation in place to prevent corrupting the
> program's instructions if an end user would try to insert a uprobe at an
> address which is not an instruction boundary.
>
> So we only support inserting uprobe on functions and SDT probes at
> the moment.
>
> Thanks,
>
> Mathieu
>
>
> > Thanks,
> >
> > Brian
> > _______________________________________________
> > lttng-dev mailing list
> > [email protected]
> > https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
>
> --
> Mathieu Desnoyers
> EfficiOS Inc.
> https://www.efficios.com
>
_______________________________________________
lttng-dev mailing list
[email protected]
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.