From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id Q74wBm3SyGCsawAAWB0awg (envelope-from ) for ; Tue, 15 Jun 2021 12:16:45 -0400 Received: by simark.ca (Postfix, from userid 112) id 0A4DD1F163; Tue, 15 Jun 2021 12:16:45 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 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 RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id B01B81E939 for ; Tue, 15 Jun 2021 12:16:43 -0400 (EDT) Received: from lists-lttng01.efficios.com (localhost [IPv6:::1]) by lists.lttng.org (Postfix) with ESMTP id 4G4D3D5mgZzFyw; Tue, 15 Jun 2021 12:16:40 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=lists.lttng.org; s=default; t=1623773801; bh=S+aHnsl4jn3QAVg2VnqVbRU8RwJn8jzRf6Q0FYUqLuk=; h=Date:To:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=XbQYCz8qwwbohtVqxyYtsXH8eyz5Ggp4qUHqPnvgnSyV9M7qwl70VugjvoIKkFjC3 ELUwHaBYNyb9sDlN9kFrAScqVdbAj+DlrZ0kCJbVKYXeNrMnSPZNC4Nti05KmSf5xu eRlhvV59ZZytigE/IFyDZbePhlAq5E5fzdLIFAkMhDWz/fuYICv0yIEjabeK+TqiJD RQs7uagOUQjjipofKrPSUj9YJ9H7oF6D3uxPDouEUouTZ1v2VhRtIy6Bp00ooK6zc8 Zs9vmVkwgdbwLiRO0uVSr81y3zelkgUGKSJNWtVcYg2DTRitHUp5NcSM3pV9bUfT4C 1XA3f0PEM8JtA== Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by lists.lttng.org (Postfix) with ESMTPS id 4G4D3D1XdLzFyv for ; Tue, 15 Jun 2021 12:16:40 -0400 (EDT) Received: from oasis.local.home (cpe-66-24-58-225.stny.res.rr.com [66.24.58.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 263A6608FE; Tue, 15 Jun 2021 15:57:40 +0000 (UTC) Date: Tue, 15 Jun 2021 11:57:38 -0400 To: Philippe Proulx Message-ID: <20210615115738.46818ace@oasis.local.home> In-Reply-To: References: <1119833442.5505.1623700847146.JavaMail.zimbra@efficios.com> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Subject: Re: [lttng-dev] Usage example of libbabeltrace (babeltrace2) to read CTF traces from a GUI X-BeenThere: lttng-dev@lists.lttng.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: LTTng development list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Steven Rostedt via lttng-dev Reply-To: Steven Rostedt Cc: lttng-dev , Jeremie Galarneau , "linux-trace-devel@vger.kernel.org" Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: lttng-dev-bounces@lists.lttng.org Sender: "lttng-dev" [ Adding linux-trace-devel too ] On Tue, 15 Jun 2021 11:13:41 -0400 Philippe Proulx wrote: > On Mon, Jun 14, 2021 at 4:01 PM Mathieu Desnoyers via lttng-dev > wrote: > > > > Hi Philippe, Hi Jeremie, > > > > Steven is interested to use libbabeltrace as a CTF trace reader in the KernelShark > > project. It's a GUI which shows Linux kernel traces. > > > > He notices that most of the documented usage examples of the libbabeltrace API > > focus on use-cases where a custom trace format is converted into CTF. > > > > I know that the babeltrace2 program is the main user of libbabeltrace at this > > point, and that it reads CTF as source. > > > > For using libbabeltrace as CTF reader for a GUI, what would be the best examples > > to look at as starting point ? Perhaps the babeltrace2 binary, or just adapt a > > smaller example program and change the custom trace format source to "ctf.fs" ? > > Or anything else ? > > Hello, > > Unfortunately, the Babeltrace 2 C API documentation [1] doesn't offer a > graph building example at the moment. > > Therefore, indeed, the "best" example would be the babeltrace2(1) CLI > (see `src/cli`), although I understand that it's a very generic example > which can be overwhelming to explore. > > However, note that instead of instantiating an existing sink component > class (as found in a plugin), you'll want to make your own sink > component class to get access to each event message while also > controlling the graph operations. Using > bt_graph_add_simple_sink_component() [2] would be a good start. > > I can cook a minimal working example in the following days. That would be great, thanks! -- Steve > > Phil > > [1]: https://babeltrace.org/docs/v2.0/libbabeltrace2/ > [2]: https://babeltrace.org/docs/v2.0/libbabeltrace2/group__api-graph.html#gaa8432f03a967d01b764fb1bc959c8e89 > > > > > Thanks, > > > > Mathieu > > > > -- > > Mathieu Desnoyers > > EfficiOS Inc. > > http://www.efficios.com > > _______________________________________________ > > lttng-dev mailing list > > lttng-dev@lists.lttng.org > > https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev _______________________________________________ lttng-dev mailing list lttng-dev@lists.lttng.org https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev