From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 2oMBFgUkTmfFBwIAWB0awg (envelope-from ) for ; Mon, 02 Dec 2024 16:17:57 -0500 Authentication-Results: simark.ca; dkim=pass (2048-bit key; unprotected) header.d=lists.lttng.org header.i=@lists.lttng.org header.a=rsa-sha256 header.s=default header.b=MTNpnIsn; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 4D5C51E0BB; Mon, 2 Dec 2024 16:17:57 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-3.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HTML_MESSAGE,MAILING_LIST_MULTI autolearn=ham autolearn_force=no version=4.0.0 Received: from lists.lttng.org (lists.lttng.org [167.114.26.123]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 98E401E05C for ; Mon, 2 Dec 2024 16:17:56 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=lists.lttng.org; s=default; t=1733174276; bh=eh1VQhncaDGESjOpQLGw2LeRR0nTt/UvixrZaVbgrEo=; h=References:In-Reply-To:Date:Subject:To:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=MTNpnIsnlIwmq08OlOvNh3EuxvGjiJY4QPKb/3urqq0Qe19GJT2JdOZQ2I9MZ8c3B 5nTv4aaqTJWPHYS9Oewmys3T/WH8JclSPZrR8zMBJG1zbRrdmnaVHo4a8OcGLuHs4w SocU3HYQOuRQyxRhEmgrxUSqTak5pogpK2Ro401BSLzHZdSe8g3UphxOuG7ydYrX0P Xj93CrrQSOQYrKJCoJI5Rr4GbCjYh6wPiPGdfLJqAbA4S2z2CpdI4htSzNp9CWTkGt eJu/iQdKHVuOmZUCn6Jp8pv84hsrsetgVnr4Yvj39MktlrvVuqVHAroJP9I5l6oIb/ tOKsTng0AVEWQ== Received: from lists-lttng01.efficios.com (localhost [IPv6:::1]) by lists.lttng.org (Postfix) with ESMTP id 4Y2GpX1F9Mz1cQl; Mon, 2 Dec 2024 16:17:56 -0500 (EST) Received: from mail-pl1-x62a.google.com (mail-pl1-x62a.google.com [IPv6:2607:f8b0:4864:20::62a]) by lists.lttng.org (Postfix) with ESMTPS id 4Y2GpW35ggz1cQf for ; Mon, 2 Dec 2024 16:17:55 -0500 (EST) Received: by mail-pl1-x62a.google.com with SMTP id d9443c01a7336-2154e3af730so25101755ad.3 for ; Mon, 02 Dec 2024 13:17:55 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733174274; x=1733779074; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=eh1VQhncaDGESjOpQLGw2LeRR0nTt/UvixrZaVbgrEo=; b=fYcPtitl8mWOwaB5rDXe0wpe+UU2k4aaADI8ddbfdrhXfBb42ds23DjG6ix5wPRe1O Y+LQAFxC1ff5ra4V5n77A6k9xswiue+ZeX5j7EfQbVhLlTM9Vuu2DNCsvfNUfP9Ripu1 kzIDwgZgX6qsHmZ2d0HeKrygz53gWEI7ECNISC8DA9XksY+LCxSjK9NogDThVlryt4tu 0+BPdNPIFKZQD6z2FjSo6YCkEH3nLlwf6Lac+Lf8JN85tn3M8ey783JAKKxKaeJF6Vb+ ZgKuRxEu2fmSvpti1vzq1aKB+78HckusMBxiL2JiSyGB+82z71XFpO+maN67048RDkaN lFfg== X-Gm-Message-State: AOJu0YxWwBjlElNF/NZ+/DRAmIHEi8I63UCfmpDC0Y/+N2mAjuDcHYvw hVoGrIvQGbRvaddXD3vtnEvKAWQk4SYC3boNeXzQJy2i3tqZoXy9bsfwLMcqIAHy5uWOT8MN4HR zM1qVB0xuAyYNsigum1x//GgfgiU= X-Gm-Gg: ASbGncsPVsuup2najMVYgq8XXPBzuQ1PINxhf7WNIJ+upbk560aCk3j8+2TDxCcyt6n IQujzUNjA8qepNyyQQQzU83gA4Z4= X-Google-Smtp-Source: AGHT+IGg7xAafKr2KaskVhKKaFDfAPrb7iceqykySJpdXCA19jUDPvbKzPHv666EmunwT5Ftb0vRtMt5myhsSurHnHM= X-Received: by 2002:a17:903:192:b0:211:f6b7:9a5b with SMTP id d9443c01a7336-215bd11afc4mr534155ad.43.1733174274024; Mon, 02 Dec 2024 13:17:54 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: Date: Mon, 2 Dec 2024 13:17:17 -0800 Message-ID: Subject: Re: [lttng-dev] Record stacktraces at userspace tracing domain To: Alexander Krabler Cc: "lttng-dev@lists.lttng.org" Content-Type: multipart/alternative; boundary="000000000000eff60906285014ac" X-BeenThere: lttng-dev@lists.lttng.org X-Mailman-Version: 2.1.39 Precedence: list List-Id: LTTng development list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: =?utf-8?q?Christophe_B=C3=A9dard_via_lttng-dev?= Reply-To: =?UTF-8?Q?Christophe_B=C3=A9dard?= Errors-To: lttng-dev-bounces@lists.lttng.org Sender: "lttng-dev" --000000000000eff60906285014ac Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi, 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). There is a userspace callstack context implementation here for lttng-ust 2.10, see the last 3 commits: https://github.com/tahini/lttng-ust-1/commits/ust-callstack-2.10/. Here's the corresponding lttng-tools 2.10 branch needed to enable the userspace callstack context: https://github.com/tahini/lttng-tools/commits/ust-context-callstack/. I've rebased it on 2.11 here: https://github.com/ApexAI/lttng-ust/commits/ust-callstack-2.11/. lttng-tools: https://github.com/ApexAI/lttng-tools/commits/ust-callstack-2.11/. It shouldn't be too hard to rebase it all on a newer version. Hope that helps, Christophe On Mon, Dec 2, 2024 at 8:32=E2=80=AFAM Alexander Krabler via lttng-dev < lttng-dev@lists.lttng.org> wrote: > Hello, > > we want to record stacktraces at specific userspace events like e.g. call= s > to malloc and free using liblttng-ust-libc-wrapper.so. > There is the callstack-user context to achieve this in general, however, > it seems like tracing of userspace stacktraces is only available in the > kernel tracing domain. > > Is there already a solution to achieve this goal? > If not, what would need to be done to achieve this? > > Thanks, > Alexander --000000000000eff60906285014ac Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi,

I did the same thing a while=C2=A0a= go, i.e., trigger tracepoints on malloc/free/etc. using liblttng-ust-libc-w= rapper and collect userspace callstack information (so that the indirect ca= lls to malloc/free can be removed from an application).

There is a userspace callstack=C2=A0context implementation here for l= ttng-ust 2.10, see the last 3 commits:=C2=A0https://github.com/tahini/lt= tng-ust-1/commits/ust-callstack-2.10/. Here's the corresponding ltt= ng-tools 2.10 branch needed to enable the userspace callstack=C2=A0context:= =C2=A0https://github.com/tahini/lttng-tools/commits/ust-context-calls= tack/.

I've rebased it on 2.11 here:=C2=A0= https://github.com/ApexAI/lttng-ust/commits/ust-callstack-2.11/. lttng= -tools:=C2=A0https://github.com/ApexAI/lttng-tools/commits/ust-callstack= -2.11/. It shouldn't be too hard to rebase it all on a newer versio= n.

Hope that helps,

Chris= tophe

On Mon, Dec 2, 2024 at 8:32=E2=80=AFAM Ale= xander Krabler via lttng-dev <lttng-dev@lists.lttng.org> wrote:
Hello,

we want to record stacktraces at specific userspace events like e.g. calls = to malloc and free using liblttng-ust-libc-wrapper.so.
There is the callstack-user context to achieve this in general, however, it= seems like tracing of userspace stacktraces is only available in the kerne= l tracing domain.

Is there already a solution to achieve this goal?
If not, what would need to be done to achieve this?

Thanks,
Alexander
--000000000000eff60906285014ac--