From patchwork Thu Nov 27 11:26:24 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Isaac True X-Patchwork-Id: 4650 Return-Path: Received: from shymkent.ilbers.de ([unix socket]) by shymkent (Cyrus 2.5.10-Debian-2.5.10-3+deb9u2) with LMTPA; Thu, 27 Nov 2025 12:31:25 +0100 X-Sieve: CMU Sieve 2.4 Received: from mail-ed1-f63.google.com (mail-ed1-f63.google.com [209.85.208.63]) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8+deb9u1) with ESMTPS id 5ARBVNVb019187 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 27 Nov 2025 12:31:24 +0100 Received: by mail-ed1-f63.google.com with SMTP id 4fb4d7f45d1cf-6411fc67650sf1061703a12.0 for ; Thu, 27 Nov 2025 03:31:24 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1764243078; cv=pass; d=google.com; s=arc-20240605; b=jl5x9cTdeohiC99rUszrurqu0/oW2aBaB/OZUnhz6nYUOCEMOSDyUaCm+L0cEb80nE HXCd3ghB3ussPq17NckUww0/6wkSXgnDtVwrZEy2vnAf0S0yzJZcPaKJDH7jZE6rgq1e taI7ZUsJCFiZ6eeGrJIFIH1VhEgyGnosSJKEzyXSbKxAuGoKRGo8B8av2Oi/AnQJwwiP NBHvAfQ3aMc5xecUpZNQ0hmvzBsVHqBEl2FnQXXI8ZEk2h3B0K6TOhsVR4q6GRmNIn6j 21ediI9fz1brriYX8eajp15NnVC9w+2sRReESjWAiv5ElRt2U3AK3inkc+4cirK6kkiu WvWQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature; bh=+fbChbY05JqlmlRtFCSobSC/QouDFa/PYzQqB5/tnuU=; fh=OXSQlRv2ZboNlvVIE87yFxO+luPX0qJUCzag0lFzUAk=; b=VGfhdrhgLjyCmm5UnQqQCEzj88WvSFQfjCUWWu9RApyYgsL6rO8c+N8HAnz5pMeodd jUDG6+0J8v/IYp4S+bczwcqHy/IM0iMC1Lc/R3PPLLxxDXbJ3wce51laLqkPn33ZdcMA J08jakBJIwBoRI1k+zMCX+abOqjIGizvkW4bmAL6f+bCtCHcWy/amSCbw4m2ij2flVM9 bTdJ0DWoFutBextVdsHNDuh8Pw5W4cXaGhvVAxcrGGG8y+nH1Da7Pvo12dlwHqtIKdwj c9OqE41ktMuAqB4yQgtL0bPpuDnKfy9LdEm15puMFM5fmOk0X7wWNl/MgxXBkO9lLbG9 pTtg==; darn=isar-build.org ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@emlix.com header.s=20250930 header.b=nYhbM+U4; dkim=pass header.i=@emlix.com header.s=20250930 header.b=nYhbM+U4; spf=pass (google.com: domain of itrue@emlix.com designates 178.63.209.131 as permitted sender) smtp.mailfrom=itrue@emlix.com; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=emlix.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20230601; t=1764243078; x=1764847878; darn=isar-build.org; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to :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=+fbChbY05JqlmlRtFCSobSC/QouDFa/PYzQqB5/tnuU=; b=w57CnRqfaLlhRcLTKY9uJ7/nBWRpgWscL3XGUIt7E/NN4i0cpIn5pbUiz4LSCOyUqB W8WawkHOxG0C07sdEpxxqKwvS8IXNXb4lMd/iTakBvvF8F3AzXZHFmwyFjxaQERWgSzR YBaeYWH9PtipNm9k9rOFcMZWVJKAt6P5mI2ewcd8n616vGyVmHv14/PhMvCSepPExEJ7 lwptgeei804yOXg7dVQKGAyazo5f4fEEryONAbb19cK+dOABExmXBgmk2FyDIeD8ULxv mS+aWgNjNewD/wIKRWzCWvru08IoXNwvZXtqUSF00vvbm6quMtLENnGO43ESnLFDve9I EPFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1764243078; x=1764847878; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence:reply-to :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=+fbChbY05JqlmlRtFCSobSC/QouDFa/PYzQqB5/tnuU=; b=lKJHwxQMDuQCvt4GXnnpFeRVEiPDuKF6n5Wh8/e42pDMqJZCATA06SwVZc5YjrfFZn /nqXAGR32GUgPXjIyjFt2P4D53iZG5f/fE+dht/hqn+cyoPr3j+bjD7G7Z9OUSpyVNxc k1mSau4YWW42aoMPGBox16u1If0/uA3Ul5AuQDS7LzaoZ7ehGwbnH7CAj6v5jBn3Mpnh xMUs5S55aZ2KL3L0nEQIUXQO8WhiaTAiri0a9UTDXyZvIcleygnwNdsOES6+NyTKsuH1 jw/3pjVG831elcCXadZFANBOLRfdcnj5eT18WhpDrO8xfpsIqSXllqFKOkyF80vXUKr+ pXjQ== X-Forwarded-Encrypted: i=2; AJvYcCUG533Uzvn0qEUA4MPktq8+ch6OC3AovlAEPfTmH/NzO22HsbA2CtXptgivkwHGwsdM7i5Kx/g=@isar-build.org X-Gm-Message-State: AOJu0YwYBHxbZbehIWrqrULH4Sr6IwzyzF9dwqFm+nagIvrJ04uUTl6E xfAFvL0BPC6NmWYFoRK+1XmHSHkwjsUAD8tP5MTuvCYDwbP1mKauVzOO X-Google-Smtp-Source: AGHT+IHWgZ/FoTvtFUXXavtEM3+mghdqTB8XUzVCPeRUXuOZf9IO6LoC+rNhtlImWFOQSZKp2TLtRA== X-Received: by 2002:a05:6402:34c7:b0:634:ab36:3c74 with SMTP id 4fb4d7f45d1cf-645544544edmr16893991a12.9.1764243078070; Thu, 27 Nov 2025 03:31:18 -0800 (PST) X-BeenThere: isar-users@googlegroups.com; h="Ae8XA+Y3SF2EwaGr27yIHMxiPJhH9bFo2qKpLulAzkXLfsRU9w==" Received: by 2002:a50:fa8c:0:b0:641:6168:4680 with SMTP id 4fb4d7f45d1cf-64741977331ls645404a12.0.-pod-prod-02-eu; Thu, 27 Nov 2025 03:31:15 -0800 (PST) X-Received: by 2002:a05:6402:3054:20b0:645:c6b1:5f9d with SMTP id 4fb4d7f45d1cf-645c6b15fd9mr10949659a12.5.1764243075349; Thu, 27 Nov 2025 03:31:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1764243075; cv=none; d=google.com; s=arc-20240605; b=YZTAsiRVZpUcQH4o1bJcwhCYPSFX9M6TbdkLcHvG8vD3HUfGdbfIXs5OZkS1rerZ+C R+xGiB5ZzJZwuii41CxCLA3/N5RQ0QFkpy2nJRyoFW0R46iTr271GzftSN9/8dvsQt2l cH7lTnIfe2e2eLuT406tqXd6Fqjr6emap/JiXqYOy4WlbZ1tX325JvQiX23bJafd/TEA IsLA06aprDNwWQ7tD6mpT9Tr1QLiw+lWFsApIgVxXjiAo98Z5srir4F5ocN5LJ1KYKo7 TQV+Vk9sjGcdovuOEomO2PWkkvJxRzCoZbRyyAP8NwcFwYwMhJyfUZrI24NRdIzg1Yz/ mq4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature:dkim-signature; bh=4krv2q80F11sfg8LcVNLOBUt5addxKNIlW+U/RwwekA=; fh=vRrjvjDC0Nm912rKb+hserwyuGVHai4IaHlHCTH5jzE=; b=B/r+ismTxRu35zrK09JU1jDRfSdesDqXzXkC/7CY8KCfHjuKd0Tqcrk32Sccsr7z+e 1em7nGQoXP4PDNJvBcimLgBUJ+wsU2cmrEppa+Y8HbTVOMYBurREV/c3suMEO5xCmCSd ws0zQvYz1cXvGQQR6xUQpV4fG32Nc2583lJCbdvZOvbGE3ufijVuvkifvXbWTNVQh2To XJAqrKHrpsTucaONEB3HU2N/W3SSHctxb/mK9EQRA5j6HU75TiE5GZYoe3e1Ft29ebGk upHpwVgYsVdRm91wY7yXwTWrcoYz2ahwy0bhTaCti6v/lq8To00My4BCXAzrRyhnMByu hbtw==; dara=google.com ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@emlix.com header.s=20250930 header.b=nYhbM+U4; dkim=pass header.i=@emlix.com header.s=20250930 header.b=nYhbM+U4; spf=pass (google.com: domain of itrue@emlix.com designates 178.63.209.131 as permitted sender) smtp.mailfrom=itrue@emlix.com; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=emlix.com Received: from mx1.emlix.com (mx1.emlix.com. [178.63.209.131]) by gmr-mx.google.com with ESMTPS id 4fb4d7f45d1cf-64750a3dd2asi19396a12.2.2025.11.27.03.31.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Nov 2025 03:31:15 -0800 (PST) Received-SPF: pass (google.com: domain of itrue@emlix.com designates 178.63.209.131 as permitted sender) client-ip=178.63.209.131; Received: from mx1.emlix.com (localhost [127.0.0.1]) by mx1.emlix.com (Postfix) with ESMTP id 1BD715F8AF for ; Thu, 27 Nov 2025 12:31:09 +0100 (CET) Received: from mailer.emlix.com (p5098be52.dip0.t-ipconnect.de [80.152.190.82]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.emlix.com (Postfix) with ESMTPS id ECD205FB74 for ; Thu, 27 Nov 2025 12:31:08 +0100 (CET) X-Patchwork-Original-From: "'Isaac True' via isar-users" From: Isaac True To: isar-users@googlegroups.com Cc: Isaac True Subject: [PATCH v3 1/2] linux-custom: build perf and add it to the linux-perf package Date: Thu, 27 Nov 2025 12:26:24 +0100 Message-ID: <20251127113059.559394-2-itrue@emlix.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20251127113059.559394-1-itrue@emlix.com> References: <20251127113059.559394-1-itrue@emlix.com> MIME-Version: 1.0 X-Virus-Scanned: ClamAV using ClamSMTP X-Original-Sender: itrue@emlix.com X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@emlix.com header.s=20250930 header.b=nYhbM+U4; dkim=pass header.i=@emlix.com header.s=20250930 header.b=nYhbM+U4; spf=pass (google.com: domain of itrue@emlix.com designates 178.63.209.131 as permitted sender) smtp.mailfrom=itrue@emlix.com; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=emlix.com X-Original-From: Isaac True Reply-To: Isaac True Precedence: list Mailing-list: list isar-users@googlegroups.com; contact isar-users+owners@googlegroups.com List-ID: X-Spam-Checked-In-Group: isar-users@googlegroups.com X-Google-Group-Id: 914930254986 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , X-Spam-Status: No, score=-4.9 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H2,RCVD_IN_RP_CERTIFIED, RCVD_IN_RP_RNBL,RCVD_IN_RP_SAFE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on shymkent.ilbers.de X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= Add an additional package to the linux-custom recipe containing the perf tool, which is built as part of the kernel build process. This package is only created and perf is only built if the "notools" profile is not active, which is controlled by the new variable "KERNEL_BUILD_NOTOOLS" and enabled by default. Signed-off-by: Isaac True --- meta/recipes-kernel/linux/files/debian/control.tmpl | 9 +++++++++ meta/recipes-kernel/linux/files/debian/isar/build.tmpl | 3 +++ .../recipes-kernel/linux/files/debian/isar/common.tmpl | 2 ++ .../linux/files/debian/isar/install.tmpl | 7 +++++++ meta/recipes-kernel/linux/files/debian/rules.tmpl | 2 +- meta/recipes-kernel/linux/linux-custom.inc | 10 ++++++++++ 6 files changed, 32 insertions(+), 1 deletion(-) diff --git a/meta/recipes-kernel/linux/files/debian/control.tmpl b/meta/recipes-kernel/linux/files/debian/control.tmpl index ee87cf92..155c2808 100644 --- a/meta/recipes-kernel/linux/files/debian/control.tmpl +++ b/meta/recipes-kernel/linux/files/debian/control.tmpl @@ -69,3 +69,12 @@ Conflicts: linux-kbuild-${KERNEL_NAME_PROVIDED} Description: ${KERNEL_NAME_PROVIDED} Linux kbuild scripts and tools for @KR@ This package provides kernel kbuild scripts and tools for @KR@ This is useful for people who need to build external modules + +Package: linux-perf-${KERNEL_NAME_PROVIDED} +Build-Profiles: +Section: devel +Architecture: any +Multi-Arch: foreign +Depends: ${shlibs:Depends}, ${misc:Depends}, ${perl:Depends}, ${python3:Depends} +Description: ${KERNEL_NAME_PROVIDED} performance analysis tools for @KR@ + This package contains the 'perf' performance analysis tools for @KR@. diff --git a/meta/recipes-kernel/linux/files/debian/isar/build.tmpl b/meta/recipes-kernel/linux/files/debian/isar/build.tmpl index b4c105c1..f518ce34 100644 --- a/meta/recipes-kernel/linux/files/debian/isar/build.tmpl +++ b/meta/recipes-kernel/linux/files/debian/isar/build.tmpl @@ -23,6 +23,9 @@ do_build() { if echo "${DEB_BUILD_PROFILES}" | grep -q "kernel"; then # Build kernel scripts and tools ${MAKE} O=${KERNEL_BUILD_DIR} ${PARALLEL_MAKE} ${KERNEL_EXTRA_BUILDARGS} KCFLAGS="${KCFLAGS}" KAFLAGS="${KAFLAGS}" + if ! echo "${DEB_BUILD_PROFILES}" | grep -q "notools"; then # Build kernel tools + ${MAKE} O=${KERNEL_BUILD_DIR} ${PARALLEL_MAKE} ${KERNEL_EXTRA_BUILDARGS} KCFLAGS="${KCFLAGS}" KAFLAGS="${KAFLAGS}" -C tools/perf + fi elif echo "${DEB_BUILD_PROFILES}" | grep -q "kbuild"; then # Build kernel scripts and tools ${MAKE} O=${KERNEL_BUILD_DIR} ${PARALLEL_MAKE} ${KERNEL_EXTRA_BUILDARGS} KCFLAGS="${KCFLAGS}" KAFLAGS="${KAFLAGS}" scripts if grep -q -E "CONFIG_STACK_VALIDATION=y|CONFIG_HAVE_OBJTOOL=y" ${KERNEL_BUILD_DIR}/.config && [ -d "tools/objtool" ]; then diff --git a/meta/recipes-kernel/linux/files/debian/isar/common.tmpl b/meta/recipes-kernel/linux/files/debian/isar/common.tmpl index f9cc2f02..07283dcd 100644 --- a/meta/recipes-kernel/linux/files/debian/isar/common.tmpl +++ b/meta/recipes-kernel/linux/files/debian/isar/common.tmpl @@ -12,6 +12,7 @@ KERNEL_PKG_LIBC_HEADERS=linux-libc-dev KERNEL_PKG_LIBC_HEADERS_CROSS=linux-libc-dev-${DISTRO_ARCH}-cross KERNEL_PKG_KERN_KBUILD=linux-kbuild-${KERNEL_NAME_PROVIDED} KERNEL_PKG_KERN_KBUILD_CROSS=${KERNEL_PKG_KERN_KBUILD}-${DISTRO_ARCH}-cross +KERNEL_PKG_PERF=linux-perf-${KERNEL_NAME_PROVIDED} # Force creating debian package with valid host arch for -native build # Use a cross build to comply with arch specific kernel defconfigs @@ -38,6 +39,7 @@ deb_libc_hdr_dir=${deb_top_dir}/${KERNEL_PKG_LIBC_HEADERS} deb_libc_hdr_cross_dir=${deb_top_dir}/${KERNEL_PKG_LIBC_HEADERS_CROSS} deb_kern_kbuild_dir=${deb_top_dir}/${KERNEL_PKG_KERN_KBUILD} deb_kern_kbuild_cross_dir=${deb_top_dir}/${KERNEL_PKG_KERN_KBUILD_CROSS} +deb_perf_dir=${deb_top_dir}/${KERNEL_PKG_PERF} # Array of packages to be generated declare -A kern_pkgs diff --git a/meta/recipes-kernel/linux/files/debian/isar/install.tmpl b/meta/recipes-kernel/linux/files/debian/isar/install.tmpl index 6fa94508..e6badb2f 100644 --- a/meta/recipes-kernel/linux/files/debian/isar/install.tmpl +++ b/meta/recipes-kernel/linux/files/debian/isar/install.tmpl @@ -68,6 +68,9 @@ do_install() { install_dtbs install_kmods install_headers + if ! echo "${DEB_BUILD_PROFILES}" | grep -q "notools"; then + install_tools + fi fi # Stop tracing @@ -137,6 +140,10 @@ install_dtbs() { ${MAKE} O=${O} INSTALL_DTBS_PATH=${deb_img_dir}/usr/lib/linux-image-${krel} dtbs_install } +install_tools() { + install -Dm0755 ${O}/perf ${deb_perf_dir}/usr/bin/perf +} + install_kmods() { [ -n "${CONFIG_MODULES}" ] || return 0 ${MAKE} O=${O} modules_install \ diff --git a/meta/recipes-kernel/linux/files/debian/rules.tmpl b/meta/recipes-kernel/linux/files/debian/rules.tmpl index 598ae93f..a3b25396 100755 --- a/meta/recipes-kernel/linux/files/debian/rules.tmpl +++ b/meta/recipes-kernel/linux/files/debian/rules.tmpl @@ -45,4 +45,4 @@ override_dh_strip_nondeterminism: true override_dh_strip: - unset DEB_HOST_GNU_TYPE && dh_strip -Xvmlinu --no-automatic-dbgsym + unset DEB_HOST_GNU_TYPE && dh_strip -Xvmlinu -Xperf --no-automatic-dbgsym diff --git a/meta/recipes-kernel/linux/linux-custom.inc b/meta/recipes-kernel/linux/linux-custom.inc index ccbea976..8d9846cd 100644 --- a/meta/recipes-kernel/linux/linux-custom.inc +++ b/meta/recipes-kernel/linux/linux-custom.inc @@ -169,6 +169,14 @@ RECIPE_PROVIDES:append:libcdev = " \ linux-libc-dev-${DISTRO_ARCH}-cross \ " +# Set to "0" to disable the notools build profile and build the linux-perf package +KERNEL_BUILD_NOTOOLS ??= "1" + +# Provide the linux-perf package if the notools build profile has not been enabled +RECIPE_PROVIDES:append = " \ + ${@ bb.utils.contains('DEB_BUILD_PROFILES', 'pkg.{}.notools'.format(d.getVar('BPN')), '', 'linux-perf-{}'.format(d.getVar('KERNEL_NAME_PROVIDED')), d)} \ +" + # When cross-profile is active: # kbuild package is provided by -native or -kbuildtarget variant. Also headers # provisioning moves over to ensure those variants are pulled, although the @@ -231,6 +239,8 @@ def get_additional_build_profiles(d): profiles += ' pkg.{}.nolibcdev'.format(d.getVar('BPN')) elif bb.utils.to_boolean(d.getVar('KERNEL_LIBC_DEV_ARCH_ALL')): profiles += ' pkg.{}.libcdev-arch-all'.format(d.getVar('BPN')) + if bb.utils.to_boolean(d.getVar('KERNEL_BUILD_NOTOOLS')): + profiles += ' pkg.{}.notools'.format(d.getVar('BPN')) return profiles KERNEL_LIBC_DEV_ARCH = "${@ bb.utils.contains('DEB_BUILD_PROFILES', 'pkg.{}.libcdev-arch-all'.format(d.getVar('BPN')), 'all\nMulti-Arch: foreign', 'any', d) }"