From patchwork Mon Aug 19 07:42:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Barsanti X-Patchwork-Id: 3324 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-lf1-f70.google.com (mail-lf1-f70.google.com [209.85.167.70]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 3D5AE3F1F3 for ; Mon, 19 Aug 2024 09:42:45 +0200 (CEST) Received: by mail-lf1-f70.google.com with SMTP id 2adb3069b0e04-52f00bde29dsf4986355e87.3 for ; Mon, 19 Aug 2024 00:42:45 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1724053364; cv=pass; d=google.com; s=arc-20160816; b=I1J0Js2CByJbpsm3GOmiEm4hubyPQXGknT7OwbeVYAwFOq4+Bh6lTVb19HiB8muksy Yrq3D4ZBemU1ieCjyafGgQOOYy1RrKQHLUwUbGhFXDtmmlC6PADFlG7SiJ7gXSKgaUXm a9PSB3bl354eZvuejl7rhjjDj/rnq9rgBdFyl8UJeuuwcAPklgdpc33g96Ug4qZWkcRY p7R3ZqqAWCPu6BgalQ7YlGZ3pUezhoPjx0t5uzoLiMYiI7yf5yXQKOS9DJMChqZ8aBml McG/6Lb72tT9bMO0XBWT1hyB8qUSEyEPiCzikjhvxq1DrF/VFo/o/rgB0QQ/luJorlu5 6LXw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=2fhRoeLK1JucFB2Cn0r6JAYFHRhf0MvXehaFZasDoFk=; fh=6IpZ1Wzsj0MDeltpO8J+wl4y/ZniinqMV6pW6bGUN8o=; b=SplSAmXF24yPDGKkaPz9anh9GutoQOkroOS76IR47vSZyNhKZ7a+SE+7P6ol4p8aZo 5VQ0P4VEBbPSUqgDX+Dr+P0CtUtRgS9UypKCxzdjlS5+dvMfbY7a7s5dlYOcAsu0bVtL LUPu+DzKeUxKytWF9VquIuyjaHjbXcjDJWDh8JGdtkgs0pBHg0CL8p5BvEJxQlwi8oAn ZwF5LD2OSGFBkhTm0m7C48UlqvDnx/gq9ziaI25I0uROzuLeY7w/ztYpseJyvHUT0Cyp 2H2DvLO7rGUWkFFpzWdv+qc2TdotVXezYf7/WoibG+Fue7Eq9J3rogFzQ2kz1I5RFxaB ArJA==; darn=patchwork.amarulasolutions.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=riV4ajY+; spf=pass (google.com: domain of patrick.barsanti@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=patrick.barsanti@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com; dara=pass header.i=@amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1724053364; x=1724658164; darn=patchwork.amarulasolutions.com; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:x-original-authentication-results :x-original-sender:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=2fhRoeLK1JucFB2Cn0r6JAYFHRhf0MvXehaFZasDoFk=; b=pXch4ov64H299bS9w0lWfw5XbbcgU8jHp9oy/2+ywjZoYY/Wd0ROhFH2VZLxE4uiQZ g9lafB6XntmAI6EZ+XJey4l9qhxM4U0mqLKg6yL6hCUJ1o9ox9t8N1t+E2UK0xTvimq3 JaqjSbXs8awfpvKR399Cq5qqerPRyA/HfY8wY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724053364; x=1724658164; h=list-unsubscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :x-beenthere:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=2fhRoeLK1JucFB2Cn0r6JAYFHRhf0MvXehaFZasDoFk=; b=CSOuebz6obryRVqKjJbEAyiFqlpXlMvZoyTSKxGNwk1D0PFLjdfcuhy5LzQ4J/801r frqIp2sYZUiaVxqUMOzPluPAzPrWYx+ViMo6JeiB4hC32EwvVklNGhEUp85U0Ye0liIQ WMk2rAQxKLrkkk3gl2ADmIk1+dBaffzZ9+cP77IGrPOh6tNcEQHdkc4guxcvPV9n2Z2c SpZlAClPv5s2hsB8ZDz4MU6H0kisx4qfSLQ49JF/O7L3Y2cXUqzcnLBrl4zsJ6htK15z hw9mGNd63musJbltEgJ/hZtFLHAABlsQc9ahiy/olOVMehO34v97fSQaRECFSIZqceOU +ocw== X-Forwarded-Encrypted: i=2; AJvYcCXdo/ChrA/vHnZebJspvjH6dMxpRMbDREexLHY3vg08H2myozjwNjUS5f2odTwZ2dV3C37ZvZgSy7mh21/3DwWqlaYi79TJhbxXIyaAtNEihcykxLrxP30s6vdhhA== X-Gm-Message-State: AOJu0Yx45fa2C9bNks3phq47cey4zXi+exuQcyU/Oj+sgQSIBswNTqgi BXscWMu3dq2i6i5UFWDa9+sy1eS7Ku32GmWzu0rXkRqbHWPHWZVRhzMkcYu8l6DCKA== X-Google-Smtp-Source: AGHT+IG+v6bEOI5eLAsqT0GYYQxR68KR959X16UPw/KDHqUTpKCh0Xnw1mbCLDb5Si2iTwWS/9LsRg== X-Received: by 2002:a05:6512:4007:b0:530:ab68:25c5 with SMTP id 2adb3069b0e04-5331c691facmr8695824e87.2.1724053364326; Mon, 19 Aug 2024 00:42:44 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a05:6512:b84:b0:52f:d1b7:329a with SMTP id 2adb3069b0e04-53307d18c55ls100168e87.1.-pod-prod-05-eu; Mon, 19 Aug 2024 00:42:42 -0700 (PDT) X-Received: by 2002:a05:6512:6c8:b0:52c:df83:a740 with SMTP id 2adb3069b0e04-5331c6bb6abmr8382352e87.30.1724053362524; Mon, 19 Aug 2024 00:42:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1724053362; cv=none; d=google.com; s=arc-20160816; b=S8vQ3FAfxhOf7bKt5HPY86sOeY/NV1e0rLJ3W+tMV6chs7Sd4p/zmHz/V4wgVV8qD3 q+3BDXfP5E8NBqUiQjZ0jKFhgPf2k9TpLrepVzeSIsMFWU1tiPFUMAP/cEgzVd39g2Fq rO0ddVxYMHEFsrlKMDERB21L7y4iHLURLJbid2LYWA+vl1xdun7lSJZ+Pc4383ttv96I QWhPz5M4EQ/3TM5KZxrK+/dzKh0lNorWqpr8dqFkpslY8/9xWygEn0kAz7YI0X+nMGym k2TiO4J0L/EeQGQdq+NNR7KdW9KRiRR0/jbbSM90p9t+heXhnFJgcRrdHS3AZcISLkSS 0ENw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=KU70sO2f1MbpL1a0GzuemSFqFOySekwPtNYM57PQnPo=; fh=u9hQ0FYhgFaRYZt60LMCTuHprfvTVd18Zbk+lSMUPZs=; b=k3tRwSpptV0ZwopboEOzRttwTgRUHzzFFSjdkEDzllQ20zKth1cOXDfxhcBO7MDdih ubjAnY7YhcGhktrmelI8zD92mmU9iSeusZbVc7D++TqQWK7PfZR7W59/0/P07sdDL/IJ i9xHW55D8rhqWQN+G0jb3nOZzsZeST9HRew419STV+3lo+T+DCNl6S+AOR3bf1eY7VwZ h27yw0pMdWxE0BXQKXYR24JcyJbSVXppD7LAPvJ0+mvhU1nimdNxE8nhLbbR3JB1VQhD O3x/4S9a3vNygGc2TN4fx+O7D1fBguVTcEKX+4BPxVpceckSR3zP1RZrqiVrIq2rpq8u p6Mg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=riV4ajY+; spf=pass (google.com: domain of patrick.barsanti@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=patrick.barsanti@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com; dara=pass header.i=@amarulasolutions.com Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41]) by mx.google.com with SMTPS id 2adb3069b0e04-5330d3bfad9sor2358137e87.14.2024.08.19.00.42.42 for (Google Transport Security); Mon, 19 Aug 2024 00:42:42 -0700 (PDT) Received-SPF: pass (google.com: domain of patrick.barsanti@amarulasolutions.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41; X-Received: by 2002:a05:6512:4023:b0:533:e5f:2678 with SMTP id 2adb3069b0e04-5331c6e3eb1mr6684204e87.53.1724053361512; Mon, 19 Aug 2024 00:42:41 -0700 (PDT) Received: from localhost.localdomain (i116103.upc-i.chello.nl. [62.195.116.103]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a83838c68f2sm598333966b.2.2024.08.19.00.42.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Aug 2024 00:42:40 -0700 (PDT) From: Patrick Barsanti To: linux-amarula@amarulasolutions.com Cc: michael@amarulasolutions.com, adam.duskett@amarulasolutions.com, Patrick Barsanti Subject: [PATCH 4/6] rtla: Add kernel recipe for rtla Date: Mon, 19 Aug 2024 09:42:00 +0200 Message-ID: <20240819074202.34144-5-patrick.barsanti@amarulasolutions.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240819074202.34144-1-patrick.barsanti@amarulasolutions.com> References: <20240819074202.34144-1-patrick.barsanti@amarulasolutions.com> MIME-Version: 1.0 X-Original-Sender: patrick.barsanti@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=riV4ajY+; spf=pass (google.com: domain of patrick.barsanti@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=patrick.barsanti@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com; dara=pass header.i=@amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , The rtla is a meta-tool that includes a set of commands that aims to analyze the real-time properties of Linux. Add support for it in poky. Signed-off-by: Patrick Barsanti --- meta/recipes-kernel/rtla/rtla.bb | 137 +++++++++++++++++++++++++++++++ 1 file changed, 137 insertions(+) create mode 100644 meta/recipes-kernel/rtla/rtla.bb diff --git a/meta/recipes-kernel/rtla/rtla.bb b/meta/recipes-kernel/rtla/rtla.bb new file mode 100644 index 0000000000..3eab857f92 --- /dev/null +++ b/meta/recipes-kernel/rtla/rtla.bb @@ -0,0 +1,137 @@ +SUMMARY = "RTLA (Real-Time Linux Analysis) tool" +DESCRIPTION = "The rtla is a meta-tool that includes a set of commands that \ + aims to analyze the real-time properties of Linux. But instead of testing \ + Linux as a black box, rtla leverages kernel tracing capabilities to provide \ + precise information about the properties and root causes of unexpected results." + +HOMEPAGE = "https://www.kernel.org/doc/html/latest/tools/rtla/rtla.html" + +LICENSE = "GPL-2.0-only" + +DEPENDS = "\ + ${MLPREFIX}binutils \ + ${MLPREFIX}elfutils \ + bison-native \ + flex-native \ + libgcc \ + libtraceevent \ + libtracefs \ + python3 \ + python3-docutils-native \ + python3-setuptools-native \ + virtual/${MLPREFIX}libc \ + xz \ +" + +do_configure[depends] += "virtual/kernel:do_shared_workdir" + +PROVIDES = "virtual/rtla" + +inherit linux-kernel-base kernel-arch manpages + +inherit_defer ${@bb.utils.contains('PACKAGECONFIG', 'python', 'python3targetconfig', '', d)} +inherit python3-dir +export PYTHON_SITEPACKAGES_DIR + +#kernel 3.1+ supports WERROR to disable warnings as errors +export WERROR = "0" + +do_populate_lic[depends] += "virtual/kernel:do_shared_workdir" + +inherit kernelsrc + +S = "${WORKDIR}/${BP}" + +LDFLAGS = "-ldl -lutil" + +EXTRA_OEMAKE = '\ + V=1 \ + VF=1 \ + -C ${S}/tools/tracing/rtla \ + O=${B} \ + CROSS_COMPILE=${TARGET_PREFIX} \ + ARCH=${ARCH} \ + CC="${CC}" \ + CCLD="${CC}" \ + LDSHARED="${CC} -shared" \ + AR="${AR}" \ + LD="${LD}" \ + EXTRA_CFLAGS="-ldw -I${S}" \ + YFLAGS='-y --file-prefix-map=${WORKDIR}=${TARGET_DBGSRC_DIR}' \ + ${PACKAGECONFIG_CONFARGS} \ + PKG_CONFIG=pkg-config \ + TMPDIR="${B}" \ + LIBUNWIND_DIR=${STAGING_EXECPREFIXDIR} \ +' + +EXTRA_OEMAKE += "\ + 'DESTDIR=${D}' \ + 'prefix=${prefix}' \ + 'bindir=${bindir}' \ + 'sharedir=${datadir}' \ + 'sysconfdir=${sysconfdir}' \ + 'sharedir=${@os.path.relpath(datadir, prefix)}' \ + 'mandir=${@os.path.relpath(mandir, prefix)}' \ + 'infodir=${@os.path.relpath(infodir, prefix)}' \ + ${@bb.utils.contains('PACKAGECONFIG', 'python', 'PYTHON=python3 PYTHON_CONFIG=python3-config', '', d)} \ +" + +# During do_configure, we might run a 'make clean'. That often breaks +# when done in parallel, so disable parallelism for do_configure. +EXTRA_OEMAKE:append:task-configure = " JOBS=1" + +RTLA_SRC ?= "\ + arch/${ARCH}/Makefile \ + arch/arm64/tools \ + Documentation/tools/rtla \ + Makefile \ + scripts/ \ + tools/arch \ + tools/build \ + tools/include \ + tools/lib \ + tools/Makefile \ + tools/scripts \ + tools/tracing/Makefile \ + tools/tracing/rtla \ +" + +do_compile() { + # Linux kernel build system is expected to do the right thing + unset CFLAGS + test -e ${S}/tools/lib/traceevent/plugins/Makefile && \ + sed -i -e 's|\$(libdir)/traceevent/plugins|\$(libdir)/traceevent_${KERNEL_VERSION}/plugins|g' ${S}/tools/lib/traceevent/plugins/Makefile + test -e ${S}/tools/tracing/rtla/Makefile.config && \ + sed -i -e 's|\$(libdir)/traceevent/plugins|\$(libdir)/traceevent_${KERNEL_VERSION}/plugins|g' ${S}/tools/tracing/rtla/Makefile.config + oe_runmake all +} + +do_install() { + # Linux kernel build system is expected to do the right thing + unset CFLAGS + oe_runmake install +} + +do_configure[prefuncs] += "copy_rtla_source_from_kernel" +python copy_rtla_source_from_kernel() { + sources = (d.getVar("RTLA_SRC") or "").split() + src_dir = d.getVar("STAGING_KERNEL_DIR") + dest_dir = d.getVar("S") + bb.utils.mkdirhier(dest_dir) + bb.utils.prunedir(dest_dir) + for s in sources: + src = oe.path.join(src_dir, s) + dest = oe.path.join(dest_dir, s) + if not os.path.exists(src): + bb.warn("Path does not exist: %s. Maybe RTLA_SRC lists more files than what your kernel version provides and needs." % src) + continue + if os.path.isdir(src): + oe.path.copyhardlinktree(src, dest) + else: + src_path = os.path.dirname(s) + os.makedirs(os.path.join(dest_dir,src_path),exist_ok=True) + bb.utils.copyfile(src, dest) +} + +# Skip the stripping QA check +INSANE_SKIP:${PN} += "already-stripped"