From: Alexander Krabler via lttng-dev <lttng-dev@lists.lttng.org>
To: "Kienan Stewart" <kstewart@efficios.com>,
"Christophe Bédard" <bedard.christophe@gmail.com>
Cc: "lttng-dev@lists.lttng.org" <lttng-dev@lists.lttng.org>
Subject: AW: [lttng-dev] Record stacktraces at userspace tracing domain
Date: Wed, 11 Dec 2024 10:32:24 +0000 [thread overview]
Message-ID: <VI1PR01MB684540CF33FFE72F69417E62823E2@VI1PR01MB6845.eurprd01.prod.exchangelabs.com> (raw)
In-Reply-To: <7f722802-752f-4cf5-ad2f-cb60264d8091@efficios.com>
Hi Christophe and Kienan,
Internal
On 12/2/24 4:17 PM, Christophe Bédard via lttng-dev wrote:
> I did the same thing a while ago, i.e., trigger tracepoints on
> malloc/free/etc. using liblttng-ust-libc-wrapper and collect userspace
> callstack information (so that the indirect calls to malloc/free can be
> removed from an application).
> ...
Thank you for the information and links!
I have looked into it, seems promising.
On 12/10/24 11:41 AM, Kienan Stewart via lttng-dev wrote:
> Depending on the type of information you require, it could be possible
> to use the instruction-pointer (ip) context[1], the statedump[2] and/or
> lttng-ust-dl[3] for base addresses, and the symbol table in-order to
> resolve ip -> symbol name in the offline analysis phase with the help of
> babeltrace's debug-info plugin[4]. While a bit more work for the
> analysis, this process reduces the impact of the tracing on the program
> at run-time.
Thanks for the hints.
This would be possible, but that would give me only the instruction pointer of the top-level stack frame.
If malloc and free calls are wrapped inside of functions (e.g. think about std::string, std::unique/shared_ptr for C++),
I would only see that it's called from that specific type.
But, for me, it's important to see the context, too, where the string/smart pointer is used.
Therefore I want to record the instruction pointer of every stackframe (or at least the top N ones in order to be able to locate the "problem").
As stacktraces are only wanted/needed for specific events, I also consider adding new tracepoints
like lttng_ust_libc:malloc_stacktrace to lttng-ust-libc-wrapper directly
recording the desired information into the trace buffer as an alternative solution.
Best regards,
Alexander
next prev parent reply other threads:[~2024-12-11 10:32 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-02 16:29 Alexander Krabler via lttng-dev
2024-12-02 21:17 ` Christophe Bédard via lttng-dev
2024-12-10 16:41 ` Kienan Stewart via lttng-dev
2024-12-11 10:32 ` Alexander Krabler via lttng-dev [this message]
2024-12-11 15:43 ` AW: " Mathieu Desnoyers via lttng-dev
2024-12-12 16:52 ` Alexander Krabler via lttng-dev
2024-12-12 16:56 ` Dirk Eibach 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=VI1PR01MB684540CF33FFE72F69417E62823E2@VI1PR01MB6845.eurprd01.prod.exchangelabs.com \
--to=lttng-dev@lists.lttng.org \
--cc=Alexander.Krabler@kuka.com \
--cc=bedard.christophe@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