From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mathieu Desnoyers via lttng-dev Subject: Re: LTTng user-space callstacks Date: Fri, 27 Mar 2020 09:55:08 -0400 (EDT) Message-ID: <570185028.14544.1585317308324.JavaMail.zimbra@efficios.com> References: <2022773652.13655.1585251677207.JavaMail.zimbra@efficios.com> <1834419.usQuhbGJ8B@agathebauer> Reply-To: Mathieu Desnoyers Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============6937393945351188872==" Return-path: Received: from mail.efficios.com (mail.efficios.com [167.114.26.124]) by lists.lttng.org (Postfix) with ESMTPS id 48pjzQ36hTz1WJw for ; Fri, 27 Mar 2020 09:55:14 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mail.efficios.com (Postfix) with ESMTP id CBB3127FF88 for ; Fri, 27 Mar 2020 09:55:08 -0400 (EDT) In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: lttng-dev-bounces@lists.lttng.org Sender: "lttng-dev" To: Valentin Grigorev Cc: lttng-dev List-Id: lttng-dev@lists.lttng.org --===============6937393945351188872== Content-Type: multipart/alternative; boundary="=_5f79c5b3-a0dd-42b2-927a-7bafba043e85" --=_5f79c5b3-a0dd-42b2-927a-7bafba043e85 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Last time I checked, the main issue with perf's handling of cases that lack= frame pointers=20 is that they grab a ~2-4kB worth of stack data into the trace, and then pos= t-process it=20 with libunwind. This might be OK for sampling use-cases, but is not somethi= ng I consider=20 appropriate for tracing due to considerably increased use of tracing throug= hput.=20 Has the situation changed on the perf side ?=20 Thanks,=20 Mathieu=20 ----- On Mar 27, 2020, at 9:44 AM, Valentin Grigorev wrote:=20 > Yeah, as far as I know, perf [1] is successfully using libunwind to provi= de > callstacks. Probably, LTTng team should think about it too, if there are = no > serious obstacles. > [1]: [ https://perf.wiki.kernel.org/index.php/Main_Page | > https://perf.wiki.kernel.org/index.php/Main_Page ] > Best regards, > Valentin Grigorev > On Thu, Mar 26, 2020 at 11:53 PM Milian Wolff < [ mailto:milian.wolff@kda= b.com | > milian.wolff@kdab.com ] > wrote: >> On Donnerstag, 26. M=C3=A4rz 2020 20:41:17 CET Mathieu Desnoyers via ltt= ng-dev >> wrote: >>> ----- On Mar 26, 2020, at 1:39 PM, lttng-dev < [ >> > mailto:lttng-dev@lists.lttng.org | lttng-dev@lists.lttng.org ] > >> wrote: >> > > Hello! >> > > Currently, callstack collection in LTTng is only available for >> > > kernel-space >> > > events with context fields callstack-kernel and callstack-user . >> > > Is it expected that callstack collection for LTTng-UST will be added= too? >> > > And if it is expected, then how soon? >> > Hi Valentin, >> > It is something that would be interesting and useful, but a lot of wor= k >> > would be needed to have stack-walking this is fast enough and reentran= t wrt >> > signal handlers. Unfortunately, the backtrace(3) functions do not meet >> > those requirements. >> > Also, for gathering user-space callstacks from the kernel tracer, it o= nly >> > works if all user-space is compiled with frame pointers. This is also = a >> > limitation that would require a lot of work to overcome neatly. >> > None of those features are currently on any roadmap due to lack of cus= tomers >> > showing interest in getting this done. >> libunwind [1] should meet the requirements you need. It is high performa= nce >> thanks to extensive caching, signal safe and does not rely on frame poin= ters. >> [1]: [ https://github.com/libunwind/libunwind | >> https://github.com/libunwind/libunwind ] >> -- >> Milian Wolff | [ mailto:milian.wolff@kdab.com | milian.wolff@kdab.com ] = | Senior >> Software Engineer >> KDAB (Deutschland) GmbH, a KDAB Group company >> Tel: +49-30-521325470 >> KDAB - The Qt, C++ and OpenGL Experts --=20 Mathieu Desnoyers=20 EfficiOS Inc.=20 http://www.efficios.com=20 --=_5f79c5b3-a0dd-42b2-927a-7bafba043e85 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable
Last time I checked, the main issue with pe= rf's handling of cases that lack frame pointers
is that they = grab a ~2-4kB worth of stack data into the trace, and then post-process it<= /div>
with libunwind. This might be OK for sampling use-cases, but is n= ot something I consider
appropriate for tracing due to considerab= ly increased use of tracing throughput.
=
Has the situation changed on the perf s= ide ?

Thanks,

Mathieu

----- On Mar 27, 2020, at 9:44 AM, Vale= ntin Grigorev <valentin.grigorev@jetbrains.com> wrote:
Yeah, as far&= nbsp;as I know, perf [1] is successfully using libunwind to provide callsta= cks. Probably, LTTng team should think about it too, if there are no seriou= s obstacles.



=
Best regards,
Valentin Grigorev
<= /div>


On Thu, Mar 26, 2020 at 11:53 PM Milian Wolff <milian.wolff@kdab.com> wrote:
On Donnerstag, 26. M=C3=A4rz 2020 = 20:41:17 CET Mathieu Desnoyers via lttng-dev
wrote:
> ----- On Mar 26, 2020, at 1:39 PM, lttng-dev <lttng-dev@lists.lttng.org>
wrote:
> > Hello!
> >
> > Currently, callstack collection in LTTng is only available for > > kernel-space
> > events with context fields callstack-kernel and callstack-user .<= br> > >
> > Is it expected that callstack collection for LTTng-UST will be ad= ded too?
> > And if it is expected, then how soon?
>
> Hi Valentin,
>
> It is something that would be interesting and useful, but a lot of wor= k
> would be needed to have stack-walking this is fast enough and reentran= t wrt
> signal handlers. Unfortunately, the backtrace(3) functions do not meet=
> those requirements.
>
> Also, for gathering user-space callstacks from the kernel tracer, it o= nly
> works if all user-space is compiled with frame pointers. This is also = a
> limitation that would require a lot of work to overcome neatly.
>
> None of those features are currently on any roadmap due to lack of cus= tomers
> showing interest in getting this done.

libunwind [1] should meet the requirements you need. It is high performance=
thanks to extensive caching, signal safe and does not rely on frame pointer= s.

[1]: https://github.com/libunwind= /libunwind

--
Milian Wolff | milian.wolff@kdab.com | Senior Soft= ware Engineer
KDAB (Deutschland) GmbH, a KDAB Group company
Tel: +49-30-521325470
KDAB - The Qt, C++ and OpenGL Experts


--
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com
=
--=_5f79c5b3-a0dd-42b2-927a-7bafba043e85-- --===============6937393945351188872== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ lttng-dev mailing list lttng-dev@lists.lttng.org https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev --===============6937393945351188872==--