From patchwork Mon Mar 16 09:07:22 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Bergin X-Patchwork-Id: 83501 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id D15C7F013EC for ; Mon, 16 Mar 2026 09:07:55 +0000 (UTC) Received: from mailrelay-egress7.pub.mailoutpod3-cph3.one.com (mailrelay-egress7.pub.mailoutpod3-cph3.one.com [46.30.211.246]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.46333.1773652067178929520 for ; Mon, 16 Mar 2026 02:07:47 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@berginkonsult.se header.s=rsa2 header.b=qa5KmCyo; dkim=pass header.i=@berginkonsult.se header.s=ed2 header.b=vfszFYF1; spf=none, err=SPF record not found (domain: berginkonsult.se, ip: 46.30.211.246, mailfrom: peter@berginkonsult.se) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1773652065; x=1774256865; d=berginkonsult.se; s=rsa2; h=content-transfer-encoding:mime-version:references:in-reply-to:message-id:date: subject:cc:to:from:from; bh=87rjQmZXgbDANGuv1GbyNqdh/bZjpTld6Ai7OZoN4i8=; b=qa5KmCyosGG3O2xiAoj7ybtT30XOS1YNSn3455RQPkyak3+McjOyLcRRkPoOalqw909+O2l18Nyfy eD4BxowkdWzrWYKnMusr4d1Gy69ue2wUE1kotT+C4JZ9pbgUuBjzuGv9R4XPXebUyK2Yyh/9MJktQw gVrRkeKdmSL4e3nix6BBM92FTiJEzvOR+5dUvGkPSkMb3BoryZz8OeYuXXRhdwDeJLUQ9tGqLrX4gy xMrHIhLYxbYVJg77PzaHjV3vQKuxt8AWQhKtbMFId0a+KcKF3UbQQjwQe7yzkgqTtglswjDor9F0wa i8ZI8MkGkMvGQ0sTi8aMkJhVdY/rpNw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; t=1773652065; x=1774256865; d=berginkonsult.se; s=ed2; h=content-transfer-encoding:mime-version:references:in-reply-to:message-id:date: subject:cc:to:from:from; bh=87rjQmZXgbDANGuv1GbyNqdh/bZjpTld6Ai7OZoN4i8=; b=vfszFYF1aiEnCDoZP8iOliAcaOvol6Dz0+fFg2DcSuWoJ19o8ubb+4dOZrj549HGZfC5O40H5uiyk f+WfH/NDQ== X-HalOne-ID: 97cf1104-2117-11f1-b6a3-494313b7f784 Received: from pbkserver2.. (c83-191-168-223.bredband.tele2.se [83.191.168.223]) by mailrelay6.pub.mailoutpod2-cph3.one.com (Halon) with ESMTPSA id 97cf1104-2117-11f1-b6a3-494313b7f784; Mon, 16 Mar 2026 09:07:44 +0000 (UTC) From: Peter Bergin To: openembedded-devel@lists.openembedded.org Cc: Peter Bergin Subject: [PATCH v2 2/2] rtla: add recipe for real-time linux analysis tool Date: Mon, 16 Mar 2026 10:07:22 +0100 Message-ID: <20260316090722.1184220-2-peter@berginkonsult.se> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260316090722.1184220-1-peter@berginkonsult.se> References: <20260316090722.1184220-1-peter@berginkonsult.se> MIME-Version: 1.0 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Mon, 16 Mar 2026 09:07:55 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-devel/message/125267 rtla source code is present in the kernel source tree at tools/tracing/rtla. There is another build option for rtla to enable bpf bindings, this was not a quick one to get working and left as a future improvement. Makefile for rtla has evolved in newer kernels (v6.9). Some fixes needed for support with older kernels. This commit was tested against 6.18 and 6.8. Also add rtla to packagegroup-meta-oe-benchmarks. Signed-off-by: Peter Bergin --- Changes in v2: - Add -D_GNU_SOURCE to fix detection of libtracefs in musl build. The feature test compiles and cpu_set_t is behind a guard with _GNU_SOURCE for musl which make it fail. .../packagegroups/packagegroup-meta-oe.bb | 1 + meta-oe/recipes-kernel/rtla/rtla.bb | 47 +++++++++++++++++++ 2 files changed, 48 insertions(+) create mode 100644 meta-oe/recipes-kernel/rtla/rtla.bb diff --git a/meta-oe/recipes-core/packagegroups/packagegroup-meta-oe.bb b/meta-oe/recipes-core/packagegroups/packagegroup-meta-oe.bb index 9fd7af6c08..0cbe3964c4 100644 --- a/meta-oe/recipes-core/packagegroups/packagegroup-meta-oe.bb +++ b/meta-oe/recipes-core/packagegroups/packagegroup-meta-oe.bb @@ -68,6 +68,7 @@ RDEPENDS:packagegroup-meta-oe-benchmarks = "\ nbench-byte \ phoronix-test-suite \ qperf \ + rtla \ s-suite \ stressapptest \ tinymembench \ diff --git a/meta-oe/recipes-kernel/rtla/rtla.bb b/meta-oe/recipes-kernel/rtla/rtla.bb new file mode 100644 index 0000000000..829804c4ea --- /dev/null +++ b/meta-oe/recipes-kernel/rtla/rtla.bb @@ -0,0 +1,47 @@ +SUMMARY = "Real-Time Linux Analysis tool" +LICENSE = "GPL-2.0-only" + +DEPENDS = "libtraceevent libtracefs" +PROVIDES = "virtual/rtla" + +B = "${WORKDIR}/${BPN}-${PV}" + +inherit kernelsrc kernel-arch pkgconfig + +do_populate_lic[depends] += "virtual/kernel:do_shared_workdir" + +PACKAGECONFIG ??= "" +PACKAGECONFIG[cpupower] = ",,cpupower" + +EXTRA_OEMAKE = "V=1 -C ${S}/tools/tracing/rtla O=${B} CROSS=${TARGET_PREFIX} \ + CC="${CC} ${DEBUG_PREFIX_MAP} -D_GNU_SOURCE" LD="${LD}" AR=${AR} ARCH=${ARCH} \ + BUILD_BPF_SKEL=0" + +do_compile() { + # Older kernels (before 6.9) use a standalone rtla Makefile that does not honor + # O= so outputs land in the kernel source tree (shared workdir). Remove + # build output to make sure it is rebuilt. For newer kernels this wil be a no-op. + rm -f ${S}/tools/tracing/rtla/rtla + rm -f ${S}/tools/tracing/rtla/src/*.o + + # Older kernels need additional variable EXTRA_LDFLAGS to pick up correct linker options. + export EXTRA_LDFLAGS="${LDFLAGS}" + oe_runmake +} + +do_install() { + install -d ${D}${bindir} + + # Older kernels (before 6.9) use a standalone rtla Makefile that does not honor + # O= for the final binary, so it ends up in the kernel source tree. + rtla_bin="${B}/rtla" + [ -f "${rtla_bin}" ] || rtla_bin="${S}/tools/tracing/rtla/rtla" + install -m 755 "${rtla_bin}" ${D}${bindir}/rtla + + # rtla, osnoise, hwnoise, and timerlat are all the same binary + ln -s rtla ${D}${bindir}/osnoise + ln -s rtla ${D}${bindir}/hwnoise + ln -s rtla ${D}${bindir}/timerlat +} + +PACKAGE_ARCH = "${MACHINE_ARCH}"