Mirror of the lttng-dev mailing list
 help / color / mirror / Atom feed
From: Mathieu Desnoyers via lttng-dev <lttng-dev@lists.lttng.org>
To: Brian Hutchinson <b.hutchman@gmail.com>
Cc: lttng-dev@lists.lttng.org, Olivier Dion <odion@efficios.com>
Subject: Re: [lttng-dev] Trying to understand use of lttng enable-event --kernel --userspace-probe=
Date: Wed, 17 May 2023 13:17:54 -0400	[thread overview]
Message-ID: <d1b67475-cddb-4759-5a96-e9f3b2e52553@efficios.com> (raw)
In-Reply-To: <CAFZh4h-Jf4eTNpPEh9=kBRXBN3JxBa_2BCBtRx0EfV_MaHZm1g@mail.gmail.com>

On 2023-05-17 12:37, Brian Hutchinson wrote:
> On Wed, May 17, 2023 at 12:08 PM Mathieu Desnoyers
> <mathieu.desnoyers@efficios.com> 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
>>
>> 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.
> 
> Hmm, was really hoping to be able to do dynamic tracing without having
> to modify code.

uprobes with the proper validations about instruction boundaries would 
eventually provide this. Another approach we want to invest time in is 
to integrate libpatch from Olivier Dion into lttng-ust. This would 
provide dynamic instrumentation with the performance of a purely 
userspace tracer.

But those are all things that were never prioritized by any of our 
customers, so they progress at a "back burner" pace.

> 
> I guess if I add a function call to a debug statement or something at
> the point I want to probe then I could use the elf example.

Yes.

> 
>>
>> So we only support inserting uprobe on functions and SDT probes at
>> the moment.
> 
> I've heard of system tap but never used it.  Will have to look into that.
> 
> I really want to get lttng-ust working but I'm getting pushback on the
> time I'm spending trying to get it to work ... and would really like
> to demonstrate something (was hoping kernel events and uprobes)
> quickly to an audience that knows nothing about lttng or full stack
> tracing to gain "buy in" for the effort.

Understood.

The main thing we are missing to help you on the UST front is a console 
log of the _application_ with LTTNG_UST_DEBUG=1. I suspect it is not 
collected in your tests.

Thanks,

Mathieu


> 
> You know, those pesky things called schedules.
> 
> Thanks,
> 
> Brian
> 
>>
>> Thanks,
>>
>> Mathieu
>>
>>
>>> Thanks,
>>>
>>> Brian
>>> _______________________________________________
>>> lttng-dev mailing list
>>> lttng-dev@lists.lttng.org
>>> https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
>>
>> --
>> Mathieu Desnoyers
>> EfficiOS Inc.
>> https://www.efficios.com
>>

-- 
Mathieu Desnoyers
EfficiOS Inc.
https://www.efficios.com

_______________________________________________
lttng-dev mailing list
lttng-dev@lists.lttng.org
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

  reply	other threads:[~2023-05-17 17:17 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-17  2:11 Brian Hutchinson via lttng-dev
2023-05-17 16:08 ` Mathieu Desnoyers via lttng-dev
2023-05-17 16:37   ` Brian Hutchinson via lttng-dev
2023-05-17 17:17     ` Mathieu Desnoyers via lttng-dev [this message]
2023-05-18 13:17   ` Brian Hutchinson via lttng-dev
2023-05-18 14:10     ` Brian Hutchinson via lttng-dev
2023-05-18 14:46       ` Mathieu Desnoyers via lttng-dev
2023-05-18 15:00         ` Brian Hutchinson via lttng-dev
2023-05-18 18:58           ` Brian Hutchinson via lttng-dev
2023-05-18 19:03             ` Mathieu Desnoyers via lttng-dev
2023-05-18 19:07               ` Brian Hutchinson via lttng-dev
2023-05-18 19:16                 ` Mathieu Desnoyers via lttng-dev
2023-05-18 19:28                   ` Brian Hutchinson via lttng-dev
2023-05-18 19:20                 ` Brian Hutchinson via lttng-dev
2023-05-18 19:24                   ` Mathieu Desnoyers via lttng-dev
2023-05-18 19:32                     ` Brian Hutchinson 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=d1b67475-cddb-4759-5a96-e9f3b2e52553@efficios.com \
    --to=lttng-dev@lists.lttng.org \
    --cc=b.hutchman@gmail.com \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=odion@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