From patchwork Wed May 11 02:57:16 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Mittal, Anuj" X-Patchwork-Id: 7876 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 E7A7DC4332F for ; Wed, 11 May 2022 02:57:47 +0000 (UTC) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mx.groups.io with SMTP id smtpd.web12.6508.1652237864009171798 for ; Tue, 10 May 2022 19:57:46 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=VZRvncf0; spf=pass (domain: intel.com, ip: 134.134.136.20, mailfrom: anuj.mittal@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1652237864; x=1683773864; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=MQY5YC+zuFb+d3X9wkZUXEoeVleH4nZ4npMZv7xIuaM=; b=VZRvncf00v9datUB5Z0corf96RSVwecIro/1B3nxQgtg4FpEqMabCsHL SyLKDtFL9/90KbE/A7CroctqSe6m2/+e8z17zcArdcO2yWVTg3RBpGSif 2rQkYNW9p3++8irYMT8kZdPBeEHrvct3zIfwPS7WXAyrXBDLNGbKYbHXv QVNiRIvyjeZmJjsrxGr5VRQB5Hfgpgn7rqdYOWKvYC/E754uBGorILeh+ n9HN6wyvjYfFj+lNH8ga5xkPf98hdC6L/m8s76MdlclyMwpPZqkKVo8IO 9/EKs9OhL6i/9taolmW/g8kXw7LI8T07XvAwFUjAXpGJQRyaVgQLpr8sh w==; X-IronPort-AV: E=McAfee;i="6400,9594,10343"; a="257105984" X-IronPort-AV: E=Sophos;i="5.91,215,1647327600"; d="scan'208";a="257105984" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 May 2022 19:57:39 -0700 X-IronPort-AV: E=Sophos;i="5.91,215,1647327600"; d="scan'208";a="602754675" Received: from ukandhax-mobl3.gar.corp.intel.com (HELO anmitta2-mobl3.intel.com) ([10.214.163.3]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 May 2022 19:57:38 -0700 From: Anuj Mittal To: openembedded-core@lists.openembedded.org Subject: [honister][PATCH 01/17] busybox: Use base_bindir instead of hardcoding /bin path Date: Wed, 11 May 2022 10:57:16 +0800 Message-Id: X-Mailer: git-send-email 2.35.3 In-Reply-To: References: MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Wed, 11 May 2022 02:57:47 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/165469 From: Khem Raj This symlink is not valid when using usrmerge and ptest packaging would fail Exception: FileExistsError: [Errno 17] File exists: '/usr/bin/busybox.suid' -> '/mnt/b/yoe/master/build/tmp/work/ppc64p9le-yoe-linux-musl/busybox/1.35.0-r0/package/usr/lib/busybox/ptest/bin/login' Signed-off-by: Khem Raj Signed-off-by: Luca Ceresoli Signed-off-by: Richard Purdie (cherry picked from commit 238fd30689054c7b44176dce7180fb6dac4e1b6f) Signed-off-by: Anuj Mittal --- meta/recipes-core/busybox/busybox.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta/recipes-core/busybox/busybox.inc b/meta/recipes-core/busybox/busybox.inc index 808c3dc700..187ca15957 100644 --- a/meta/recipes-core/busybox/busybox.inc +++ b/meta/recipes-core/busybox/busybox.inc @@ -349,7 +349,7 @@ do_install_ptest () { # These access the internet which is not guaranteed to work on machines running the tests rm -rf ${D}${PTEST_PATH}/testsuite/wget sort ${B}/.config > ${D}${PTEST_PATH}/.config - ln -s /bin/busybox ${D}${PTEST_PATH}/busybox + ln -s ${base_bindir}/busybox ${D}${PTEST_PATH}/busybox } inherit update-alternatives From patchwork Wed May 11 02:57:17 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Mittal, Anuj" X-Patchwork-Id: 7879 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 E4971C433F5 for ; Wed, 11 May 2022 02:57:47 +0000 (UTC) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mx.groups.io with SMTP id smtpd.web10.6479.1652237862214713100 for ; Tue, 10 May 2022 19:57:47 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=nRQWPFg3; spf=pass (domain: intel.com, ip: 134.134.136.20, mailfrom: anuj.mittal@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1652237864; x=1683773864; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=iKAIYoj/BjnTJ2uxwK0+bTDTm82d7dC6nTssDlnndWQ=; b=nRQWPFg3Q+ZS/6vxiN1VWI2ZN2ypTIRe9+URVd2CU+LuyA5d1oVJCtFX JXyOCJGe0wDa4mcjl3D7QMSWUKkJXxB9tjwYKhVS4bYJdyNC22lum01+Q CBJNwlLGM625zKNwOdNYUhRpZc0p8lALyCnpFgrH+DBUe4gIpS/85Roz9 QOhHQRs2P4GbXtenYRww1jbolJlMN269SMgVpCunHYNLn9Qs3wm5OEqfc Rbb6wu5nHDxuk+n7n2LijBV1PGc6hV8Q0XT201Jk2feeNsbJSzl2W8rmg mcr9GDwlHeFgd1wIGvptg2HbB3NEEsHcYohIqlej8nlY2xa0t1hmNAKyA Q==; X-IronPort-AV: E=McAfee;i="6400,9594,10343"; a="257105989" X-IronPort-AV: E=Sophos;i="5.91,215,1647327600"; d="scan'208";a="257105989" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 May 2022 19:57:41 -0700 X-IronPort-AV: E=Sophos;i="5.91,215,1647327600"; d="scan'208";a="602754684" Received: from ukandhax-mobl3.gar.corp.intel.com (HELO anmitta2-mobl3.intel.com) ([10.214.163.3]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 May 2022 19:57:40 -0700 From: Anuj Mittal To: openembedded-core@lists.openembedded.org Subject: [honister][PATCH 02/17] cases/buildepoxy.py: fix typo Date: Wed, 11 May 2022 10:57:17 +0800 Message-Id: <6f04b791315dcaa58876e416098712ab9740aaf9.1652231471.git.anuj.mittal@intel.com> X-Mailer: git-send-email 2.35.3 In-Reply-To: References: MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Wed, 11 May 2022 02:57:47 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/165470 From: Chen Qi Signed-off-by: Chen Qi Signed-off-by: Luca Ceresoli Signed-off-by: Richard Purdie (cherry picked from commit 3a9b6e71d1e7e8e2ebc0ed047841e36f09300387) Signed-off-by: Steve Sakoman (cherry picked from commit af5bcfdc0b21607122fbbda6c35fac5d0cb0f829) Signed-off-by: Anuj Mittal --- meta/lib/oeqa/sdk/cases/buildepoxy.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta/lib/oeqa/sdk/cases/buildepoxy.py b/meta/lib/oeqa/sdk/cases/buildepoxy.py index 385f8ccca8..f69f720cd6 100644 --- a/meta/lib/oeqa/sdk/cases/buildepoxy.py +++ b/meta/lib/oeqa/sdk/cases/buildepoxy.py @@ -17,7 +17,7 @@ class EpoxyTest(OESDKTestCase): """ def setUp(self): if not (self.tc.hasHostPackage("nativesdk-meson")): - raise unittest.SkipTest("GalculatorTest class: SDK doesn't contain Meson") + raise unittest.SkipTest("EpoxyTest class: SDK doesn't contain Meson") def test_epoxy(self): with tempfile.TemporaryDirectory(prefix="epoxy", dir=self.tc.sdk_dir) as testdir: From patchwork Wed May 11 02:57:18 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Mittal, Anuj" X-Patchwork-Id: 7880 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 04A04C43217 for ; Wed, 11 May 2022 02:57:48 +0000 (UTC) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mx.groups.io with SMTP id smtpd.web11.6472.1652237865005143057 for ; Tue, 10 May 2022 19:57:47 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=ipotj4J7; spf=pass (domain: intel.com, ip: 134.134.136.20, mailfrom: anuj.mittal@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1652237865; x=1683773865; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=k3VmbTa1fkHUznUSmSsmgD1Nkunb0PPsS7wFNqkDfYA=; b=ipotj4J7rZWprIaEX62e+AmqOYchhEmRM4cemlfZPVrENkID3hlA3LQG CIlkpZj7N9oWwZoLee6SUiW2S0Xs7aSfUChwfrPAgg/lH/Mzp10yk0o55 1ItJErQHJVDqGBbmJupkKgGrZXvtl/OUtJXybTWDgStFdW0lDOOJubwd2 eD8tN6inJjTOUIALsHLAYktfm+hIZEBqLXs6bNXd7TbRP7L9shhs3wfdp ZD6llzQOvWwJaS5Qz9kl+PxwY5a98h7C9Rj4RbPIV6kjXQQtMSn9v3ewq 6XgoMIVLzwleDKHfA0dRrQgJY2CfKxCLDXq93jLV1RaZPaVR1T144yI+3 Q==; X-IronPort-AV: E=McAfee;i="6400,9594,10343"; a="257105993" X-IronPort-AV: E=Sophos;i="5.91,215,1647327600"; d="scan'208";a="257105993" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 May 2022 19:57:43 -0700 X-IronPort-AV: E=Sophos;i="5.91,215,1647327600"; d="scan'208";a="602754697" Received: from ukandhax-mobl3.gar.corp.intel.com (HELO anmitta2-mobl3.intel.com) ([10.214.163.3]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 May 2022 19:57:41 -0700 From: Anuj Mittal To: openembedded-core@lists.openembedded.org Subject: [honister][PATCH 03/17] neard: Switch SRC_URI to git repo Date: Wed, 11 May 2022 10:57:18 +0800 Message-Id: <1095841ef77bce46bcd7c6db28a376372cb12c50.1652231471.git.anuj.mittal@intel.com> X-Mailer: git-send-email 2.35.3 In-Reply-To: References: MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Wed, 11 May 2022 02:57:47 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/165471 From: Rahul Kumar The tarball (neard-0.16.tar.xz) fetched by the recipe is incomplete. Few plugins (e.g. tizen) and tests scripts (e.g. Test-channel, test-see, neard-ui.py, ndef-agent etc) are missing. Since neard did not release latest tarballs, so as per community recommendation switching the recipe SRC_URI to git repo. Community Discussion: https://lists.openembedded.org/g/openembedded-core/topic/90058043#163681 Signed-off-by: Rahul Kumar Signed-off-by: Luca Ceresoli Signed-off-by: Richard Purdie (cherry picked from commit b563f40ebf4461d9c35df72bd7599ea11e97da9c) Signed-off-by: Anuj Mittal --- meta/recipes-connectivity/neard/neard_0.16.bb | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/meta/recipes-connectivity/neard/neard_0.16.bb b/meta/recipes-connectivity/neard/neard_0.16.bb index b6cc1d6ced..936b3c5754 100644 --- a/meta/recipes-connectivity/neard/neard_0.16.bb +++ b/meta/recipes-connectivity/neard/neard_0.16.bb @@ -2,21 +2,22 @@ SUMMARY = "Linux NFC daemon" DESCRIPTION = "A daemon for the Linux Near Field Communication stack" HOMEPAGE = "http://01.org/linux-nfc" LICENSE = "GPLv2" +LIC_FILES_CHKSUM = "file://COPYING;md5=12f884d2ae1ff87c09e5b7ccc2c4ca7e \ + file://src/near.h;beginline=1;endline=20;md5=358e4deefef251a4761e1ffacc965d13 \ + " DEPENDS = "dbus glib-2.0 libnl" -SRC_URI = "${KERNELORG_MIRROR}/linux/network/nfc/${BP}.tar.xz \ +SRC_URI = "git://git.kernel.org/pub/scm/network/nfc/neard.git;protocol=git;branch=master \ file://neard.in \ file://Makefile.am-fix-parallel-issue.patch \ file://Makefile.am-do-not-ship-version.h.patch \ file://0001-Add-header-dependency-to-nciattach.o.patch \ " -SRC_URI[md5sum] = "5c691fb7872856dc0d909c298bc8cb41" -SRC_URI[sha256sum] = "eae3b11c541a988ec11ca94b7deab01080cd5b58cfef3ced6ceac9b6e6e65b36" -LIC_FILES_CHKSUM = "file://COPYING;md5=12f884d2ae1ff87c09e5b7ccc2c4ca7e \ - file://src/near.h;beginline=1;endline=20;md5=358e4deefef251a4761e1ffacc965d13 \ - " +SRCREV = "949795024f7625420e93e288c56e194cb9a3e74a" + +S = "${WORKDIR}/git" inherit autotools pkgconfig systemd update-rc.d From patchwork Wed May 11 02:57:19 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Mittal, Anuj" X-Patchwork-Id: 7882 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 04F17C4332F for ; Wed, 11 May 2022 02:57:58 +0000 (UTC) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mx.groups.io with SMTP id smtpd.web12.6508.1652237864009171798 for ; Tue, 10 May 2022 19:57:48 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=af5IqX9d; spf=pass (domain: intel.com, ip: 134.134.136.20, mailfrom: anuj.mittal@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1652237866; x=1683773866; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=4XuM8l+np9geNXwH2oSboCXTEYnnSQgc9j5QrOdu1z8=; b=af5IqX9diSf/ZBAUX2JmP03JmPTQeV6K/nifQldVYAPoqFJaAdQDYhNi UEqElWWu/ewyNrXZ9uj8vzxmu/+Dd3GeIKRmTv8gcSSL4IqbbiIuEhXJ0 eRmcsbC/O5OMeVbbdqLIe8Ckw0OsIIl0Qv5vstXZfYKReTUOhYQY/NwFF 4RBUFIVzjI+YkHQvFkUpI/oMJsUooPHd/OvM8AmwCmE5njN709v9RMkwn X4elrEeieeUHQklYZ/xrKj09nIPRM7UbflGzdCjQQAaapInWb+cxXQca2 edYwt0cGxRTgsWdlu2q7Dve+ds9ZC4VST/aHXtqMz4lDkeK9XmVD+QtuJ w==; X-IronPort-AV: E=McAfee;i="6400,9594,10343"; a="257106002" X-IronPort-AV: E=Sophos;i="5.91,215,1647327600"; d="scan'208";a="257106002" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 May 2022 19:57:45 -0700 X-IronPort-AV: E=Sophos;i="5.91,215,1647327600"; d="scan'208";a="602754707" Received: from ukandhax-mobl3.gar.corp.intel.com (HELO anmitta2-mobl3.intel.com) ([10.214.163.3]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 May 2022 19:57:44 -0700 From: Anuj Mittal To: openembedded-core@lists.openembedded.org Subject: [honister][PATCH 04/17] rootfs-postcommands: fix symlinks where link and output path are equal Date: Wed, 11 May 2022 10:57:19 +0800 Message-Id: X-Mailer: git-send-email 2.35.3 In-Reply-To: References: MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Wed, 11 May 2022 02:57:58 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/165473 From: Davide Gardenal When creating the manifest and the testdata.json links, if the link name is equal to the output name the link is not created, otherwise it is. This prevents a link-to-self in the first case. Signed-off-by: Davide Gardenal Signed-off-by: Luca Ceresoli Signed-off-by: Richard Purdie (cherry picked from commit bed63756c56f296ff3d5a7eef66e978bd19f1008) Signed-off-by: Anuj Mittal --- meta/classes/rootfs-postcommands.bbclass | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/meta/classes/rootfs-postcommands.bbclass b/meta/classes/rootfs-postcommands.bbclass index 0452fe4b27..2310e86cdf 100644 --- a/meta/classes/rootfs-postcommands.bbclass +++ b/meta/classes/rootfs-postcommands.bbclass @@ -267,9 +267,10 @@ python write_image_manifest () { if os.path.exists(manifest_name) and link_name: manifest_link = deploy_dir + "/" + link_name + ".manifest" - if os.path.lexists(manifest_link): - os.remove(manifest_link) - os.symlink(os.path.basename(manifest_name), manifest_link) + if manifest_link != manifest_name: + if os.path.lexists(manifest_link): + os.remove(manifest_link) + os.symlink(os.path.basename(manifest_name), manifest_link) } # Can be used to create /etc/timestamp during image construction to give a reasonably @@ -339,9 +340,10 @@ python write_image_test_data() { if os.path.exists(testdata_name) and link_name: testdata_link = os.path.join(deploy_dir, "%s.testdata.json" % link_name) - if os.path.lexists(testdata_link): - os.remove(testdata_link) - os.symlink(os.path.basename(testdata_name), testdata_link) + if testdata_link != testdata_name: + if os.path.lexists(testdata_link): + os.remove(testdata_link) + os.symlink(os.path.basename(testdata_name), testdata_link) } write_image_test_data[vardepsexclude] += "TOPDIR" From patchwork Wed May 11 02:57:20 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Mittal, Anuj" X-Patchwork-Id: 7878 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 04A3FC43219 for ; Wed, 11 May 2022 02:57:48 +0000 (UTC) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mx.groups.io with SMTP id smtpd.web08.6418.1652237867611179149 for ; Tue, 10 May 2022 19:57:47 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=fA2fwIL9; spf=pass (domain: intel.com, ip: 134.134.136.20, mailfrom: anuj.mittal@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1652237867; x=1683773867; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=mszcZLpWfqgFnK9tm+KHyx4HKutlQAotEu+bnu/jC4g=; b=fA2fwIL98FYOmcsXv1AK+ud1kBCwExAOzUIdtzowfHsHfgMjfKeZrZOw mv3UgctWK5m/0JwQya81g3BxhMttOpVv0XXf6UJosYEggJZnAnPmCnwVV i9cx0Ig4GjUNCCGLCGJ0KtiRQaTTL/mStT/UIZMCqA1odsODZEFIxSNE1 Merwo+u675UNDQ786Ua/OWo6BLUMjhgO7yhjVRQquN5NSUfIqIhA8GvEB hD3zqRLuTVKrOKeXpfMvqcwF6v1zMnFTqbWc2WBrRMnoV5cph7EpZ08mj IL6i7QfhtmkI6YAWR87Mb9XlmKqpR5509AtUHuskrKEsfypQxTepupX9E w==; X-IronPort-AV: E=McAfee;i="6400,9594,10343"; a="257106007" X-IronPort-AV: E=Sophos;i="5.91,215,1647327600"; d="scan'208";a="257106007" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 May 2022 19:57:47 -0700 X-IronPort-AV: E=Sophos;i="5.91,215,1647327600"; d="scan'208";a="602754719" Received: from ukandhax-mobl3.gar.corp.intel.com (HELO anmitta2-mobl3.intel.com) ([10.214.163.3]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 May 2022 19:57:45 -0700 From: Anuj Mittal To: openembedded-core@lists.openembedded.org Subject: [honister][PATCH 05/17] volatile-binds: Change DefaultDependencies from false to no Date: Wed, 11 May 2022 10:57:20 +0800 Message-Id: X-Mailer: git-send-email 2.35.3 In-Reply-To: References: MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Wed, 11 May 2022 02:57:47 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/165472 From: Portia The systemd-unit parameter DefaultDependencies changed from true/false to yes/no. This changed in systemd in v242. Signed-off-by: Portia Stephens Signed-off-by: Richard Purdie (cherry picked from commit add4dcb03dc7b034253db05f0023cb97cab8b26d) Signed-off-by: Anuj Mittal --- .../recipes-core/volatile-binds/files/volatile-binds.service.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta/recipes-core/volatile-binds/files/volatile-binds.service.in b/meta/recipes-core/volatile-binds/files/volatile-binds.service.in index e2ad39f258..0c1c79d0c4 100644 --- a/meta/recipes-core/volatile-binds/files/volatile-binds.service.in +++ b/meta/recipes-core/volatile-binds/files/volatile-binds.service.in @@ -1,6 +1,6 @@ [Unit] Description=Bind mount volatile @where@ -DefaultDependencies=false +DefaultDependencies=no Before=local-fs.target RequiresMountsFor=@whatparent@ @whereparent@ ConditionPathIsReadWrite=@whatparent@ From patchwork Wed May 11 02:57:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Mittal, Anuj" X-Patchwork-Id: 7884 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 04ECAC433EF for ; Wed, 11 May 2022 02:57:58 +0000 (UTC) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mx.groups.io with SMTP id smtpd.web10.6480.1652237869110482622 for ; Tue, 10 May 2022 19:57:49 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=XFzJFuoG; spf=pass (domain: intel.com, ip: 134.134.136.20, mailfrom: anuj.mittal@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1652237869; x=1683773869; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=SvihIhAnIzEpnhhmc0tN3pbQbHTL4rB163G5NCeQR4I=; b=XFzJFuoG+qKUJjKhVgyd9TFqTFU+9nGdE712H4W0jPKt8xO1m2CAwpsV /ro/rN+6nUnOIAeaswLQonrycBMIWHdtKGFVPAuaWEzHHVWE5Vmot7W2b 3aNFhaQ8RPF3tRtlsiqLxBCLuSw1D7UDSBomNHvgIY6lmeJH5Fu5dq/F0 yGGxUlLdZczOcQQOj4tkMNQuqK4s2ozufu8eUfwuQrXinxH++zbIEAwq5 7aIVF9zrdIcewBi7y0G5RFKmrJPyWSl+FBT2+7yaiY7RxKOBDXtiGJ74o y8D77iKzO42S5QEyJn2392RIS2ilWH44IzsFGiVbR92cMYUBUARVv0vvP Q==; X-IronPort-AV: E=McAfee;i="6400,9594,10343"; a="257106023" X-IronPort-AV: E=Sophos;i="5.91,215,1647327600"; d="scan'208";a="257106023" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 May 2022 19:57:48 -0700 X-IronPort-AV: E=Sophos;i="5.91,215,1647327600"; d="scan'208";a="602754730" Received: from ukandhax-mobl3.gar.corp.intel.com (HELO anmitta2-mobl3.intel.com) ([10.214.163.3]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 May 2022 19:57:47 -0700 From: Anuj Mittal To: openembedded-core@lists.openembedded.org Subject: [honister][PATCH 06/17] oeqa/selftest: add test for git working correctly inside pseudo Date: Wed, 11 May 2022 10:57:21 +0800 Message-Id: X-Mailer: git-send-email 2.35.3 In-Reply-To: References: MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Wed, 11 May 2022 02:57:58 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/165474 From: Ross Burton The fix for CVE-2022-24765 in git[1] breaks any use of git inside pseudo. Add a simple test case to oe-selftest to verify that at least basic uses of git work fine under pseudo. [1] https://github.com/git/git/commit/8959555cee7ec045958f9b6dd62e541affb7e7d9 Signed-off-by: Ross Burton Signed-off-by: Richard Purdie (cherry picked from commit 46822268040a23dbb81f71fe35aee8c2663a31f6) Signed-off-by: Anuj Mittal --- .../git-submodule-test/git-submodule-test.bb | 15 +++++++++++++++ meta/lib/oeqa/selftest/cases/git.py | 15 +++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 meta/lib/oeqa/selftest/cases/git.py diff --git a/meta-selftest/recipes-test/git-submodule-test/git-submodule-test.bb b/meta-selftest/recipes-test/git-submodule-test/git-submodule-test.bb index cc5d7eae5a..fa3041b7d8 100644 --- a/meta-selftest/recipes-test/git-submodule-test/git-submodule-test.bb +++ b/meta-selftest/recipes-test/git-submodule-test/git-submodule-test.bb @@ -7,3 +7,18 @@ INHIBIT_DEFAULT_DEPS = "1" SRC_URI = "gitsm://git.yoctoproject.org/git-submodule-test;branch=master" SRCREV = "a2885dd7d25380d23627e7544b7bbb55014b16ee" + +S = "${WORKDIR}/git" + +do_test_git_as_user() { + cd ${S} + git status +} +addtask test_git_as_user after do_unpack + +fakeroot do_test_git_as_root() { + cd ${S} + git status +} +do_test_git_as_root[depends] += "virtual/fakeroot-native:do_populate_sysroot" +addtask test_git_as_root after do_unpack diff --git a/meta/lib/oeqa/selftest/cases/git.py b/meta/lib/oeqa/selftest/cases/git.py new file mode 100644 index 0000000000..f12874dc7d --- /dev/null +++ b/meta/lib/oeqa/selftest/cases/git.py @@ -0,0 +1,15 @@ +from oeqa.selftest.case import OESelftestTestCase +from oeqa.utils.commands import bitbake + +class GitCheck(OESelftestTestCase): + def test_git_intercept(self): + """ + Git binaries with CVE-2022-24765 fixed will refuse to operate on a + repository which is owned by a different user. This breaks our + do_install task as that runs inside pseudo, so the git repository is + owned by the build user but git is running as (fake)root. + + We have an intercept which disables pseudo, so verify that it works. + """ + bitbake("git-submodule-test -c test_git_as_user") + bitbake("git-submodule-test -c test_git_as_root") From patchwork Wed May 11 02:57:22 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Mittal, Anuj" X-Patchwork-Id: 7885 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 F3DDCC433F5 for ; Wed, 11 May 2022 02:57:57 +0000 (UTC) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mx.groups.io with SMTP id smtpd.web10.6480.1652237869110482622 for ; Tue, 10 May 2022 19:57:50 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=ZXfEpHXV; spf=pass (domain: intel.com, ip: 134.134.136.20, mailfrom: anuj.mittal@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1652237870; x=1683773870; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=oJXMvpzwWyH5K1al2+JDqWCD9W5J7OqGjq9pA6741NA=; b=ZXfEpHXVudqBGsu2iEAGmLu1DVJ7Th5H3QeUp/xajJPtCPcbqbCeR6Dm iAzmUQTPTaU8ElVtSVCKRvQKu8pRPPVwMx8MWDAbvXIHZey1qc/uYv6HY 5jJIxvE+9R9Z1Xhrs7yangAM3usw34sNjkXL6KjeNPtB8uFobc01zI9KC 4ghqsoQ6rjQyODwqR8mUKB6nGAPJwimgeJRxzxwUpTld8jBBFQpQ+NYjA wWVCbJAHCbp3JyWk0f1GtzjGV0Dmsav4g62g2c68t4g+IakSizjp8eAC3 eAb1xW5krDilx1+us0fKZCqGvUjfyGpxzqddsMDW7BMrxzLnyq8J3umDI g==; X-IronPort-AV: E=McAfee;i="6400,9594,10343"; a="257106027" X-IronPort-AV: E=Sophos;i="5.91,215,1647327600"; d="scan'208";a="257106027" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 May 2022 19:57:50 -0700 X-IronPort-AV: E=Sophos;i="5.91,215,1647327600"; d="scan'208";a="602754744" Received: from ukandhax-mobl3.gar.corp.intel.com (HELO anmitta2-mobl3.intel.com) ([10.214.163.3]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 May 2022 19:57:49 -0700 From: Anuj Mittal To: openembedded-core@lists.openembedded.org Subject: [honister][PATCH 07/17] base: Avoid circular references to our own scripts Date: Wed, 11 May 2022 10:57:22 +0800 Message-Id: X-Mailer: git-send-email 2.35.3 In-Reply-To: References: MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Wed, 11 May 2022 02:57:57 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/165475 From: Richard Purdie We'd like to intercept git calls but we don't want circular references and HOSTTOOLS currently sets them up. Tweak to avoid them. Signed-off-by: Richard Purdie (cherry picked from commit 52c37e133fa55846aca2248ffcf3a10648dbb8d7) Signed-off-by: Anuj Mittal --- meta/classes/base.bbclass | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass index 340ebe7d78..070341d1aa 100644 --- a/meta/classes/base.bbclass +++ b/meta/classes/base.bbclass @@ -122,6 +122,10 @@ def setup_hosttools_dir(dest, toolsvar, d, fatal=True): tools = d.getVar(toolsvar).split() origbbenv = d.getVar("BB_ORIGENV", False) path = origbbenv.getVar("PATH") + # Need to ignore our own scripts directories to avoid circular links + for p in path.split(":"): + if p.endswith("/scripts"): + path = path.replace(p, "/ignoreme") bb.utils.mkdirhier(dest) notfound = [] for tool in tools: From patchwork Wed May 11 02:57:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Mittal, Anuj" X-Patchwork-Id: 7881 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 0BFB0C433FE for ; Wed, 11 May 2022 02:57:58 +0000 (UTC) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mx.groups.io with SMTP id smtpd.web10.6480.1652237869110482622 for ; Tue, 10 May 2022 19:57:52 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=dcRdKL/u; spf=pass (domain: intel.com, ip: 134.134.136.20, mailfrom: anuj.mittal@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1652237872; x=1683773872; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=9bRaH5tqdjpcJCVxbCNvIGcujSc0cO8LPQdKqQFK+bw=; b=dcRdKL/uz+YvsYZfS5n4ooE5HtKUjzjppTedmMiM2MsMF3p3fOn2p6l5 B6SalS5kD65jsn99ipAdeCm2qhDJN3+xA8bCBVhmPl2XPzhbox7gUOv8z RCd5ORrJtixkff6sAjSnTcOq13fyto5ozat1OA24YAOlDCmNzSjGhjM2n HtW5FXhbKyY8ExG0hRyhAKCfvLNjK6k26gvWIp5oWk6ahzKL/9KQZdR0t eqHDsdQjiEM65nE/pIleldKy5NuAe06NAhmSmsWBPvKQ9nn5EPeRPB3FK MsXLvZF0IqpCFhAcr4su13J7gD88yZYYzJOj1jkCrwadAYmlVSgnr+2cL Q==; X-IronPort-AV: E=McAfee;i="6400,9594,10343"; a="257106033" X-IronPort-AV: E=Sophos;i="5.91,215,1647327600"; d="scan'208";a="257106033" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 May 2022 19:57:51 -0700 X-IronPort-AV: E=Sophos;i="5.91,215,1647327600"; d="scan'208";a="602754760" Received: from ukandhax-mobl3.gar.corp.intel.com (HELO anmitta2-mobl3.intel.com) ([10.214.163.3]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 May 2022 19:57:50 -0700 From: Anuj Mittal To: openembedded-core@lists.openembedded.org Subject: [honister][PATCH 08/17] install/devshell: Introduce git intercept script due to fakeroot issues Date: Wed, 11 May 2022 10:57:23 +0800 Message-Id: <262470f5c01c08826e0fcf3d08337d17952a257d.1652231471.git.anuj.mittal@intel.com> X-Mailer: git-send-email 2.35.3 In-Reply-To: References: MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Wed, 11 May 2022 02:57:58 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/165476 From: Paul Gortmaker In a devshell, recent versions of git will complain if the repo is owned by someone other than the current UID - consider this example: ------ bitbake -c devshell linux-yocto [...] kernel-source#git branch fatal: unsafe repository ('/home/paul/poky/build-qemuarm64/tmp/work-shared/qemuarm64/kernel-source' is owned by someone else) To add an exception for this directory, call: git config --global --add safe.directory /home/paul/poky/build-qemuarm64/tmp/work-shared/qemuarm64/kernel-source kernel-source# ------ Of course the devshell has UID zero and the "real" UID is for "paul" in this case. And so recent git versions complain. As the whole purpose of the devshell is to invoke a shell where development can take place, having a non-functional git is clearly unacceptable. Richard suggested we could use PSEUDO_UNLOAD=1 to evade this issue, and I suggested we probably will see other similar instances like this and should make use of PATH to intercept via devshell wrappers - conveniently we already have examples of this. Here, we copy the existing "ar" example and tune it to the needs of git to combine Richard's suggestion and mine. As such we now also can store commit logs and use send-email with our user specific settings, instead of "root", so in additon to fixing basic commands like "git branch" it should also increase general usefulness. RP: Tweaked the patch so the PATH change only applies to the devshell task and is a generic git intercept rather than devshell specific. RP: Also apply the PATH change to do_install tasks since that also runs under fakeroot and several software projects inject "git describe" output into their binaries (systemd, iputils, llvm, ipt-gpu-tools at least) causing reproducibility issues from systems with different git versions. Signed-off-by: Paul Gortmaker Signed-off-by: Richard Purdie (cherry picked from commit 3266c327dfa186791e0f1e2ad63c6f5d39714814) Signed-off-by: Anuj Mittal --- meta/classes/base.bbclass | 1 + meta/classes/devshell.bbclass | 2 ++ scripts/git-intercept/git | 19 +++++++++++++++++++ 3 files changed, 22 insertions(+) create mode 100755 scripts/git-intercept/git diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass index 070341d1aa..78cc8279dd 100644 --- a/meta/classes/base.bbclass +++ b/meta/classes/base.bbclass @@ -339,6 +339,7 @@ addtask install after do_compile do_install[dirs] = "${B}" # Remove and re-create ${D} so that is it guaranteed to be empty do_install[cleandirs] = "${D}" +PATH:prepend:task-install = "${COREBASE}/scripts/git-intercept:" base_do_install() { : diff --git a/meta/classes/devshell.bbclass b/meta/classes/devshell.bbclass index 76dd0b42ee..b6212ebd89 100644 --- a/meta/classes/devshell.bbclass +++ b/meta/classes/devshell.bbclass @@ -2,6 +2,8 @@ inherit terminal DEVSHELL = "${SHELL}" +PATH:prepend:task-devshell = "${COREBASE}/scripts/git-intercept:" + python do_devshell () { if d.getVarFlag("do_devshell", "manualfakeroot"): d.prependVar("DEVSHELL", "pseudo ") diff --git a/scripts/git-intercept/git b/scripts/git-intercept/git new file mode 100755 index 0000000000..8adf5c9ecb --- /dev/null +++ b/scripts/git-intercept/git @@ -0,0 +1,19 @@ +#!/usr/bin/env python3 +# +# Wrapper around 'git' that doesn't think we are root + +import os +import shutil +import sys + +os.environ['PSEUDO_UNLOAD'] = '1' + +# calculate path to the real 'git' +path = os.environ['PATH'] +path = path.replace(os.path.dirname(sys.argv[0]), '') +real_git = shutil.which('git', path=path) + +if len(sys.argv) == 1: + os.execl(real_git, 'git') + +os.execv(real_git, sys.argv) From patchwork Wed May 11 02:57:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Mittal, Anuj" X-Patchwork-Id: 7883 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 0F65FC43217 for ; Wed, 11 May 2022 02:57:58 +0000 (UTC) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mx.groups.io with SMTP id smtpd.web10.6480.1652237869110482622 for ; Tue, 10 May 2022 19:57:54 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=NzczHOZM; spf=pass (domain: intel.com, ip: 134.134.136.20, mailfrom: anuj.mittal@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1652237873; x=1683773873; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=oTZP2olZO0Gomobar/ieTbcVtZzo0uKcOGPDDqVTGpY=; b=NzczHOZMYY9wqby3mJ7vUbAfK1QCFvpjiQF7zZ7ob7EEFK7rh2KGwc1I v+mrt/lTySQnMY7piNbbMjBnsd5h0kvdHEudA5YMTB1OvzINA/pNz/ID9 XepAbyKrivrq8VoePxma5qroGXuaGWIxVqGN+Wop7HfWK5M5QMbN/Wf59 UK2BNnVtHY/s/LqkQpbOI/f7z7gtyMByBLoKga0BTADNkjX7V8qqP71C0 Rss49C3Is8vzUa1OtEuY+1d4w8aYBbslZ+8Jh9YiXi/J2gIZIXC5f21JA mVnCBCXJ5p0CckM4Twn5qF4Pnxl/KmX2Sxgw3Gft9kptI9lwC/gd2N/MD Q==; X-IronPort-AV: E=McAfee;i="6400,9594,10343"; a="257106036" X-IronPort-AV: E=Sophos;i="5.91,215,1647327600"; d="scan'208";a="257106036" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 May 2022 19:57:53 -0700 X-IronPort-AV: E=Sophos;i="5.91,215,1647327600"; d="scan'208";a="602754773" Received: from ukandhax-mobl3.gar.corp.intel.com (HELO anmitta2-mobl3.intel.com) ([10.214.163.3]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 May 2022 19:57:52 -0700 From: Anuj Mittal To: openembedded-core@lists.openembedded.org Subject: [honister][PATCH 09/17] base: Drop git intercept Date: Wed, 11 May 2022 10:57:24 +0800 Message-Id: <16686a05a6acc87725431b964ac6a0d1271d4716.1652231471.git.anuj.mittal@intel.com> X-Mailer: git-send-email 2.35.3 In-Reply-To: References: MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Wed, 11 May 2022 02:57:58 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/165477 From: Richard Purdie We're going to use the environment approach for solving this issue. Signed-off-by: Richard Purdie (cherry picked from commit 0982977dc052ad4e65608f6853f930121d08837a) Signed-off-by: Anuj Mittal --- meta/classes/base.bbclass | 1 - 1 file changed, 1 deletion(-) diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass index 78cc8279dd..070341d1aa 100644 --- a/meta/classes/base.bbclass +++ b/meta/classes/base.bbclass @@ -339,7 +339,6 @@ addtask install after do_compile do_install[dirs] = "${B}" # Remove and re-create ${D} so that is it guaranteed to be empty do_install[cleandirs] = "${D}" -PATH:prepend:task-install = "${COREBASE}/scripts/git-intercept:" base_do_install() { : From patchwork Wed May 11 02:57:25 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Mittal, Anuj" X-Patchwork-Id: 7887 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 1017DC4321E for ; Wed, 11 May 2022 02:57:58 +0000 (UTC) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mx.groups.io with SMTP id smtpd.web10.6480.1652237869110482622 for ; Tue, 10 May 2022 19:57:54 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=MM26K4xx; spf=pass (domain: intel.com, ip: 134.134.136.20, mailfrom: anuj.mittal@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1652237874; x=1683773874; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=lzjsAohWb8JWnaoxgldZBtNwd37JP96uPdbnkjtWD8Y=; b=MM26K4xxoPrWmyoMJimPhmk+LRBWRrNx9DCImDB7rl8krAYwgUUitvLX zG+2rKr+Nf9y5Wm9ET8/sCJuLdJHpwOUTBsZAmIxs5YMWhRS2vuye5I49 Cf/g7NQbz8nPNtpO7yaMxLb+oCV3/AWxT3ShwaC8uR5f9W2Z1Hx3tCD9g HG1NNLrzVYWyTpbtcjXcpQLE8pfsuTKXSlZuMYwcAAvwFf+Ip14iyoPWo c2UuTD82JLs4ejmcsCGCWE1x24Xovc9jbJD4+xNLc9JLsS/UAYxhn+0r2 TURAhNlxEvU6smQHwAusNDtzR1Wv+CcClGBz2ELYjd5QPwEdgs+bs5v14 Q==; X-IronPort-AV: E=McAfee;i="6400,9594,10343"; a="257106042" X-IronPort-AV: E=Sophos;i="5.91,215,1647327600"; d="scan'208";a="257106042" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 May 2022 19:57:54 -0700 X-IronPort-AV: E=Sophos;i="5.91,215,1647327600"; d="scan'208";a="602754791" Received: from ukandhax-mobl3.gar.corp.intel.com (HELO anmitta2-mobl3.intel.com) ([10.214.163.3]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 May 2022 19:57:53 -0700 From: Anuj Mittal To: openembedded-core@lists.openembedded.org Subject: [honister][PATCH 10/17] scripts: Make git intercept global Date: Wed, 11 May 2022 10:57:25 +0800 Message-Id: <2863b1237128906bccf7d2e9ecb739afb395fe4e.1652231471.git.anuj.mittal@intel.com> X-Mailer: git-send-email 2.35.3 In-Reply-To: References: MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Wed, 11 May 2022 02:57:58 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/165478 From: Richard Purdie The previous minimially invasive git intercept simply isn't enough. For example, meson used in the igt-gpu-tools recipe hardcodes the path to git in the configure step so at install time, changing PATH has no effect. There are lots of interesting things we could do to try and avoid problems but making the git intercept and dropping fakeroot privs for git global is probably the least worst solution at this point. It will add slight overhead to git calls but we don't make many so the overall impact is likely minimal. Signed-off-by: Richard Purdie (cherry picked from commit af27c81eaf68ee681dcd9456a74cca6a9ab40bf6) Signed-off-by: Anuj Mittal --- scripts/{git-intercept => }/git | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename scripts/{git-intercept => }/git (100%) diff --git a/scripts/git-intercept/git b/scripts/git similarity index 100% rename from scripts/git-intercept/git rename to scripts/git From patchwork Wed May 11 02:57:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Mittal, Anuj" X-Patchwork-Id: 7886 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 17299C43219 for ; Wed, 11 May 2022 02:57:58 +0000 (UTC) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mx.groups.io with SMTP id smtpd.web10.6480.1652237869110482622 for ; Tue, 10 May 2022 19:57:56 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=mEH66Bz0; spf=pass (domain: intel.com, ip: 134.134.136.20, mailfrom: anuj.mittal@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1652237876; x=1683773876; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=Yx2+cAkURNkKYf2lyHKcyti/NbY7mkO0wPf+BKWGxFQ=; b=mEH66Bz0azLygUyP9m5KzFOaq+PLnz3XwclCOK+ziecNrnLbYUkEJxfm ywG4Zn1jIHdt4d73S+VhmrYyN35sZbrFdL1OjEitw5+mYU6OWKMEOg88J Tv+JSNUzVmi41TNDR5NMa8Ouo3rArXoFCILAQhspLELD48l1xk8ttrYae QucBpy4re2Ga/QP2IyZwgzNhjNEeDEmUSfADIeDCKwkiq4o3KyPKvZW78 NKmBoZuuw1rychEXkz8Z8NcrWf+ZCLPTgHkkON2pzrr1XfUlyo2emdvVr lxEzUNKRyzuN/xeQtu+3PkUdytnKm7baIFUPQDeLXAl2+iZH25OjwyNny w==; X-IronPort-AV: E=McAfee;i="6400,9594,10343"; a="257106052" X-IronPort-AV: E=Sophos;i="5.91,215,1647327600"; d="scan'208";a="257106052" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 May 2022 19:57:56 -0700 X-IronPort-AV: E=Sophos;i="5.91,215,1647327600"; d="scan'208";a="602754799" Received: from ukandhax-mobl3.gar.corp.intel.com (HELO anmitta2-mobl3.intel.com) ([10.214.163.3]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 May 2022 19:57:54 -0700 From: Anuj Mittal To: openembedded-core@lists.openembedded.org Subject: [honister][PATCH 11/17] scripts/git: Ensure we don't have circular references Date: Wed, 11 May 2022 10:57:26 +0800 Message-Id: <8b1d8ba7e1b2e4278c9127654a66336d2615e58b.1652231471.git.anuj.mittal@intel.com> X-Mailer: git-send-email 2.35.3 In-Reply-To: References: MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Wed, 11 May 2022 02:57:58 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/165479 From: Richard Purdie This is horrible but I'm running out of better ideas. We hit circular reference issues which we were trying to avoid in the core HOSTTOOLS code. When building the eSDK, there can be two copies of the script. Therefore assume git will never be in a directory called scripts. This fixes eSDK build failures. Signed-off-by: Richard Purdie (cherry picked from commit 27de610ac30d4c81352efc794df7e9b1060f7a68) Signed-off-by: Anuj Mittal --- scripts/git | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/scripts/git b/scripts/git index 8adf5c9ecb..644055e540 100755 --- a/scripts/git +++ b/scripts/git @@ -10,7 +10,14 @@ os.environ['PSEUDO_UNLOAD'] = '1' # calculate path to the real 'git' path = os.environ['PATH'] -path = path.replace(os.path.dirname(sys.argv[0]), '') +# we need to remove our path but also any other copy of this script which +# may be present, e.g. eSDK. +replacements = [os.path.dirname(sys.argv[0])] +for p in path.split(":"): + if p.endswith("/scripts"): + replacements.append(p) +for r in replacements: + path = path.replace(r, '/ignoreme') real_git = shutil.which('git', path=path) if len(sys.argv) == 1: From patchwork Wed May 11 02:57:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Mittal, Anuj" X-Patchwork-Id: 14210 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org From: "Anuj Mittal" Subject: [honister][PATCH 12/17] lttng-modules: update to 2.13.1 Date: Wed, 11 May 2022 10:57:27 +0800 Message-Id: In-Reply-To: References: MIME-Version: 1.0 List-id: To: openembedded-core@lists.openembedded.org From: Bruce Ashfield Bumping lttng-modules to 2.13.1, which fixes the build against 5.16+ kernels. We drop two previously backported patches. The following commits are part of this update: 8c0aec7e Version 2.13.1 533556cd fix: mm: move kvmalloc-related functions to slab.h (v5.16) 2f0087ab fix: block: don't call blk_status_to_errno in blk_update_request (v5.16) 9b092ff2 fix: KVM: MMU: change tracepoints arguments to kvm_page_fault (v5.16) 036297af fix: KVM: x86: Get exit_reason as part of kvm_x86_ops.get_exit_info (v5.16) a029f2a3 fix: isystem: delete global -isystem compile option (v5.16) d82de6f3 fix: block: move block-related definitions out of fs.h (v5.16) 4fabf854 Fix: syscall tracing: missing trigger actions 38b35aff Warn on event registration/unregistration failure e26f740b fix: implicit-int error in EXPORT_SYMBOL_GPL c570be0d fix: Revert "Makefile: Enable -Wimplicit-fallthrough for Clang" (v5.15) 8be4c8a3 fix: cpu/hotplug: Remove deprecated CPU-hotplug functions. (v5.15) Signed-off-by: Bruce Ashfield Signed-off-by: Richard Purdie (cherry picked from commit 2edeebed4ff172f77e337af82fc1cddc681881df) Signed-off-by: Anuj Mittal --- ...Remove-deprecated-CPU-hotplug-functi.patch | 394 --------- ...ile-Enable-Wimplicit-fallthrough-for.patch | 829 ------------------ ...ules_2.13.0.bb => lttng-modules_2.13.1.bb} | 4 +- 3 files changed, 1 insertion(+), 1226 deletions(-) delete mode 100644 meta/recipes-kernel/lttng/lttng-modules/0001-fix-cpu-hotplug-Remove-deprecated-CPU-hotplug-functi.patch delete mode 100644 meta/recipes-kernel/lttng/lttng-modules/0002-fix-Revert-Makefile-Enable-Wimplicit-fallthrough-for.patch rename meta/recipes-kernel/lttng/{lttng-modules_2.13.0.bb => lttng-modules_2.13.1.bb} (86%) diff --git a/meta/recipes-kernel/lttng/lttng-modules/0001-fix-cpu-hotplug-Remove-deprecated-CPU-hotplug-functi.patch b/meta/recipes-kernel/lttng/lttng-modules/0001-fix-cpu-hotplug-Remove-deprecated-CPU-hotplug-functi.patch deleted file mode 100644 index 4e52e5f122..0000000000 --- a/meta/recipes-kernel/lttng/lttng-modules/0001-fix-cpu-hotplug-Remove-deprecated-CPU-hotplug-functi.patch +++ /dev/null @@ -1,394 +0,0 @@ -From 8be4c8a38ee1e297578e094a6e4c143ec5259aba Mon Sep 17 00:00:00 2001 -From: Michael Jeanson -Date: Mon, 13 Sep 2021 12:00:38 -0400 -Subject: [PATCH 1/2] fix: cpu/hotplug: Remove deprecated CPU-hotplug - functions. (v5.15) - -The CPU-hotplug functions get|put_online_cpus() were deprecated in v4.13 -and removed in v5.15. - -See upstream commits : - -commit 8c854303ce0e38e5bbedd725ff39da7e235865d8 -Author: Sebastian Andrzej Siewior -Date: Tue Aug 3 16:16:21 2021 +0200 - - cpu/hotplug: Remove deprecated CPU-hotplug functions. - - No users in tree use the deprecated CPU-hotplug functions anymore. - - Remove them. - -Introduced in v4.13 : - - commit 8f553c498e1772cccb39a114da4a498d22992758 - Author: Thomas Gleixner - Date: Wed May 24 10:15:12 2017 +0200 - - cpu/hotplug: Provide cpus_read|write_[un]lock() - - The counting 'rwsem' hackery of get|put_online_cpus() is going to be - replaced by percpu rwsem. - - Rename the functions to make it clear that it's locking and not some - refcount style interface. These new functions will be used for the - preparatory patches which make the code ready for the percpu rwsem - conversion. - - Rename all instances in the cpu hotplug code while at it. - -Upstream-Status: backport [https://git.lttng.org/?p=lttng-modules.git;a=commit;h=ffcc873470121ef1ebb110df3d9038a38d9cb7cb] - -Change-Id: I5a37cf5afc075a402b7347989fac637dfa60a1ed -Signed-off-by: Michael Jeanson -Signed-off-by: Mathieu Desnoyers ---- - include/wrapper/cpu.h | 44 +++++++++++++++++++++++ - src/lib/ringbuffer/ring_buffer_backend.c | 8 ++--- - src/lib/ringbuffer/ring_buffer_frontend.c | 17 ++++----- - src/lib/ringbuffer/ring_buffer_iterator.c | 15 ++++---- - src/lttng-context-perf-counters.c | 11 +++--- - src/lttng-statedump-impl.c | 6 ++-- - 6 files changed, 74 insertions(+), 27 deletions(-) - create mode 100644 include/wrapper/cpu.h - -diff --git a/include/wrapper/cpu.h b/include/wrapper/cpu.h -new file mode 100644 -index 00000000..cbee1962 ---- /dev/null -+++ b/include/wrapper/cpu.h -@@ -0,0 +1,44 @@ -+/* SPDX-License-Identifier: (GPL-2.0-only or LGPL-2.1-only) -+ * -+ * wrapper/cpu.h -+ * -+ * Copyright (C) 2021 Michael Jeanson -+ */ -+ -+#ifndef _LTTNG_WRAPPER_CPU_H -+#define _LTTNG_WRAPPER_CPU_H -+ -+#include -+#include -+ -+#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,13,0)) -+ -+static inline -+void lttng_cpus_read_lock(void) -+{ -+ cpus_read_lock(); -+} -+ -+static inline -+void lttng_cpus_read_unlock(void) -+{ -+ cpus_read_unlock(); -+} -+ -+#else /* LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,13,0) */ -+ -+static inline -+void lttng_cpus_read_lock(void) -+{ -+ get_online_cpus(); -+} -+ -+static inline -+void lttng_cpus_read_unlock(void) -+{ -+ put_online_cpus(); -+} -+ -+#endif /* LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,13,0) */ -+ -+#endif /* _LTTNG_WRAPPER_CPU_H */ -diff --git a/src/lib/ringbuffer/ring_buffer_backend.c b/src/lib/ringbuffer/ring_buffer_backend.c -index 26efb2bc..9a339be0 100644 ---- a/src/lib/ringbuffer/ring_buffer_backend.c -+++ b/src/lib/ringbuffer/ring_buffer_backend.c -@@ -12,10 +12,10 @@ - #include - #include - #include --#include - #include - #include - -+#include - #include - #include /* for wrapper_vmalloc_sync_mappings() */ - #include -@@ -445,14 +445,14 @@ int channel_backend_init(struct channel_backend *chanb, - chanb->cpu_hp_notifier.priority = 5; - register_hotcpu_notifier(&chanb->cpu_hp_notifier); - -- get_online_cpus(); -+ lttng_cpus_read_lock(); - for_each_online_cpu(i) { - ret = lib_ring_buffer_create(per_cpu_ptr(chanb->buf, i), - chanb, i); - if (ret) - goto free_bufs; /* cpu hotplug locked */ - } -- put_online_cpus(); -+ lttng_cpus_read_unlock(); - #else - for_each_possible_cpu(i) { - ret = lib_ring_buffer_create(per_cpu_ptr(chanb->buf, i), -@@ -485,7 +485,7 @@ free_bufs: - */ - #else /* #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,10,0)) */ - #ifdef CONFIG_HOTPLUG_CPU -- put_online_cpus(); -+ lttng_cpus_read_unlock(); - unregister_hotcpu_notifier(&chanb->cpu_hp_notifier); - #endif - #endif /* #else #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,10,0)) */ -diff --git a/src/lib/ringbuffer/ring_buffer_frontend.c b/src/lib/ringbuffer/ring_buffer_frontend.c -index e9056118..87a575d0 100644 ---- a/src/lib/ringbuffer/ring_buffer_frontend.c -+++ b/src/lib/ringbuffer/ring_buffer_frontend.c -@@ -48,6 +48,7 @@ - #include - #include - #include -+#include - #include - #include - #include -@@ -724,7 +725,7 @@ static void channel_unregister_notifiers(struct lttng_kernel_ring_buffer_channel - int cpu; - - #ifdef CONFIG_HOTPLUG_CPU -- get_online_cpus(); -+ lttng_cpus_read_lock(); - chan->cpu_hp_enable = 0; - for_each_online_cpu(cpu) { - struct lttng_kernel_ring_buffer *buf = per_cpu_ptr(chan->backend.buf, -@@ -732,7 +733,7 @@ static void channel_unregister_notifiers(struct lttng_kernel_ring_buffer_channel - lib_ring_buffer_stop_switch_timer(buf); - lib_ring_buffer_stop_read_timer(buf); - } -- put_online_cpus(); -+ lttng_cpus_read_unlock(); - unregister_cpu_notifier(&chan->cpu_hp_notifier); - #else - for_each_possible_cpu(cpu) { -@@ -772,14 +773,14 @@ void lib_ring_buffer_set_quiescent_channel(struct lttng_kernel_ring_buffer_chann - const struct lttng_kernel_ring_buffer_config *config = &chan->backend.config; - - if (config->alloc == RING_BUFFER_ALLOC_PER_CPU) { -- get_online_cpus(); -+ lttng_cpus_read_lock(); - for_each_channel_cpu(cpu, chan) { - struct lttng_kernel_ring_buffer *buf = per_cpu_ptr(chan->backend.buf, - cpu); - - lib_ring_buffer_set_quiescent(buf); - } -- put_online_cpus(); -+ lttng_cpus_read_unlock(); - } else { - struct lttng_kernel_ring_buffer *buf = chan->backend.buf; - -@@ -794,14 +795,14 @@ void lib_ring_buffer_clear_quiescent_channel(struct lttng_kernel_ring_buffer_cha - const struct lttng_kernel_ring_buffer_config *config = &chan->backend.config; - - if (config->alloc == RING_BUFFER_ALLOC_PER_CPU) { -- get_online_cpus(); -+ lttng_cpus_read_lock(); - for_each_channel_cpu(cpu, chan) { - struct lttng_kernel_ring_buffer *buf = per_cpu_ptr(chan->backend.buf, - cpu); - - lib_ring_buffer_clear_quiescent(buf); - } -- put_online_cpus(); -+ lttng_cpus_read_unlock(); - } else { - struct lttng_kernel_ring_buffer *buf = chan->backend.buf; - -@@ -899,7 +900,7 @@ struct lttng_kernel_ring_buffer_channel *channel_create(const struct lttng_kerne - chan->cpu_hp_notifier.priority = 6; - register_cpu_notifier(&chan->cpu_hp_notifier); - -- get_online_cpus(); -+ lttng_cpus_read_lock(); - for_each_online_cpu(cpu) { - struct lttng_kernel_ring_buffer *buf = per_cpu_ptr(chan->backend.buf, - cpu); -@@ -909,7 +910,7 @@ struct lttng_kernel_ring_buffer_channel *channel_create(const struct lttng_kerne - spin_unlock(&per_cpu(ring_buffer_nohz_lock, cpu)); - } - chan->cpu_hp_enable = 1; -- put_online_cpus(); -+ lttng_cpus_read_unlock(); - #else - for_each_possible_cpu(cpu) { - struct lttng_kernel_ring_buffer *buf = per_cpu_ptr(chan->backend.buf, -diff --git a/src/lib/ringbuffer/ring_buffer_iterator.c b/src/lib/ringbuffer/ring_buffer_iterator.c -index 25839af6..60c95ca6 100644 ---- a/src/lib/ringbuffer/ring_buffer_iterator.c -+++ b/src/lib/ringbuffer/ring_buffer_iterator.c -@@ -10,6 +10,7 @@ - */ - - #include -+#include - #include - #include - #include -@@ -440,13 +441,13 @@ int channel_iterator_init(struct lttng_kernel_ring_buffer_channel *chan) - chan->hp_iter_notifier.priority = 10; - register_cpu_notifier(&chan->hp_iter_notifier); - -- get_online_cpus(); -+ lttng_cpus_read_lock(); - for_each_online_cpu(cpu) { - buf = per_cpu_ptr(chan->backend.buf, cpu); - lib_ring_buffer_iterator_init(chan, buf); - } - chan->hp_iter_enable = 1; -- put_online_cpus(); -+ lttng_cpus_read_unlock(); - #else - for_each_possible_cpu(cpu) { - buf = per_cpu_ptr(chan->backend.buf, cpu); -@@ -519,7 +520,7 @@ int channel_iterator_open(struct lttng_kernel_ring_buffer_channel *chan) - CHAN_WARN_ON(chan, config->output != RING_BUFFER_ITERATOR); - - if (config->alloc == RING_BUFFER_ALLOC_PER_CPU) { -- get_online_cpus(); -+ lttng_cpus_read_lock(); - /* Allow CPU hotplug to keep track of opened reader */ - chan->iter.read_open = 1; - for_each_channel_cpu(cpu, chan) { -@@ -529,7 +530,7 @@ int channel_iterator_open(struct lttng_kernel_ring_buffer_channel *chan) - goto error; - buf->iter.read_open = 1; - } -- put_online_cpus(); -+ lttng_cpus_read_unlock(); - } else { - buf = channel_get_ring_buffer(config, chan, 0); - ret = lib_ring_buffer_iterator_open(buf); -@@ -538,7 +539,7 @@ int channel_iterator_open(struct lttng_kernel_ring_buffer_channel *chan) - error: - /* Error should always happen on CPU 0, hence no close is required. */ - CHAN_WARN_ON(chan, cpu != 0); -- put_online_cpus(); -+ lttng_cpus_read_unlock(); - return ret; - } - EXPORT_SYMBOL_GPL(channel_iterator_open); -@@ -550,7 +551,7 @@ void channel_iterator_release(struct lttng_kernel_ring_buffer_channel *chan) - int cpu; - - if (config->alloc == RING_BUFFER_ALLOC_PER_CPU) { -- get_online_cpus(); -+ lttng_cpus_read_lock(); - for_each_channel_cpu(cpu, chan) { - buf = channel_get_ring_buffer(config, chan, cpu); - if (buf->iter.read_open) { -@@ -559,7 +560,7 @@ void channel_iterator_release(struct lttng_kernel_ring_buffer_channel *chan) - } - } - chan->iter.read_open = 0; -- put_online_cpus(); -+ lttng_cpus_read_unlock(); - } else { - buf = channel_get_ring_buffer(config, chan, 0); - lib_ring_buffer_iterator_release(buf); -diff --git a/src/lttng-context-perf-counters.c b/src/lttng-context-perf-counters.c -index b0227d47..372f05e0 100644 ---- a/src/lttng-context-perf-counters.c -+++ b/src/lttng-context-perf-counters.c -@@ -16,6 +16,7 @@ - #include - #include - #include -+#include - #include - #include - #include -@@ -97,10 +98,10 @@ void lttng_destroy_perf_counter_ctx_field(void *priv) - { - int cpu; - -- get_online_cpus(); -+ lttng_cpus_read_lock(); - for_each_online_cpu(cpu) - perf_event_release_kernel(events[cpu]); -- put_online_cpus(); -+ lttng_cpus_read_unlock(); - #ifdef CONFIG_HOTPLUG_CPU - unregister_cpu_notifier(&perf_field->nb); - #endif -@@ -304,7 +305,7 @@ int lttng_add_perf_counter_to_ctx(uint32_t type, - perf_field->nb.priority = 0; - register_cpu_notifier(&perf_field->nb); - #endif -- get_online_cpus(); -+ lttng_cpus_read_lock(); - for_each_online_cpu(cpu) { - events[cpu] = wrapper_perf_event_create_kernel_counter(attr, - cpu, NULL, overflow_callback); -@@ -317,7 +318,7 @@ int lttng_add_perf_counter_to_ctx(uint32_t type, - goto counter_busy; - } - } -- put_online_cpus(); -+ lttng_cpus_read_unlock(); - perf_field->hp_enable = 1; - } - #endif /* #else #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,10,0)) */ -@@ -351,7 +352,7 @@ counter_error: - if (events[cpu] && !IS_ERR(events[cpu])) - perf_event_release_kernel(events[cpu]); - } -- put_online_cpus(); -+ lttng_cpus_read_unlock(); - #ifdef CONFIG_HOTPLUG_CPU - unregister_cpu_notifier(&perf_field->nb); - #endif -diff --git a/src/lttng-statedump-impl.c b/src/lttng-statedump-impl.c -index 4dfbca0b..2b42783a 100644 ---- a/src/lttng-statedump-impl.c -+++ b/src/lttng-statedump-impl.c -@@ -23,7 +23,6 @@ - #include - #include - #include --#include - #include - #include - #include -@@ -34,6 +33,7 @@ - - #include - #include -+#include - #include - #include - #include -@@ -770,7 +770,7 @@ int do_lttng_statedump(struct lttng_kernel_session *session) - * is to guarantee that each CPU has been in a state where is was in - * syscall mode (i.e. not in a trap, an IRQ or a soft IRQ). - */ -- get_online_cpus(); -+ lttng_cpus_read_lock(); - atomic_set(&kernel_threads_to_run, num_online_cpus()); - for_each_online_cpu(cpu) { - INIT_DELAYED_WORK(&cpu_work[cpu], lttng_statedump_work_func); -@@ -778,7 +778,7 @@ int do_lttng_statedump(struct lttng_kernel_session *session) - } - /* Wait for all threads to run */ - __wait_event(statedump_wq, (atomic_read(&kernel_threads_to_run) == 0)); -- put_online_cpus(); -+ lttng_cpus_read_unlock(); - /* Our work is done */ - trace_lttng_statedump_end(session); - return 0; --- -2.19.1 - diff --git a/meta/recipes-kernel/lttng/lttng-modules/0002-fix-Revert-Makefile-Enable-Wimplicit-fallthrough-for.patch b/meta/recipes-kernel/lttng/lttng-modules/0002-fix-Revert-Makefile-Enable-Wimplicit-fallthrough-for.patch deleted file mode 100644 index 5b5edc5319..0000000000 --- a/meta/recipes-kernel/lttng/lttng-modules/0002-fix-Revert-Makefile-Enable-Wimplicit-fallthrough-for.patch +++ /dev/null @@ -1,829 +0,0 @@ -From c570be0da77e963d77bac099d468bc0cd5f1bd63 Mon Sep 17 00:00:00 2001 -From: Michael Jeanson -Date: Mon, 13 Sep 2021 14:16:22 -0400 -Subject: [PATCH 2/2] fix: Revert "Makefile: Enable -Wimplicit-fallthrough for - Clang" (v5.15) -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Starting with v5.15, "-Wimplicit-fallthrough=5" was added to the build -flags which requires the use of "__attribute__((__fallthrough__))" to -annotate fallthrough case statements. - -See upstream commit by the man himself: - - commit d936eb23874433caa3e3d841cfa16f5434b85dcf - Author: Linus Torvalds - Date: Thu Jul 15 18:05:31 2021 -0700 - - Revert "Makefile: Enable -Wimplicit-fallthrough for Clang" - - This reverts commit b7eb335e26a9c7f258c96b3962c283c379d3ede0. - - It turns out that the problem with the clang -Wimplicit-fallthrough - warning is not about the kernel source code, but about clang itself, and - that the warning is unusable until clang fixes its broken ways. - - In particular, when you enable this warning for clang, you not only get - warnings about implicit fallthroughs. You also get this: - - warning: fallthrough annotation in unreachable code [-Wimplicit-fallthrough] - - which is completely broken becasue it - - (a) doesn't even tell you where the problem is (seriously: no line - numbers, no filename, no nothing). - - (b) is fundamentally broken anyway, because there are perfectly valid - reasons to have a fallthrough statement even if it turns out that - it can perhaps not be reached. - - In the kernel, an example of that second case is code in the scheduler: - - switch (state) { - case cpuset: - if (IS_ENABLED(CONFIG_CPUSETS)) { - cpuset_cpus_allowed_fallback(p); - state = possible; - break; - } - fallthrough; - case possible: - - where if CONFIG_CPUSETS is enabled you actually never hit the - fallthrough case at all. But that in no way makes the fallthrough - wrong. - - So the warning is completely broken, and enabling it for clang is a very - bad idea. - - In the meantime, we can keep the gcc option enabled, and make the gcc - build use - - -Wimplicit-fallthrough=5 - - which means that we will at least continue to require a proper - fallthrough statement, and that gcc won't silently accept the magic - comment versions. Because gcc does this all correctly, and while the odd - "=5" part is kind of obscure, it's documented in [1]: - - "-Wimplicit-fallthrough=5 doesn’t recognize any comments as - fallthrough comments, only attributes disable the warning" - - so if clang ever fixes its bad behavior we can try enabling it there again. - -Upstream-Status: backport [https://git.lttng.org/?p=lttng-modules.git;a=commit;h=c190d76e8c7b44d62b3651ab845b765c1b1f8104] - -Change-Id: Iea69849592fb69ac04fb9bb28efcd6b8dce8ba88 -Signed-off-by: Michael Jeanson -Signed-off-by: Mathieu Desnoyers ---- - include/counter/counter-api.h | 4 +- - include/lttng/events-internal.h | 11 ++- - include/wrapper/compiler_attributes.h | 34 +++++++ - src/lib/counter/counter.c | 13 ++- - src/lttng-abi.c | 91 ++++++++++++------ - src/lttng-bytecode-interpreter.c | 4 +- - src/lttng-bytecode-specialize.c | 5 +- - src/lttng-events.c | 129 +++++++++++++++++--------- - src/lttng-string-utils.c | 3 +- - src/probes/lttng-kretprobes.c | 7 +- - 10 files changed, 215 insertions(+), 86 deletions(-) - create mode 100644 include/wrapper/compiler_attributes.h - -diff --git a/include/counter/counter-api.h b/include/counter/counter-api.h -index fbc65818..c9f2b141 100644 ---- a/include/counter/counter-api.h -+++ b/include/counter/counter-api.h -@@ -15,6 +15,7 @@ - #include - #include - #include -+#include - #include - - /* -@@ -256,7 +257,8 @@ static __always_inline int lttng_counter_add(const struct lib_counter_config *co - const size_t *dimension_indexes, int64_t v) - { - switch (config->alloc) { -- case COUNTER_ALLOC_PER_CPU: /* Fallthrough */ -+ case COUNTER_ALLOC_PER_CPU: -+ lttng_fallthrough; - case COUNTER_ALLOC_PER_CPU | COUNTER_ALLOC_GLOBAL: - return __lttng_counter_add_percpu(config, counter, dimension_indexes, v); - case COUNTER_ALLOC_GLOBAL: -diff --git a/include/lttng/events-internal.h b/include/lttng/events-internal.h -index cd560de8..ca2190c4 100644 ---- a/include/lttng/events-internal.h -+++ b/include/lttng/events-internal.h -@@ -8,6 +8,8 @@ - #ifndef _LTTNG_EVENTS_INTERNAL_H - #define _LTTNG_EVENTS_INTERNAL_H - -+#include -+ - #include - - struct lttng_syscall_filter; -@@ -561,9 +563,12 @@ static inline bool lttng_kernel_type_is_bytewise_integer(const struct lttng_kern - if (!type_integer) - return false; - switch (type_integer->size) { -- case 8: /* Fall-through. */ -- case 16: /* Fall-through. */ -- case 32: /* Fall-through. */ -+ case 8: -+ lttng_fallthrough; -+ case 16: -+ lttng_fallthrough; -+ case 32: -+ lttng_fallthrough; - case 64: - break; - default: -diff --git a/include/wrapper/compiler_attributes.h b/include/wrapper/compiler_attributes.h -new file mode 100644 -index 00000000..c2c96e76 ---- /dev/null -+++ b/include/wrapper/compiler_attributes.h -@@ -0,0 +1,34 @@ -+/* SPDX-License-Identifier: (GPL-2.0-only or LGPL-2.1-only) -+ * -+ * wrapper/compiler_attributes.h -+ * -+ * Copyright (C) 2021 Michael Jeanson -+ */ -+ -+#ifndef _LTTNG_WRAPPER_COMPILER_ATTRIBUTES_H -+#define _LTTNG_WRAPPER_COMPILER_ATTRIBUTES_H -+ -+#include -+ -+#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,20,0)) -+#include -+#endif -+ -+#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,4,0)) -+ -+/* -+ * Use the kernel provided fallthrough attribute macro. -+ */ -+#define lttng_fallthrough fallthrough -+ -+#else /* LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,4,0) */ -+ -+/* -+ * Fallback to the comment for kernels pre 5.15 that don't build with -+ * '-Wimplicit-fallthrough=5'. -+ */ -+#define lttng_fallthrough do {} while (0) /* fallthrough */ -+ -+#endif /* LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,4,0) */ -+ -+#endif /* _LTTNG_WRAPPER_COMPILER_ATTRIBUTES_H */ -diff --git a/src/lib/counter/counter.c b/src/lib/counter/counter.c -index a4500a0e..bf038aac 100644 ---- a/src/lib/counter/counter.c -+++ b/src/lib/counter/counter.c -@@ -11,6 +11,7 @@ - #include - #include - #include -+#include - #include - #include - -@@ -324,7 +325,8 @@ int lttng_counter_aggregate(const struct lib_counter_config *config, - *underflow = false; - - switch (config->alloc) { -- case COUNTER_ALLOC_GLOBAL: /* Fallthrough */ -+ case COUNTER_ALLOC_GLOBAL: -+ lttng_fallthrough; - case COUNTER_ALLOC_PER_CPU | COUNTER_ALLOC_GLOBAL: - /* Read global counter. */ - ret = lttng_counter_read(config, counter, dimension_indexes, -@@ -342,7 +344,8 @@ int lttng_counter_aggregate(const struct lib_counter_config *config, - switch (config->alloc) { - case COUNTER_ALLOC_GLOBAL: - break; -- case COUNTER_ALLOC_PER_CPU | COUNTER_ALLOC_GLOBAL: /* Fallthrough */ -+ case COUNTER_ALLOC_PER_CPU | COUNTER_ALLOC_GLOBAL: -+ lttng_fallthrough; - case COUNTER_ALLOC_PER_CPU: - //TODO: integrate with CPU hotplug and online cpus - for (cpu = 0; cpu < num_possible_cpus(); cpu++) { -@@ -448,7 +451,8 @@ int lttng_counter_clear(const struct lib_counter_config *config, - int cpu, ret; - - switch (config->alloc) { -- case COUNTER_ALLOC_GLOBAL: /* Fallthrough */ -+ case COUNTER_ALLOC_GLOBAL: -+ lttng_fallthrough; - case COUNTER_ALLOC_PER_CPU | COUNTER_ALLOC_GLOBAL: - /* Clear global counter. */ - ret = lttng_counter_clear_cpu(config, counter, dimension_indexes, -1); -@@ -462,7 +466,8 @@ int lttng_counter_clear(const struct lib_counter_config *config, - switch (config->alloc) { - case COUNTER_ALLOC_GLOBAL: - break; -- case COUNTER_ALLOC_PER_CPU | COUNTER_ALLOC_GLOBAL: /* Fallthrough */ -+ case COUNTER_ALLOC_PER_CPU | COUNTER_ALLOC_GLOBAL: -+ lttng_fallthrough; - case COUNTER_ALLOC_PER_CPU: - //TODO: integrate with CPU hotplug and online cpus - for (cpu = 0; cpu < num_possible_cpus(); cpu++) { -diff --git a/src/lttng-abi.c b/src/lttng-abi.c -index cc453894..eac1afd1 100644 ---- a/src/lttng-abi.c -+++ b/src/lttng-abi.c -@@ -34,6 +34,7 @@ - #include - #include - #include -+#include - #include - #include - #include -@@ -1332,7 +1333,8 @@ long lttng_metadata_ring_buffer_ioctl(struct file *filp, - */ - return -ENOSYS; - } -- case LTTNG_KERNEL_ABI_RING_BUFFER_FLUSH_EMPTY: /* Fall-through. */ -+ case LTTNG_KERNEL_ABI_RING_BUFFER_FLUSH_EMPTY: -+ lttng_fallthrough; - case LTTNG_KERNEL_ABI_RING_BUFFER_FLUSH: - { - struct lttng_metadata_stream *stream = filp->private_data; -@@ -1441,7 +1443,8 @@ long lttng_metadata_ring_buffer_compat_ioctl(struct file *filp, - */ - return -ENOSYS; - } -- case LTTNG_KERNEL_ABI_RING_BUFFER_FLUSH_EMPTY: /* Fall-through. */ -+ case LTTNG_KERNEL_ABI_RING_BUFFER_FLUSH_EMPTY: -+ lttng_fallthrough; - case LTTNG_KERNEL_ABI_RING_BUFFER_FLUSH: - { - struct lttng_metadata_stream *stream = filp->private_data; -@@ -1758,8 +1761,10 @@ int lttng_abi_validate_event_param(struct lttng_kernel_abi_event *event_param) - switch (event_param->instrumentation) { - case LTTNG_KERNEL_ABI_SYSCALL: - switch (event_param->u.syscall.entryexit) { -- case LTTNG_KERNEL_ABI_SYSCALL_ENTRY: /* Fall-through */ -- case LTTNG_KERNEL_ABI_SYSCALL_EXIT: /* Fall-through */ -+ case LTTNG_KERNEL_ABI_SYSCALL_ENTRY: -+ lttng_fallthrough; -+ case LTTNG_KERNEL_ABI_SYSCALL_EXIT: -+ lttng_fallthrough; - case LTTNG_KERNEL_ABI_SYSCALL_ENTRYEXIT: - break; - default: -@@ -1783,20 +1788,26 @@ int lttng_abi_validate_event_param(struct lttng_kernel_abi_event *event_param) - switch (event_param->u.kretprobe.entryexit) { - case LTTNG_KERNEL_ABI_SYSCALL_ENTRYEXIT: - break; -- case LTTNG_KERNEL_ABI_SYSCALL_ENTRY: /* Fall-through */ -- case LTTNG_KERNEL_ABI_SYSCALL_EXIT: /* Fall-through */ -+ case LTTNG_KERNEL_ABI_SYSCALL_ENTRY: -+ lttng_fallthrough; -+ case LTTNG_KERNEL_ABI_SYSCALL_EXIT: -+ lttng_fallthrough; - default: - return -EINVAL; - } - break; - -- case LTTNG_KERNEL_ABI_TRACEPOINT: /* Fall-through */ -- case LTTNG_KERNEL_ABI_KPROBE: /* Fall-through */ -+ case LTTNG_KERNEL_ABI_TRACEPOINT: -+ lttng_fallthrough; -+ case LTTNG_KERNEL_ABI_KPROBE: -+ lttng_fallthrough; - case LTTNG_KERNEL_ABI_UPROBE: - break; - -- case LTTNG_KERNEL_ABI_FUNCTION: /* Fall-through */ -- case LTTNG_KERNEL_ABI_NOOP: /* Fall-through */ -+ case LTTNG_KERNEL_ABI_FUNCTION: -+ lttng_fallthrough; -+ case LTTNG_KERNEL_ABI_NOOP: -+ lttng_fallthrough; - default: - return -EINVAL; - } -@@ -1830,18 +1841,23 @@ int lttng_abi_create_event(struct file *channel_file, - } - - switch (event_param->instrumentation) { -- case LTTNG_KERNEL_ABI_TRACEPOINT: /* Fall-through */ -+ case LTTNG_KERNEL_ABI_TRACEPOINT: -+ lttng_fallthrough; - case LTTNG_KERNEL_ABI_SYSCALL: - fops = <tng_event_recorder_enabler_fops; - break; -- case LTTNG_KERNEL_ABI_KPROBE: /* Fall-through */ -- case LTTNG_KERNEL_ABI_KRETPROBE: /* Fall-through */ -+ case LTTNG_KERNEL_ABI_KPROBE: -+ lttng_fallthrough; -+ case LTTNG_KERNEL_ABI_KRETPROBE: -+ lttng_fallthrough; - case LTTNG_KERNEL_ABI_UPROBE: - fops = <tng_event_recorder_event_fops; - break; - -- case LTTNG_KERNEL_ABI_FUNCTION: /* Fall-through */ -- case LTTNG_KERNEL_ABI_NOOP: /* Fall-through */ -+ case LTTNG_KERNEL_ABI_FUNCTION: -+ lttng_fallthrough; -+ case LTTNG_KERNEL_ABI_NOOP: -+ lttng_fallthrough; - default: - return -EINVAL; - } -@@ -1867,7 +1883,8 @@ int lttng_abi_create_event(struct file *channel_file, - goto event_error; - - switch (event_param->instrumentation) { -- case LTTNG_KERNEL_ABI_TRACEPOINT: /* Fall-through */ -+ case LTTNG_KERNEL_ABI_TRACEPOINT: -+ lttng_fallthrough; - case LTTNG_KERNEL_ABI_SYSCALL: - { - struct lttng_event_enabler *event_enabler; -@@ -1887,8 +1904,10 @@ int lttng_abi_create_event(struct file *channel_file, - break; - } - -- case LTTNG_KERNEL_ABI_KPROBE: /* Fall-through */ -- case LTTNG_KERNEL_ABI_KRETPROBE: /* Fall-through */ -+ case LTTNG_KERNEL_ABI_KPROBE: -+ lttng_fallthrough; -+ case LTTNG_KERNEL_ABI_KRETPROBE: -+ lttng_fallthrough; - case LTTNG_KERNEL_ABI_UPROBE: - { - struct lttng_kernel_event_recorder *event; -@@ -1908,8 +1927,10 @@ int lttng_abi_create_event(struct file *channel_file, - break; - } - -- case LTTNG_KERNEL_ABI_FUNCTION: /* Fall-through */ -- case LTTNG_KERNEL_ABI_NOOP: /* Fall-through */ -+ case LTTNG_KERNEL_ABI_FUNCTION: -+ lttng_fallthrough; -+ case LTTNG_KERNEL_ABI_NOOP: -+ lttng_fallthrough; - default: - ret = -EINVAL; - goto event_error; -@@ -2043,18 +2064,23 @@ int lttng_abi_create_event_notifier(struct file *event_notifier_group_file, - } - - switch (event_notifier_param->event.instrumentation) { -- case LTTNG_KERNEL_ABI_TRACEPOINT: /* Fall-through */ -+ case LTTNG_KERNEL_ABI_TRACEPOINT: -+ lttng_fallthrough; - case LTTNG_KERNEL_ABI_SYSCALL: - fops = <tng_event_notifier_enabler_fops; - break; -- case LTTNG_KERNEL_ABI_KPROBE: /* Fall-through */ -- case LTTNG_KERNEL_ABI_KRETPROBE: /* Fall-through */ -+ case LTTNG_KERNEL_ABI_KPROBE: -+ lttng_fallthrough; -+ case LTTNG_KERNEL_ABI_KRETPROBE: -+ lttng_fallthrough; - case LTTNG_KERNEL_ABI_UPROBE: - fops = <tng_event_notifier_event_fops; - break; - -- case LTTNG_KERNEL_ABI_FUNCTION: /* Fall-through */ -- case LTTNG_KERNEL_ABI_NOOP: /* Fall-through */ -+ case LTTNG_KERNEL_ABI_FUNCTION: -+ lttng_fallthrough; -+ case LTTNG_KERNEL_ABI_NOOP: -+ lttng_fallthrough; - default: - ret = -EINVAL; - goto inval_instr; -@@ -2086,7 +2112,8 @@ int lttng_abi_create_event_notifier(struct file *event_notifier_group_file, - goto event_notifier_error; - - switch (event_notifier_param->event.instrumentation) { -- case LTTNG_KERNEL_ABI_TRACEPOINT: /* Fall-through */ -+ case LTTNG_KERNEL_ABI_TRACEPOINT: -+ lttng_fallthrough; - case LTTNG_KERNEL_ABI_SYSCALL: - { - struct lttng_event_notifier_enabler *enabler; -@@ -2110,8 +2137,10 @@ int lttng_abi_create_event_notifier(struct file *event_notifier_group_file, - break; - } - -- case LTTNG_KERNEL_ABI_KPROBE: /* Fall-through */ -- case LTTNG_KERNEL_ABI_KRETPROBE: /* Fall-through */ -+ case LTTNG_KERNEL_ABI_KPROBE: -+ lttng_fallthrough; -+ case LTTNG_KERNEL_ABI_KRETPROBE: -+ lttng_fallthrough; - case LTTNG_KERNEL_ABI_UPROBE: - { - struct lttng_kernel_event_notifier *event_notifier; -@@ -2135,8 +2164,10 @@ int lttng_abi_create_event_notifier(struct file *event_notifier_group_file, - break; - } - -- case LTTNG_KERNEL_ABI_FUNCTION: /* Fall-through */ -- case LTTNG_KERNEL_ABI_NOOP: /* Fall-through */ -+ case LTTNG_KERNEL_ABI_FUNCTION: -+ lttng_fallthrough; -+ case LTTNG_KERNEL_ABI_NOOP: -+ lttng_fallthrough; - default: - ret = -EINVAL; - goto event_notifier_error; -diff --git a/src/lttng-bytecode-interpreter.c b/src/lttng-bytecode-interpreter.c -index b46a23b7..a2a932c6 100644 ---- a/src/lttng-bytecode-interpreter.c -+++ b/src/lttng-bytecode-interpreter.c -@@ -7,6 +7,7 @@ - * Copyright (C) 2010-2016 Mathieu Desnoyers - */ - -+#include - #include - #include - #include -@@ -421,7 +422,8 @@ static int dynamic_get_index(struct lttng_kernel_probe_ctx *lttng_probe_ctx, - } - break; - case LOAD_ROOT_CONTEXT: -- case LOAD_ROOT_APP_CONTEXT: /* Fall-through */ -+ lttng_fallthrough; -+ case LOAD_ROOT_APP_CONTEXT: - { - ret = context_get_index(lttng_probe_ctx, - &stack_top->u.ptr, -diff --git a/src/lttng-bytecode-specialize.c b/src/lttng-bytecode-specialize.c -index c4b9d04b..f8b5f19d 100644 ---- a/src/lttng-bytecode-specialize.c -+++ b/src/lttng-bytecode-specialize.c -@@ -8,6 +8,8 @@ - */ - - #include -+#include -+ - #include - #include - #include -@@ -271,7 +273,8 @@ static int specialize_get_index(struct bytecode_runtime *runtime, - } - case OBJECT_TYPE_STRUCT: - /* Only generated by the specialize phase. */ -- case OBJECT_TYPE_VARIANT: /* Fall-through */ -+ case OBJECT_TYPE_VARIANT: -+ lttng_fallthrough; - default: - printk(KERN_WARNING "LTTng: bytecode: Unexpected get index type %d", - (int) stack_top->load.object_type); -diff --git a/src/lttng-events.c b/src/lttng-events.c -index e785fe4d..230e3934 100644 ---- a/src/lttng-events.c -+++ b/src/lttng-events.c -@@ -28,6 +28,7 @@ - #include - #include - -+#include - #include - #include /* for wrapper_vmalloc_sync_mappings() */ - #include -@@ -659,12 +660,14 @@ int lttng_event_enable(struct lttng_kernel_event_common *event) - goto end; - } - switch (event->priv->instrumentation) { -- case LTTNG_KERNEL_ABI_TRACEPOINT: /* Fall-through */ -+ case LTTNG_KERNEL_ABI_TRACEPOINT: -+ lttng_fallthrough; - case LTTNG_KERNEL_ABI_SYSCALL: - ret = -EINVAL; - break; - -- case LTTNG_KERNEL_ABI_KPROBE: /* Fall-through */ -+ case LTTNG_KERNEL_ABI_KPROBE: -+ lttng_fallthrough; - case LTTNG_KERNEL_ABI_UPROBE: - WRITE_ONCE(event->enabled, 1); - break; -@@ -673,8 +676,10 @@ int lttng_event_enable(struct lttng_kernel_event_common *event) - ret = lttng_kretprobes_event_enable_state(event, 1); - break; - -- case LTTNG_KERNEL_ABI_FUNCTION: /* Fall-through */ -- case LTTNG_KERNEL_ABI_NOOP: /* Fall-through */ -+ case LTTNG_KERNEL_ABI_FUNCTION: -+ lttng_fallthrough; -+ case LTTNG_KERNEL_ABI_NOOP: -+ lttng_fallthrough; - default: - WARN_ON_ONCE(1); - ret = -EINVAL; -@@ -719,12 +724,14 @@ int lttng_event_disable(struct lttng_kernel_event_common *event) - goto end; - } - switch (event->priv->instrumentation) { -- case LTTNG_KERNEL_ABI_TRACEPOINT: /* Fall-through */ -+ case LTTNG_KERNEL_ABI_TRACEPOINT: -+ lttng_fallthrough; - case LTTNG_KERNEL_ABI_SYSCALL: - ret = -EINVAL; - break; - -- case LTTNG_KERNEL_ABI_KPROBE: /* Fall-through */ -+ case LTTNG_KERNEL_ABI_KPROBE: -+ lttng_fallthrough; - case LTTNG_KERNEL_ABI_UPROBE: - WRITE_ONCE(event->enabled, 0); - break; -@@ -733,8 +740,10 @@ int lttng_event_disable(struct lttng_kernel_event_common *event) - ret = lttng_kretprobes_event_enable_state(event, 0); - break; - -- case LTTNG_KERNEL_ABI_FUNCTION: /* Fall-through */ -- case LTTNG_KERNEL_ABI_NOOP: /* Fall-through */ -+ case LTTNG_KERNEL_ABI_FUNCTION: -+ lttng_fallthrough; -+ case LTTNG_KERNEL_ABI_NOOP: -+ lttng_fallthrough; - default: - WARN_ON_ONCE(1); - ret = -EINVAL; -@@ -873,15 +882,20 @@ struct lttng_kernel_event_recorder *_lttng_kernel_event_recorder_create(struct l - event_name = event_desc->event_name; - break; - -- case LTTNG_KERNEL_ABI_KPROBE: /* Fall-through */ -- case LTTNG_KERNEL_ABI_UPROBE: /* Fall-through */ -- case LTTNG_KERNEL_ABI_KRETPROBE: /* Fall-through */ -+ case LTTNG_KERNEL_ABI_KPROBE: -+ lttng_fallthrough; -+ case LTTNG_KERNEL_ABI_UPROBE: -+ lttng_fallthrough; -+ case LTTNG_KERNEL_ABI_KRETPROBE: -+ lttng_fallthrough; - case LTTNG_KERNEL_ABI_SYSCALL: - event_name = event_param->name; - break; - -- case LTTNG_KERNEL_ABI_FUNCTION: /* Fall-through */ -- case LTTNG_KERNEL_ABI_NOOP: /* Fall-through */ -+ case LTTNG_KERNEL_ABI_FUNCTION: -+ lttng_fallthrough; -+ case LTTNG_KERNEL_ABI_NOOP: -+ lttng_fallthrough; - default: - WARN_ON_ONCE(1); - ret = -EINVAL; -@@ -1093,8 +1107,10 @@ struct lttng_kernel_event_recorder *_lttng_kernel_event_recorder_create(struct l - WARN_ON_ONCE(!ret); - break; - -- case LTTNG_KERNEL_ABI_FUNCTION: /* Fall-through */ -- case LTTNG_KERNEL_ABI_NOOP: /* Fall-through */ -+ case LTTNG_KERNEL_ABI_FUNCTION: -+ lttng_fallthrough; -+ case LTTNG_KERNEL_ABI_NOOP: -+ lttng_fallthrough; - default: - WARN_ON_ONCE(1); - ret = -EINVAL; -@@ -1141,15 +1157,20 @@ struct lttng_kernel_event_notifier *_lttng_event_notifier_create( - event_name = event_desc->event_name; - break; - -- case LTTNG_KERNEL_ABI_KPROBE: /* Fall-through */ -- case LTTNG_KERNEL_ABI_UPROBE: /* Fall-through */ -+ case LTTNG_KERNEL_ABI_KPROBE: -+ lttng_fallthrough; -+ case LTTNG_KERNEL_ABI_UPROBE: -+ lttng_fallthrough; - case LTTNG_KERNEL_ABI_SYSCALL: - event_name = event_notifier_param->event.name; - break; - -- case LTTNG_KERNEL_ABI_KRETPROBE: /* Fall-through */ -- case LTTNG_KERNEL_ABI_FUNCTION: /* Fall-through */ -- case LTTNG_KERNEL_ABI_NOOP: /* Fall-through */ -+ case LTTNG_KERNEL_ABI_KRETPROBE: -+ lttng_fallthrough; -+ case LTTNG_KERNEL_ABI_FUNCTION: -+ lttng_fallthrough; -+ case LTTNG_KERNEL_ABI_NOOP: -+ lttng_fallthrough; - default: - WARN_ON_ONCE(1); - ret = -EINVAL; -@@ -1296,9 +1317,12 @@ struct lttng_kernel_event_notifier *_lttng_event_notifier_create( - WARN_ON_ONCE(!ret); - break; - -- case LTTNG_KERNEL_ABI_KRETPROBE: /* Fall-through */ -- case LTTNG_KERNEL_ABI_FUNCTION: /* Fall-through */ -- case LTTNG_KERNEL_ABI_NOOP: /* Fall-through */ -+ case LTTNG_KERNEL_ABI_KRETPROBE: -+ lttng_fallthrough; -+ case LTTNG_KERNEL_ABI_FUNCTION: -+ lttng_fallthrough; -+ case LTTNG_KERNEL_ABI_NOOP: -+ lttng_fallthrough; - default: - WARN_ON_ONCE(1); - ret = -EINVAL; -@@ -1423,14 +1447,18 @@ void register_event(struct lttng_kernel_event_recorder *event_recorder) - ret = lttng_syscall_filter_enable_event(event_recorder->chan, event_recorder); - break; - -- case LTTNG_KERNEL_ABI_KPROBE: /* Fall-through */ -- case LTTNG_KERNEL_ABI_UPROBE: /* Fall-through */ -+ case LTTNG_KERNEL_ABI_KPROBE: -+ lttng_fallthrough; -+ case LTTNG_KERNEL_ABI_UPROBE: -+ lttng_fallthrough; - case LTTNG_KERNEL_ABI_KRETPROBE: - ret = 0; - break; - -- case LTTNG_KERNEL_ABI_FUNCTION: /* Fall-through */ -- case LTTNG_KERNEL_ABI_NOOP: /* Fall-through */ -+ case LTTNG_KERNEL_ABI_FUNCTION: -+ lttng_fallthrough; -+ case LTTNG_KERNEL_ABI_NOOP: -+ lttng_fallthrough; - default: - WARN_ON_ONCE(1); - } -@@ -1481,7 +1509,8 @@ int _lttng_event_unregister(struct lttng_kernel_event_recorder *event_recorder) - ret = 0; - break; - -- case LTTNG_KERNEL_ABI_FUNCTION: /* Fall-through */ -+ case LTTNG_KERNEL_ABI_FUNCTION: -+ lttng_fallthrough; - default: - WARN_ON_ONCE(1); - } -@@ -1512,14 +1541,18 @@ void register_event_notifier(struct lttng_kernel_event_notifier *event_notifier) - ret = lttng_syscall_filter_enable_event_notifier(event_notifier); - break; - -- case LTTNG_KERNEL_ABI_KPROBE: /* Fall-through */ -+ case LTTNG_KERNEL_ABI_KPROBE: -+ lttng_fallthrough; - case LTTNG_KERNEL_ABI_UPROBE: - ret = 0; - break; - -- case LTTNG_KERNEL_ABI_KRETPROBE: /* Fall-through */ -- case LTTNG_KERNEL_ABI_FUNCTION: /* Fall-through */ -- case LTTNG_KERNEL_ABI_NOOP: /* Fall-through */ -+ case LTTNG_KERNEL_ABI_KRETPROBE: -+ lttng_fallthrough; -+ case LTTNG_KERNEL_ABI_FUNCTION: -+ lttng_fallthrough; -+ case LTTNG_KERNEL_ABI_NOOP: -+ lttng_fallthrough; - default: - WARN_ON_ONCE(1); - } -@@ -1559,9 +1592,12 @@ int _lttng_event_notifier_unregister( - ret = lttng_syscall_filter_disable_event_notifier(event_notifier); - break; - -- case LTTNG_KERNEL_ABI_KRETPROBE: /* Fall-through */ -- case LTTNG_KERNEL_ABI_FUNCTION: /* Fall-through */ -- case LTTNG_KERNEL_ABI_NOOP: /* Fall-through */ -+ case LTTNG_KERNEL_ABI_KRETPROBE: -+ lttng_fallthrough; -+ case LTTNG_KERNEL_ABI_FUNCTION: -+ lttng_fallthrough; -+ case LTTNG_KERNEL_ABI_NOOP: -+ lttng_fallthrough; - default: - WARN_ON_ONCE(1); - } -@@ -1614,8 +1650,10 @@ void _lttng_event_destroy(struct lttng_kernel_event_common *event) - lttng_uprobes_destroy_event_private(event_recorder); - break; - -- case LTTNG_KERNEL_ABI_FUNCTION: /* Fall-through */ -- case LTTNG_KERNEL_ABI_NOOP: /* Fall-through */ -+ case LTTNG_KERNEL_ABI_FUNCTION: -+ lttng_fallthrough; -+ case LTTNG_KERNEL_ABI_NOOP: -+ lttng_fallthrough; - default: - WARN_ON_ONCE(1); - } -@@ -1647,9 +1685,12 @@ void _lttng_event_destroy(struct lttng_kernel_event_common *event) - lttng_uprobes_destroy_event_notifier_private(event_notifier); - break; - -- case LTTNG_KERNEL_ABI_KRETPROBE: /* Fall-through */ -- case LTTNG_KERNEL_ABI_FUNCTION: /* Fall-through */ -- case LTTNG_KERNEL_ABI_NOOP: /* Fall-through */ -+ case LTTNG_KERNEL_ABI_KRETPROBE: -+ lttng_fallthrough; -+ case LTTNG_KERNEL_ABI_FUNCTION: -+ lttng_fallthrough; -+ case LTTNG_KERNEL_ABI_NOOP: -+ lttng_fallthrough; - default: - WARN_ON_ONCE(1); - } -@@ -2713,7 +2754,8 @@ void lttng_session_sync_event_enablers(struct lttng_kernel_session *session) - int nr_filters = 0; - - switch (event_recorder_priv->parent.instrumentation) { -- case LTTNG_KERNEL_ABI_TRACEPOINT: /* Fall-through */ -+ case LTTNG_KERNEL_ABI_TRACEPOINT: -+ lttng_fallthrough; - case LTTNG_KERNEL_ABI_SYSCALL: - /* Enable events */ - list_for_each_entry(enabler_ref, -@@ -2807,7 +2849,8 @@ void lttng_event_notifier_group_sync_enablers(struct lttng_event_notifier_group - int nr_filters = 0, nr_captures = 0; - - switch (event_notifier_priv->parent.instrumentation) { -- case LTTNG_KERNEL_ABI_TRACEPOINT: /* Fall-through */ -+ case LTTNG_KERNEL_ABI_TRACEPOINT: -+ lttng_fallthrough; - case LTTNG_KERNEL_ABI_SYSCALL: - /* Enable event_notifiers */ - list_for_each_entry(enabler_ref, -@@ -3877,7 +3920,7 @@ int print_escaped_ctf_string(struct lttng_kernel_session *session, const char *s - if (ret) - goto error; - /* We still print the current char */ -- /* Fallthrough */ -+ lttng_fallthrough; - default: - ret = lttng_metadata_printf(session, "%c", cur); - break; -diff --git a/src/lttng-string-utils.c b/src/lttng-string-utils.c -index d9447903..65946193 100644 ---- a/src/lttng-string-utils.c -+++ b/src/lttng-string-utils.c -@@ -4,6 +4,7 @@ - */ - - #include -+#include - - #include - -@@ -302,7 +303,7 @@ retry: - p = pattern_get_char_at_cb(p_at, - pattern_get_char_at_cb_data); - -- /* Fall-through. */ -+ lttng_fallthrough; - default: - /* - * Default case which will compare the escaped -diff --git a/src/probes/lttng-kretprobes.c b/src/probes/lttng-kretprobes.c -index 0fa6a1bf..1d0a5ecb 100644 ---- a/src/probes/lttng-kretprobes.c -+++ b/src/probes/lttng-kretprobes.c -@@ -14,6 +14,7 @@ - #include - #include - #include -+#include - #include - #include - #include -@@ -61,7 +62,8 @@ int _lttng_kretprobes_handler(struct kretprobe_instance *krpi, - return 0; - break; - } -- case LTTNG_KERNEL_EVENT_TYPE_NOTIFIER: /* Fall-through. */ -+ case LTTNG_KERNEL_EVENT_TYPE_NOTIFIER: -+ lttng_fallthrough; - default: - WARN_ON_ONCE(1); - } -@@ -90,7 +92,8 @@ int _lttng_kretprobes_handler(struct kretprobe_instance *krpi, - chan->ops->event_commit(&ctx); - break; - } -- case LTTNG_KERNEL_EVENT_TYPE_NOTIFIER: /* Fall-through. */ -+ case LTTNG_KERNEL_EVENT_TYPE_NOTIFIER: -+ lttng_fallthrough; - default: - WARN_ON_ONCE(1); - } --- -2.19.1 - diff --git a/meta/recipes-kernel/lttng/lttng-modules_2.13.0.bb b/meta/recipes-kernel/lttng/lttng-modules_2.13.1.bb similarity index 86% rename from meta/recipes-kernel/lttng/lttng-modules_2.13.0.bb rename to meta/recipes-kernel/lttng/lttng-modules_2.13.1.bb index 6dfde8dcad..b05cad6be7 100644 --- a/meta/recipes-kernel/lttng/lttng-modules_2.13.0.bb +++ b/meta/recipes-kernel/lttng/lttng-modules_2.13.1.bb @@ -10,13 +10,11 @@ inherit module include lttng-platforms.inc SRC_URI = "https://lttng.org/files/${BPN}/${BPN}-${PV}.tar.bz2 \ - file://0001-fix-cpu-hotplug-Remove-deprecated-CPU-hotplug-functi.patch \ - file://0002-fix-Revert-Makefile-Enable-Wimplicit-fallthrough-for.patch \ " # Use :append here so that the patch is applied also when using devupstream SRC_URI:append = " file://0001-src-Kbuild-change-missing-CONFIG_TRACEPOINTS-to-warn.patch" -SRC_URI[sha256sum] = "5ebf2b3cd128b3a1c8afaea1e98d5a6f7f0676fd524fcf72361c34d9dc603356" +SRC_URI[sha256sum] = "a7c86d91c9bbe66d27f025aa04b8cfc6d7785ed2fc7ef774930800ee44d7f343" export INSTALL_MOD_DIR="kernel/lttng-modules" From patchwork Wed May 11 02:57:28 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Mittal, Anuj" X-Patchwork-Id: 7889 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 1C2F1C433EF for ; Wed, 11 May 2022 02:58:08 +0000 (UTC) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mx.groups.io with SMTP id smtpd.web10.6480.1652237869110482622 for ; Tue, 10 May 2022 19:58:01 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=NP07XLC6; spf=pass (domain: intel.com, ip: 134.134.136.20, mailfrom: anuj.mittal@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1652237881; x=1683773881; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=ZuTGvweLAG5NJDT11FJ4FwGoaqjFF+p9H33pRwtU3QA=; b=NP07XLC6w36Y2mWQc56C3jUO/p98XMrcunrz6Py7WqYA7EKaqS5SbfbJ mG2olnVqI/ncckm7hI0ly+/a6EHD9W9bkvOMVvGM0sknt50WETarKJPju pl5dsAGnBzEWdNNFBm+G3Mfg9OAAfkc+fsnYe0nCTlqAgZ5npXifkfpT4 bVerULUnDuFGQbt+IHy+hYn8ibmXzqJi7Lh1UBJE/qY/CA2pZo0k3Z3qo L0GZNzZF9jNtzbaGmCBgLP5tfVtHmIihpUzYy+0b1vNM3dh8l8kgrVQZE 3U/bQXtcTqs1hvR+0Go65kA9oykDaLBTcnrNBhinvqx7g6lCjWk1vLI+p Q==; X-IronPort-AV: E=McAfee;i="6400,9594,10343"; a="257106067" X-IronPort-AV: E=Sophos;i="5.91,215,1647327600"; d="scan'208";a="257106067" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 May 2022 19:58:01 -0700 X-IronPort-AV: E=Sophos;i="5.91,215,1647327600"; d="scan'208";a="602754833" Received: from ukandhax-mobl3.gar.corp.intel.com (HELO anmitta2-mobl3.intel.com) ([10.214.163.3]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 May 2022 19:58:00 -0700 From: Anuj Mittal To: openembedded-core@lists.openembedded.org Subject: [honister][PATCH 13/17] lttng-modules: upgrade 2.13.1 -> 2.13.2 Date: Wed, 11 May 2022 10:57:28 +0800 Message-Id: <8407ac82264475ade1f8ef7fbafd70f830a0376c.1652231471.git.anuj.mittal@intel.com> X-Mailer: git-send-email 2.35.3 In-Reply-To: References: MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Wed, 11 May 2022 02:58:08 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/165481 From: wangmy Changelog: ========= * Fix: incorrect in/out direction for syscall exit * fix: net: socket: rename SKB_DROP_REASON_SOCKET_FILTER (v5.17) * fix: net: skb: introduce kfree_skb_reason() (v5.17) * fix: random: rather than entropy_store abstraction, use global (v5.17) * fix: btrfs: pass fs_info to trace_btrfs_transaction_commit (v5.17) * fix: mm: compaction: fix the migration stats in trace_mm_compaction_migratepages() (v5.17) * fix: block: remove the ->rq_disk field in struct request (v5.17) * fix: block: remove GENHD_FL_SUPPRESS_PARTITION_INFO (v5.17) * Copyright ownership transfer Signed-off-by: Wang Mingyu Signed-off-by: Richard Purdie (cherry picked from commit 093d6dba95c03911d3d7e1b3b07ceff2c1de5563) Signed-off-by: Anuj Mittal --- .../{lttng-modules_2.13.1.bb => lttng-modules_2.13.2.bb} | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) rename meta/recipes-kernel/lttng/{lttng-modules_2.13.1.bb => lttng-modules_2.13.2.bb} (90%) diff --git a/meta/recipes-kernel/lttng/lttng-modules_2.13.1.bb b/meta/recipes-kernel/lttng/lttng-modules_2.13.2.bb similarity index 90% rename from meta/recipes-kernel/lttng/lttng-modules_2.13.1.bb rename to meta/recipes-kernel/lttng/lttng-modules_2.13.2.bb index b05cad6be7..b438d06c6c 100644 --- a/meta/recipes-kernel/lttng/lttng-modules_2.13.1.bb +++ b/meta/recipes-kernel/lttng/lttng-modules_2.13.2.bb @@ -9,12 +9,11 @@ inherit module include lttng-platforms.inc -SRC_URI = "https://lttng.org/files/${BPN}/${BPN}-${PV}.tar.bz2 \ - " +SRC_URI = "https://lttng.org/files/${BPN}/${BPN}-${PV}.tar.bz2" # Use :append here so that the patch is applied also when using devupstream SRC_URI:append = " file://0001-src-Kbuild-change-missing-CONFIG_TRACEPOINTS-to-warn.patch" -SRC_URI[sha256sum] = "a7c86d91c9bbe66d27f025aa04b8cfc6d7785ed2fc7ef774930800ee44d7f343" +SRC_URI[sha256sum] = "dfd547d9041c8c545ae5b7bfef3f0ef2d9f2520d6ab44188c9ea8de56d5d298a" export INSTALL_MOD_DIR="kernel/lttng-modules" From patchwork Wed May 11 02:57:29 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Mittal, Anuj" X-Patchwork-Id: 7888 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 19AEEC433F5 for ; Wed, 11 May 2022 02:58:08 +0000 (UTC) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mx.groups.io with SMTP id smtpd.web10.6480.1652237869110482622 for ; Tue, 10 May 2022 19:58:03 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=flHLI+J0; spf=pass (domain: intel.com, ip: 134.134.136.20, mailfrom: anuj.mittal@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1652237883; x=1683773883; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=/l4tA2aH6Iea+Q0sYYbYWJmfzNmPYFtsimNVwlQbB58=; b=flHLI+J0XOfkr54mGVc1/2HHg5Tncw/0t+Ic1k0LeR6D4FqY2z858VOU wvXZpNyL0lsI4yK6L9vWYHcw7PGIZNFRaTF6fZthxEyKcq0HndzQyTXeX IU1YVekiNmboa3sfW30Vs3e2opwnCjm/uHWIc1mgnbULl8k+SmmEvqYD8 tita8k0pI4NV8I5Qr8bryRpDvMtEL6a9mjnGiso/376IO85+AF3NUzN58 +P3+TkRIjMYgvfuGxlXEx8fE/N44hpusJxAhYD+2qn0cxe2pZuRDtVyn3 LEmmb13S2wf7cWzNA6mAvZ7v97YSu2NkBVy936o78jjNo2A8JIj/4jhbk A==; X-IronPort-AV: E=McAfee;i="6400,9594,10343"; a="257106071" X-IronPort-AV: E=Sophos;i="5.91,215,1647327600"; d="scan'208";a="257106071" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 May 2022 19:58:02 -0700 X-IronPort-AV: E=Sophos;i="5.91,215,1647327600"; d="scan'208";a="602754839" Received: from ukandhax-mobl3.gar.corp.intel.com (HELO anmitta2-mobl3.intel.com) ([10.214.163.3]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 May 2022 19:58:01 -0700 From: Anuj Mittal To: openembedded-core@lists.openembedded.org Subject: [honister][PATCH 14/17] lttng-modules: upgrade 2.13.2 -> 2.13.3 Date: Wed, 11 May 2022 10:57:29 +0800 Message-Id: <346d7e6acabbaac3563dbf4df51b425a228ead81.1652231471.git.anuj.mittal@intel.com> X-Mailer: git-send-email 2.35.3 In-Reply-To: References: MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Wed, 11 May 2022 02:58:08 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/165482 From: wangmy Signed-off-by: Wang Mingyu Signed-off-by: Alexandre Belloni Signed-off-by: Richard Purdie (cherry picked from commit f9b3727b9f4014a8b08c2ba9c03b8b5f96f01083) Signed-off-by: Anuj Mittal --- .../lttng/{lttng-modules_2.13.2.bb => lttng-modules_2.13.3.bb} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename meta/recipes-kernel/lttng/{lttng-modules_2.13.2.bb => lttng-modules_2.13.3.bb} (94%) diff --git a/meta/recipes-kernel/lttng/lttng-modules_2.13.2.bb b/meta/recipes-kernel/lttng/lttng-modules_2.13.3.bb similarity index 94% rename from meta/recipes-kernel/lttng/lttng-modules_2.13.2.bb rename to meta/recipes-kernel/lttng/lttng-modules_2.13.3.bb index b438d06c6c..a959ce9211 100644 --- a/meta/recipes-kernel/lttng/lttng-modules_2.13.2.bb +++ b/meta/recipes-kernel/lttng/lttng-modules_2.13.3.bb @@ -13,7 +13,7 @@ SRC_URI = "https://lttng.org/files/${BPN}/${BPN}-${PV}.tar.bz2" # Use :append here so that the patch is applied also when using devupstream SRC_URI:append = " file://0001-src-Kbuild-change-missing-CONFIG_TRACEPOINTS-to-warn.patch" -SRC_URI[sha256sum] = "dfd547d9041c8c545ae5b7bfef3f0ef2d9f2520d6ab44188c9ea8de56d5d298a" +SRC_URI[sha256sum] = "7cf1acbb50b84116acc9b4281b81dcc2643d6018bbd1e8514ad1270239896c4b" export INSTALL_MOD_DIR="kernel/lttng-modules" From patchwork Wed May 11 02:57:30 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Mittal, Anuj" X-Patchwork-Id: 7890 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 26EF8C433FE for ; Wed, 11 May 2022 02:58:08 +0000 (UTC) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mx.groups.io with SMTP id smtpd.web10.6480.1652237869110482622 for ; Tue, 10 May 2022 19:58:06 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=hDGs0hGC; spf=pass (domain: intel.com, ip: 134.134.136.20, mailfrom: anuj.mittal@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1652237886; x=1683773886; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=A1RzPSirdlyiDzYOa9g2fIQxy9cPdNfMIYf4j7er6wQ=; b=hDGs0hGCmgAWTFngst8hQMrbuZnkAoFVLQ6SCQd+uuBLUM0vywNJ7vYb LHrLdguIyMji5/kvX1iHRNQBVLl9g/Q4m+heJips9/osZF2iw0L+ZdWAa Fes7612fF8d9qTDwfw6is0MjzaMfIsoWPLJP5heiMm49MTt9ShO0khfsZ GKwsCIrg3XCCGpopXJIRmDwJO8w02csSRiYYH6DZ0ta2SXacOB0xge7HZ /kncNhlbD9YKBVHrcb8AHb+l8qMhN+RCdz9auDXUvW6heRQBZN+BJY4Q9 hcBJLGFF9dac7dJFb55F7y1mMdchIzycVqODTjzgUaAO1qH4rPmQs584f g==; X-IronPort-AV: E=McAfee;i="6400,9594,10343"; a="257106079" X-IronPort-AV: E=Sophos;i="5.91,215,1647327600"; d="scan'208";a="257106079" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 May 2022 19:58:05 -0700 X-IronPort-AV: E=Sophos;i="5.91,215,1647327600"; d="scan'208";a="602754853" Received: from ukandhax-mobl3.gar.corp.intel.com (HELO anmitta2-mobl3.intel.com) ([10.214.163.3]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 May 2022 19:58:03 -0700 From: Anuj Mittal To: openembedded-core@lists.openembedded.org Subject: [honister][PATCH 15/17] lttng-modules: support kernel 5.18+ Date: Wed, 11 May 2022 10:57:30 +0800 Message-Id: <99c3034acf03a3099d78523c33501e58703a13b7.1652231471.git.anuj.mittal@intel.com> X-Mailer: git-send-email 2.35.3 In-Reply-To: References: MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Wed, 11 May 2022 02:58:08 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/165483 From: Bruce Ashfield Backporting changes from lttng master to support building against the 5.18+ kernel. No changes required to the patches. Once a new -stable 2.13.x is released, we can drop these patches. To enable newer kernel development against the LTS, it is worth pulling these in while we wait for an upstream release. Signed-off-by: Bruce Ashfield Signed-off-by: Richard Purdie (cherry picked from commit 8a7237a47488442513741930ea55d69dd6bd7be4) Signed-off-by: Anuj Mittal --- ...x-compaction-migratepages-event-name.patch | 37 ++++ ...vent-allow-same-provider-and-event-n.patch | 48 +++++ ...g-Don-t-re-read-p-state-when-emittin.patch | 183 ++++++++++++++++++ .../0004-fix-block-remove-genhd.h-v5.18.patch | 45 +++++ ...emove-REQ_OP_WRITE_SAME-support-v5.1.patch | 79 ++++++++ ...ndom-remove-unused-tracepoints-v5.18.patch | 47 +++++ ...rethook-for-kretprobe-if-possible-v5.patch | 72 +++++++ ...ore-Remove-scsi-scsi_request.h-v5.18.patch | 44 +++++ .../0009-Rename-genhd-wrapper-to-blkdev.patch | 76 ++++++++ ...n-cleanup-the-compaction-trace-event.patch | 106 ++++++++++ .../lttng/lttng-modules_2.13.3.bb | 14 +- 11 files changed, 750 insertions(+), 1 deletion(-) create mode 100644 meta/recipes-kernel/lttng/lttng-modules/0001-Fix-compaction-migratepages-event-name.patch create mode 100644 meta/recipes-kernel/lttng/lttng-modules/0002-Fix-tracepoint-event-allow-same-provider-and-event-n.patch create mode 100644 meta/recipes-kernel/lttng/lttng-modules/0003-fix-sched-tracing-Don-t-re-read-p-state-when-emittin.patch create mode 100644 meta/recipes-kernel/lttng/lttng-modules/0004-fix-block-remove-genhd.h-v5.18.patch create mode 100644 meta/recipes-kernel/lttng/lttng-modules/0005-fix-scsi-block-Remove-REQ_OP_WRITE_SAME-support-v5.1.patch create mode 100644 meta/recipes-kernel/lttng/lttng-modules/0006-fix-random-remove-unused-tracepoints-v5.18.patch create mode 100644 meta/recipes-kernel/lttng/lttng-modules/0007-fix-kprobes-Use-rethook-for-kretprobe-if-possible-v5.patch create mode 100644 meta/recipes-kernel/lttng/lttng-modules/0008-fix-scsi-core-Remove-scsi-scsi_request.h-v5.18.patch create mode 100644 meta/recipes-kernel/lttng/lttng-modules/0009-Rename-genhd-wrapper-to-blkdev.patch create mode 100644 meta/recipes-kernel/lttng/lttng-modules/0010-fix-mm-compaction-cleanup-the-compaction-trace-event.patch diff --git a/meta/recipes-kernel/lttng/lttng-modules/0001-Fix-compaction-migratepages-event-name.patch b/meta/recipes-kernel/lttng/lttng-modules/0001-Fix-compaction-migratepages-event-name.patch new file mode 100644 index 0000000000..e988f7a3d5 --- /dev/null +++ b/meta/recipes-kernel/lttng/lttng-modules/0001-Fix-compaction-migratepages-event-name.patch @@ -0,0 +1,37 @@ +From c312bda00d2dc10ce5f6c1189acbefee5c6c8c6c Mon Sep 17 00:00:00 2001 +From: Mathieu Desnoyers +Date: Tue, 29 Mar 2022 16:34:07 -0400 +Subject: [PATCH 01/10] Fix: compaction migratepages event name + +The commit "fix: mm: compaction: fix the migration stats in trace_mm_compaction_migratepages() (v5.17)" + +Triggers this warning: + + LTTng: event provider mismatch: The event name needs to start with provider name + _ + one or more letter, provider: compaction, event name: mm_compaction_migratepages + +Upstream-Status: Backport + +Signed-off-by: Mathieu Desnoyers +Change-Id: I01c7485af765084dafb33bf33ae392e60bfbf1e7 +--- + include/instrumentation/events/compaction.h | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/include/instrumentation/events/compaction.h b/include/instrumentation/events/compaction.h +index 340e41f5..15964537 100644 +--- a/include/instrumentation/events/compaction.h ++++ b/include/instrumentation/events/compaction.h +@@ -98,7 +98,9 @@ LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(compaction_isolate_template, + #endif /* #else #if LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,0,0) */ + + #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,17,0)) +-LTTNG_TRACEPOINT_EVENT(mm_compaction_migratepages, ++LTTNG_TRACEPOINT_EVENT_MAP(mm_compaction_migratepages, ++ ++ compaction_migratepages, + + TP_PROTO(unsigned long nr_all, + unsigned int nr_succeeded), +-- +2.19.1 + diff --git a/meta/recipes-kernel/lttng/lttng-modules/0002-Fix-tracepoint-event-allow-same-provider-and-event-n.patch b/meta/recipes-kernel/lttng/lttng-modules/0002-Fix-tracepoint-event-allow-same-provider-and-event-n.patch new file mode 100644 index 0000000000..00367eebf8 --- /dev/null +++ b/meta/recipes-kernel/lttng/lttng-modules/0002-Fix-tracepoint-event-allow-same-provider-and-event-n.patch @@ -0,0 +1,48 @@ +From a7eb2e3d0a4beb1ee80b132927641dd05ef2d542 Mon Sep 17 00:00:00 2001 +From: Mathieu Desnoyers +Date: Mon, 4 Apr 2022 15:49:32 -0400 +Subject: [PATCH 02/10] Fix: tracepoint event: allow same provider and event + name + +Using the same name for the provider (TRACE_SYSTEM) and event name +causes a compilation error because the same identifiers are emitted +twice. + +Fix this by prefixing the provider identifier with +"__provider_event_desc___". + +Upstream-Status: Backport + +Signed-off-by: Mathieu Desnoyers +Change-Id: I8cdf8f859e35b8bd5c19737860d12f1ed546dfc2 +--- + include/lttng/tracepoint-event-impl.h | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/include/lttng/tracepoint-event-impl.h b/include/lttng/tracepoint-event-impl.h +index 38b1dc43..dcb22247 100644 +--- a/include/lttng/tracepoint-event-impl.h ++++ b/include/lttng/tracepoint-event-impl.h +@@ -1255,7 +1255,7 @@ static const struct lttng_kernel_event_desc __event_desc___##_map = { \ + #define TP_ID1(_token, _system) _token##_system + #define TP_ID(_token, _system) TP_ID1(_token, _system) + +-static const struct lttng_kernel_event_desc * const TP_ID(__event_desc___, TRACE_SYSTEM)[] = { ++static const struct lttng_kernel_event_desc * const TP_ID(__provider_event_desc___, TRACE_SYSTEM)[] = { + #include TRACE_INCLUDE(TRACE_INCLUDE_FILE) + }; + +@@ -1274,8 +1274,8 @@ static const struct lttng_kernel_event_desc * const TP_ID(__event_desc___, TRACE + /* non-const because list head will be modified when registered. */ + static __used struct lttng_kernel_probe_desc TP_ID(__probe_desc___, TRACE_SYSTEM) = { + .provider_name = __stringify(TRACE_SYSTEM), +- .event_desc = TP_ID(__event_desc___, TRACE_SYSTEM), +- .nr_events = ARRAY_SIZE(TP_ID(__event_desc___, TRACE_SYSTEM)), ++ .event_desc = TP_ID(__provider_event_desc___, TRACE_SYSTEM), ++ .nr_events = ARRAY_SIZE(TP_ID(__provider_event_desc___, TRACE_SYSTEM)), + .head = { NULL, NULL }, + .lazy_init_head = { NULL, NULL }, + .lazy = 0, +-- +2.19.1 + diff --git a/meta/recipes-kernel/lttng/lttng-modules/0003-fix-sched-tracing-Don-t-re-read-p-state-when-emittin.patch b/meta/recipes-kernel/lttng/lttng-modules/0003-fix-sched-tracing-Don-t-re-read-p-state-when-emittin.patch new file mode 100644 index 0000000000..afe514de82 --- /dev/null +++ b/meta/recipes-kernel/lttng/lttng-modules/0003-fix-sched-tracing-Don-t-re-read-p-state-when-emittin.patch @@ -0,0 +1,183 @@ +From 8e52fd71e693619f7a58de2692e59f0c826e9988 Mon Sep 17 00:00:00 2001 +From: Michael Jeanson +Date: Mon, 4 Apr 2022 13:52:57 -0400 +Subject: [PATCH 03/10] fix: sched/tracing: Don't re-read p->state when + emitting sched_switch event (v5.18) + +See upstream commit : + + commit fa2c3254d7cfff5f7a916ab928a562d1165f17bb + Author: Valentin Schneider + Date: Thu Jan 20 16:25:19 2022 +0000 + + sched/tracing: Don't re-read p->state when emitting sched_switch event + + As of commit + + c6e7bd7afaeb ("sched/core: Optimize ttwu() spinning on p->on_cpu") + + the following sequence becomes possible: + + p->__state = TASK_INTERRUPTIBLE; + __schedule() + deactivate_task(p); + ttwu() + READ !p->on_rq + p->__state=TASK_WAKING + trace_sched_switch() + __trace_sched_switch_state() + task_state_index() + return 0; + + TASK_WAKING isn't in TASK_REPORT, so the task appears as TASK_RUNNING in + the trace event. + + Prevent this by pushing the value read from __schedule() down the trace + event. + +Upstream-Status: Backport + +Change-Id: I46743cd006be4b4d573cae2d77df7d6d16744d04 +Signed-off-by: Michael Jeanson +Signed-off-by: Mathieu Desnoyers +--- + include/instrumentation/events/sched.h | 88 +++++++++++++++++++++++--- + 1 file changed, 78 insertions(+), 10 deletions(-) + +diff --git a/include/instrumentation/events/sched.h b/include/instrumentation/events/sched.h +index 91953a6f..339bec94 100644 +--- a/include/instrumentation/events/sched.h ++++ b/include/instrumentation/events/sched.h +@@ -20,7 +20,37 @@ + #ifndef _TRACE_SCHED_DEF_ + #define _TRACE_SCHED_DEF_ + +-#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,15,0)) ++#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,18,0)) ++ ++static inline long __trace_sched_switch_state(bool preempt, ++ unsigned int prev_state, ++ struct task_struct *p) ++{ ++ unsigned int state; ++ ++#ifdef CONFIG_SCHED_DEBUG ++ BUG_ON(p != current); ++#endif /* CONFIG_SCHED_DEBUG */ ++ ++ /* ++ * Preemption ignores task state, therefore preempted tasks are always ++ * RUNNING (we will not have dequeued if state != RUNNING). ++ */ ++ if (preempt) ++ return TASK_REPORT_MAX; ++ ++ /* ++ * task_state_index() uses fls() and returns a value from 0-8 range. ++ * Decrement it by 1 (except TASK_RUNNING state i.e 0) before using ++ * it for left shift operation to get the correct task->state ++ * mapping. ++ */ ++ state = __task_state_index(prev_state, p->exit_state); ++ ++ return state ? (1 << (state - 1)) : state; ++} ++ ++#elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,15,0)) + + static inline long __trace_sched_switch_state(bool preempt, struct task_struct *p) + { +@@ -321,43 +351,81 @@ LTTNG_TRACEPOINT_EVENT_INSTANCE(sched_wakeup_template, sched_wakeup_new, + /* + * Tracepoint for task switches, performed by the scheduler: + */ ++ ++#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,18,0)) + LTTNG_TRACEPOINT_EVENT(sched_switch, + +-#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,4,0)) + TP_PROTO(bool preempt, +- struct task_struct *prev, +- struct task_struct *next), ++ unsigned int prev_state, ++ struct task_struct *prev, ++ struct task_struct *next), + +- TP_ARGS(preempt, prev, next), ++ TP_ARGS(preempt, prev_state, prev, next), ++ ++ TP_FIELDS( ++ ctf_array_text(char, prev_comm, prev->comm, TASK_COMM_LEN) ++ ctf_integer(pid_t, prev_tid, prev->pid) ++ ctf_integer(int, prev_prio, prev->prio - MAX_RT_PRIO) ++#ifdef CONFIG_LTTNG_EXPERIMENTAL_BITWISE_ENUM ++ ctf_enum(task_state, long, prev_state, __trace_sched_switch_state(preempt, prev_state, prev)) + #else +- TP_PROTO(struct task_struct *prev, ++ ctf_integer(long, prev_state, __trace_sched_switch_state(preempt, prev_state, prev)) ++#endif ++ ctf_array_text(char, next_comm, next->comm, TASK_COMM_LEN) ++ ctf_integer(pid_t, next_tid, next->pid) ++ ctf_integer(int, next_prio, next->prio - MAX_RT_PRIO) ++ ) ++) ++ ++#elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,4,0)) ++ ++LTTNG_TRACEPOINT_EVENT(sched_switch, ++ ++ TP_PROTO(bool preempt, ++ struct task_struct *prev, + struct task_struct *next), + +- TP_ARGS(prev, next), +-#endif /* #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,4,0)) */ ++ TP_ARGS(preempt, prev, next), + + TP_FIELDS( + ctf_array_text(char, prev_comm, prev->comm, TASK_COMM_LEN) + ctf_integer(pid_t, prev_tid, prev->pid) + ctf_integer(int, prev_prio, prev->prio - MAX_RT_PRIO) +-#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,4,0)) + #ifdef CONFIG_LTTNG_EXPERIMENTAL_BITWISE_ENUM + ctf_enum(task_state, long, prev_state, __trace_sched_switch_state(preempt, prev)) + #else + ctf_integer(long, prev_state, __trace_sched_switch_state(preempt, prev)) + #endif ++ ctf_array_text(char, next_comm, next->comm, TASK_COMM_LEN) ++ ctf_integer(pid_t, next_tid, next->pid) ++ ctf_integer(int, next_prio, next->prio - MAX_RT_PRIO) ++ ) ++) ++ + #else ++ ++LTTNG_TRACEPOINT_EVENT(sched_switch, ++ ++ TP_PROTO(struct task_struct *prev, ++ struct task_struct *next), ++ ++ TP_ARGS(prev, next), ++ ++ TP_FIELDS( ++ ctf_array_text(char, prev_comm, prev->comm, TASK_COMM_LEN) ++ ctf_integer(pid_t, prev_tid, prev->pid) ++ ctf_integer(int, prev_prio, prev->prio - MAX_RT_PRIO) + #ifdef CONFIG_LTTNG_EXPERIMENTAL_BITWISE_ENUM + ctf_enum(task_state, long, prev_state, __trace_sched_switch_state(prev)) + #else + ctf_integer(long, prev_state, __trace_sched_switch_state(prev)) +-#endif + #endif + ctf_array_text(char, next_comm, next->comm, TASK_COMM_LEN) + ctf_integer(pid_t, next_tid, next->pid) + ctf_integer(int, next_prio, next->prio - MAX_RT_PRIO) + ) + ) ++#endif + + /* + * Tracepoint for a task being migrated: +-- +2.19.1 + diff --git a/meta/recipes-kernel/lttng/lttng-modules/0004-fix-block-remove-genhd.h-v5.18.patch b/meta/recipes-kernel/lttng/lttng-modules/0004-fix-block-remove-genhd.h-v5.18.patch new file mode 100644 index 0000000000..9248ffe4ff --- /dev/null +++ b/meta/recipes-kernel/lttng/lttng-modules/0004-fix-block-remove-genhd.h-v5.18.patch @@ -0,0 +1,45 @@ +From 868e0b6db59159197c2cec3550fa4ad5e6572bc5 Mon Sep 17 00:00:00 2001 +From: Michael Jeanson +Date: Mon, 4 Apr 2022 13:54:59 -0400 +Subject: [PATCH 04/10] fix: block: remove genhd.h (v5.18) + +See upstream commit : + + commit 322cbb50de711814c42fb088f6d31901502c711a + Author: Christoph Hellwig + Date: Mon Jan 24 10:39:13 2022 +0100 + + block: remove genhd.h + + There is no good reason to keep genhd.h separate from the main blkdev.h + header that includes it. So fold the contents of genhd.h into blkdev.h + and remove genhd.h entirely. + +Upstream-Status: Backport + +Change-Id: I7cf2aaa3a4c133320b95f2edde49f790f9515dbd +Signed-off-by: Michael Jeanson +Signed-off-by: Mathieu Desnoyers +--- + include/wrapper/genhd.h | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/include/wrapper/genhd.h b/include/wrapper/genhd.h +index 3c6dbcbe..4a59b68e 100644 +--- a/include/wrapper/genhd.h ++++ b/include/wrapper/genhd.h +@@ -12,7 +12,11 @@ + #ifndef _LTTNG_WRAPPER_GENHD_H + #define _LTTNG_WRAPPER_GENHD_H + ++#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,18,0)) ++#include ++#else + #include ++#endif + + #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,17,0)) + #define LTTNG_GENHD_FL_HIDDEN GENHD_FL_HIDDEN +-- +2.19.1 + diff --git a/meta/recipes-kernel/lttng/lttng-modules/0005-fix-scsi-block-Remove-REQ_OP_WRITE_SAME-support-v5.1.patch b/meta/recipes-kernel/lttng/lttng-modules/0005-fix-scsi-block-Remove-REQ_OP_WRITE_SAME-support-v5.1.patch new file mode 100644 index 0000000000..0751827613 --- /dev/null +++ b/meta/recipes-kernel/lttng/lttng-modules/0005-fix-scsi-block-Remove-REQ_OP_WRITE_SAME-support-v5.1.patch @@ -0,0 +1,79 @@ +From 2bc7cb7193124d20aa4e1b5dbad0410bfb97a470 Mon Sep 17 00:00:00 2001 +From: Michael Jeanson +Date: Mon, 4 Apr 2022 14:12:13 -0400 +Subject: [PATCH 05/10] fix: scsi: block: Remove REQ_OP_WRITE_SAME support + (v5.18) + +See upstream commit : + + commit 73bd66d9c834220579c881a3eb020fd8917075d8 + Author: Christoph Hellwig + Date: Wed Feb 9 09:28:28 2022 +0100 + + scsi: block: Remove REQ_OP_WRITE_SAME support + + No more users of REQ_OP_WRITE_SAME or drivers implementing it are left, + so remove the infrastructure. + +Upstream-Status: Backport + +Change-Id: Ifbff71f79f8b590436fc7cb79f82d90c6e033d84 +Signed-off-by: Michael Jeanson +Signed-off-by: Mathieu Desnoyers +--- + include/instrumentation/events/block.h | 32 ++++++++++++++++++++++++++ + 1 file changed, 32 insertions(+) + +diff --git a/include/instrumentation/events/block.h b/include/instrumentation/events/block.h +index 3e1104d7..050a59a2 100644 +--- a/include/instrumentation/events/block.h ++++ b/include/instrumentation/events/block.h +@@ -66,6 +66,37 @@ LTTNG_TRACEPOINT_ENUM(block_rq_type, + #define lttng_bio_op(bio) bio_op(bio) + #define lttng_bio_rw(bio) ((bio)->bi_opf) + ++#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,18,0)) ++#ifdef CONFIG_LTTNG_EXPERIMENTAL_BITWISE_ENUM ++#define blk_rwbs_ctf_integer(type, rwbs, op, rw, bytes) \ ++ ctf_enum(block_rq_type, type, rwbs, \ ++ ( (op) == REQ_OP_WRITE ? RWBS_FLAG_WRITE : \ ++ ( (op) == REQ_OP_DISCARD ? RWBS_FLAG_DISCARD : \ ++ ( (op) == REQ_OP_SECURE_ERASE ? (RWBS_FLAG_DISCARD | RWBS_FLAG_SECURE) : \ ++ ( (op) == REQ_OP_FLUSH ? RWBS_FLAG_FLUSH : \ ++ ( (op) == REQ_OP_READ ? RWBS_FLAG_READ : \ ++ ( 0 )))))) \ ++ | ((rw) & REQ_RAHEAD ? RWBS_FLAG_RAHEAD : 0) \ ++ | ((rw) & REQ_SYNC ? RWBS_FLAG_SYNC : 0) \ ++ | ((rw) & REQ_META ? RWBS_FLAG_META : 0) \ ++ | ((rw) & REQ_PREFLUSH ? RWBS_FLAG_PREFLUSH : 0) \ ++ | ((rw) & REQ_FUA ? RWBS_FLAG_FUA : 0)) ++#else ++#define blk_rwbs_ctf_integer(type, rwbs, op, rw, bytes) \ ++ ctf_integer(type, rwbs, \ ++ ( (op) == REQ_OP_WRITE ? RWBS_FLAG_WRITE : \ ++ ( (op) == REQ_OP_DISCARD ? RWBS_FLAG_DISCARD : \ ++ ( (op) == REQ_OP_SECURE_ERASE ? (RWBS_FLAG_DISCARD | RWBS_FLAG_SECURE) : \ ++ ( (op) == REQ_OP_FLUSH ? RWBS_FLAG_FLUSH : \ ++ ( (op) == REQ_OP_READ ? RWBS_FLAG_READ : \ ++ ( 0 )))))) \ ++ | ((rw) & REQ_RAHEAD ? RWBS_FLAG_RAHEAD : 0) \ ++ | ((rw) & REQ_SYNC ? RWBS_FLAG_SYNC : 0) \ ++ | ((rw) & REQ_META ? RWBS_FLAG_META : 0) \ ++ | ((rw) & REQ_PREFLUSH ? RWBS_FLAG_PREFLUSH : 0) \ ++ | ((rw) & REQ_FUA ? RWBS_FLAG_FUA : 0)) ++#endif /* CONFIG_LTTNG_EXPERIMENTAL_BITWISE_ENUM */ ++#else + #ifdef CONFIG_LTTNG_EXPERIMENTAL_BITWISE_ENUM + #define blk_rwbs_ctf_integer(type, rwbs, op, rw, bytes) \ + ctf_enum(block_rq_type, type, rwbs, \ +@@ -95,6 +126,7 @@ LTTNG_TRACEPOINT_ENUM(block_rq_type, + | ((rw) & REQ_PREFLUSH ? RWBS_FLAG_PREFLUSH : 0) \ + | ((rw) & REQ_FUA ? RWBS_FLAG_FUA : 0)) + #endif /* CONFIG_LTTNG_EXPERIMENTAL_BITWISE_ENUM */ ++#endif + + #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,1,0)) + +-- +2.19.1 + diff --git a/meta/recipes-kernel/lttng/lttng-modules/0006-fix-random-remove-unused-tracepoints-v5.18.patch b/meta/recipes-kernel/lttng/lttng-modules/0006-fix-random-remove-unused-tracepoints-v5.18.patch new file mode 100644 index 0000000000..9c2f70d4af --- /dev/null +++ b/meta/recipes-kernel/lttng/lttng-modules/0006-fix-random-remove-unused-tracepoints-v5.18.patch @@ -0,0 +1,47 @@ +From 369d82bb1746447514c877088d7c5fd0f39140f8 Mon Sep 17 00:00:00 2001 +From: Michael Jeanson +Date: Mon, 4 Apr 2022 14:33:42 -0400 +Subject: [PATCH 06/10] fix: random: remove unused tracepoints (v5.18) + +See upstream commit : + + commit 14c174633f349cb41ea90c2c0aaddac157012f74 + Author: Jason A. Donenfeld + Date: Thu Feb 10 16:40:44 2022 +0100 + + random: remove unused tracepoints + + These explicit tracepoints aren't really used and show sign of aging. + It's work to keep these up to date, and before I attempted to keep them + up to date, they weren't up to date, which indicates that they're not + really used. These days there are better ways of introspecting anyway. + +Upstream-Status: Backport + +Change-Id: I3b8c3e2732e7efdd76ce63204ac53a48784d0df6 +Signed-off-by: Michael Jeanson +Signed-off-by: Mathieu Desnoyers +--- + src/probes/Kbuild | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/src/probes/Kbuild b/src/probes/Kbuild +index e26b4359..8d6ff0f2 100644 +--- a/src/probes/Kbuild ++++ b/src/probes/Kbuild +@@ -187,8 +187,11 @@ ifneq ($(CONFIG_FRAME_WARN),0) + CFLAGS_lttng-probe-printk.o += -Wframe-larger-than=2200 + endif + ++# Introduced in v3.6, remove in v5.18 + obj-$(CONFIG_LTTNG) += $(shell \ +- if [ $(VERSION) -ge 4 \ ++ if [ \( ! \( $(VERSION) -ge 6 -o \( $(VERSION) -eq 5 -a $(PATCHLEVEL) -ge 18 \) \) \) \ ++ -a \ ++ $(VERSION) -ge 4 \ + -o \( $(VERSION) -eq 3 -a $(PATCHLEVEL) -ge 6 \) \ + -o \( $(VERSION) -eq 3 -a $(PATCHLEVEL) -eq 5 -a $(SUBLEVEL) -ge 2 \) \ + -o \( $(VERSION) -eq 3 -a $(PATCHLEVEL) -eq 4 -a $(SUBLEVEL) -ge 9 \) \ +-- +2.19.1 + diff --git a/meta/recipes-kernel/lttng/lttng-modules/0007-fix-kprobes-Use-rethook-for-kretprobe-if-possible-v5.patch b/meta/recipes-kernel/lttng/lttng-modules/0007-fix-kprobes-Use-rethook-for-kretprobe-if-possible-v5.patch new file mode 100644 index 0000000000..effd37ffe1 --- /dev/null +++ b/meta/recipes-kernel/lttng/lttng-modules/0007-fix-kprobes-Use-rethook-for-kretprobe-if-possible-v5.patch @@ -0,0 +1,72 @@ +From 3c46ddc134621dba65030263aa321dd6bdae3ba3 Mon Sep 17 00:00:00 2001 +From: Michael Jeanson +Date: Mon, 4 Apr 2022 15:02:10 -0400 +Subject: [PATCH 07/10] fix: kprobes: Use rethook for kretprobe if possible + (v5.18) + +See upstream commit : + + commit 73f9b911faa74ac5107879de05c9489c419f41bb + Author: Masami Hiramatsu + Date: Sat Mar 26 11:27:05 2022 +0900 + + kprobes: Use rethook for kretprobe if possible + + Use rethook for kretprobe function return hooking if the arch sets + CONFIG_HAVE_RETHOOK=y. In this case, CONFIG_KRETPROBE_ON_RETHOOK is + set to 'y' automatically, and the kretprobe internal data fields + switches to use rethook. If not, it continues to use kretprobe + specific function return hooks. + +Upstream-Status: Backport + +Change-Id: I2b7670dc04e4769c1e3c372582ad2f555f6d7a66 +Signed-off-by: Michael Jeanson +Signed-off-by: Mathieu Desnoyers +--- + include/wrapper/kprobes.h | 17 +++++++++++++++++ + src/probes/lttng-kretprobes.c | 2 +- + 2 files changed, 18 insertions(+), 1 deletion(-) + +diff --git a/include/wrapper/kprobes.h b/include/wrapper/kprobes.h +index b546d615..51d32b7c 100644 +--- a/include/wrapper/kprobes.h ++++ b/include/wrapper/kprobes.h +@@ -29,4 +29,21 @@ struct kretprobe *lttng_get_kretprobe(struct kretprobe_instance *ri) + + #endif /* LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,11,0) */ + ++ ++#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,18,0)) ++static inline ++unsigned long lttng_get_kretprobe_retaddr(struct kretprobe_instance *ri) ++{ ++ return get_kretprobe_retaddr(ri); ++} ++ ++#else ++ ++static inline ++unsigned long lttng_get_kretprobe_retaddr(struct kretprobe_instance *ri) ++{ ++ return (unsigned long) ri->ret_addr; ++} ++#endif ++ + #endif /* _LTTNG_WRAPPER_KPROBES_H */ +diff --git a/src/probes/lttng-kretprobes.c b/src/probes/lttng-kretprobes.c +index 5cb2e953..565df739 100644 +--- a/src/probes/lttng-kretprobes.c ++++ b/src/probes/lttng-kretprobes.c +@@ -81,7 +81,7 @@ int _lttng_kretprobes_handler(struct kretprobe_instance *krpi, + int ret; + + payload.ip = (unsigned long) lttng_get_kretprobe(krpi)->kp.addr; +- payload.parent_ip = (unsigned long) krpi->ret_addr; ++ payload.parent_ip = lttng_get_kretprobe_retaddr(krpi); + + lib_ring_buffer_ctx_init(&ctx, event_recorder, sizeof(payload), + lttng_alignof(payload), <tng_probe_ctx); +-- +2.19.1 + diff --git a/meta/recipes-kernel/lttng/lttng-modules/0008-fix-scsi-core-Remove-scsi-scsi_request.h-v5.18.patch b/meta/recipes-kernel/lttng/lttng-modules/0008-fix-scsi-core-Remove-scsi-scsi_request.h-v5.18.patch new file mode 100644 index 0000000000..13c504b859 --- /dev/null +++ b/meta/recipes-kernel/lttng/lttng-modules/0008-fix-scsi-core-Remove-scsi-scsi_request.h-v5.18.patch @@ -0,0 +1,44 @@ +From e8d2f286b5b208ac8870d0a9c167b170e96169b3 Mon Sep 17 00:00:00 2001 +From: Michael Jeanson +Date: Mon, 4 Apr 2022 15:08:48 -0400 +Subject: [PATCH 08/10] fix: scsi: core: Remove (v5.18) + +See upstream commit : + + commit 26440303310591e29121964ede0048583cb3126d + Author: Christoph Hellwig + Date: Thu Feb 24 18:55:52 2022 +0100 + + scsi: core: Remove + + This header is empty now except for an include of , so + remove it. + +Upstream-Status: Backport + +Change-Id: Ic8ee3352f1e8bddfcd44c31be9b788db82f183aa +Signed-off-by: Michael Jeanson +Signed-off-by: Mathieu Desnoyers +--- + include/instrumentation/events/block.h | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/include/instrumentation/events/block.h b/include/instrumentation/events/block.h +index 050a59a2..882e6e08 100644 +--- a/include/instrumentation/events/block.h ++++ b/include/instrumentation/events/block.h +@@ -11,9 +11,9 @@ + #include + #include + +-#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,11,0)) ++#if LTTNG_KERNEL_RANGE(4,11,0, 5,18,0) + #include +-#endif /* (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,11,0)) */ ++#endif /* LTTNG_KERNEL_RANGE(4,11,0, 5,18,0) */ + + #ifndef _TRACE_BLOCK_DEF_ + #define _TRACE_BLOCK_DEF_ +-- +2.19.1 + diff --git a/meta/recipes-kernel/lttng/lttng-modules/0009-Rename-genhd-wrapper-to-blkdev.patch b/meta/recipes-kernel/lttng/lttng-modules/0009-Rename-genhd-wrapper-to-blkdev.patch new file mode 100644 index 0000000000..90fec9dc58 --- /dev/null +++ b/meta/recipes-kernel/lttng/lttng-modules/0009-Rename-genhd-wrapper-to-blkdev.patch @@ -0,0 +1,76 @@ +From 82fbf9d383ff9069808fb0f5f75c660098dbae52 Mon Sep 17 00:00:00 2001 +From: Michael Jeanson +Date: Tue, 5 Apr 2022 14:57:41 -0400 +Subject: [PATCH 09/10] Rename genhd wrapper to blkdev + +The genhd.h header was folded into blkdev.h in v5.18, rename our wrapper +to follow upstream. + +Upstream-Status: Backport + +Change-Id: I4ec94fb94d11712dd20f0680aea1de77fbfa9d17 +Signed-off-by: Michael Jeanson +Signed-off-by: Mathieu Desnoyers +--- + include/wrapper/{genhd.h => blkdev.h} | 10 +++++----- + src/lttng-statedump-impl.c | 2 +- + 2 files changed, 6 insertions(+), 6 deletions(-) + rename include/wrapper/{genhd.h => blkdev.h} (93%) + +diff --git a/include/wrapper/genhd.h b/include/wrapper/blkdev.h +similarity index 93% +rename from include/wrapper/genhd.h +rename to include/wrapper/blkdev.h +index 4a59b68e..0d5ad90f 100644 +--- a/include/wrapper/genhd.h ++++ b/include/wrapper/blkdev.h +@@ -1,6 +1,6 @@ + /* SPDX-License-Identifier: (GPL-2.0-only or LGPL-2.1-only) + * +- * wrapper/genhd.h ++ * wrapper/blkdev.h + * + * wrapper around block layer functions and data structures. Using + * KALLSYMS to get its address when available, else we need to have a +@@ -9,8 +9,8 @@ + * Copyright (C) 2011-2014 Mathieu Desnoyers + */ + +-#ifndef _LTTNG_WRAPPER_GENHD_H +-#define _LTTNG_WRAPPER_GENHD_H ++#ifndef _LTTNG_WRAPPER_BLKDEV_H ++#define _LTTNG_WRAPPER_BLKDEV_H + + #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,18,0)) + #include +@@ -45,7 +45,7 @@ struct class *wrapper_get_block_class(void) + /* + * Canary function to check for 'block_class' at compile time. + * +- * From 'include/linux/genhd.h': ++ * From 'include/linux/blkdev.h': + * + * extern struct class block_class; + */ +@@ -104,4 +104,4 @@ struct device_type *wrapper_get_disk_type(void) + + #endif + +-#endif /* _LTTNG_WRAPPER_GENHD_H */ ++#endif /* _LTTNG_WRAPPER_BLKDEV_H */ +diff --git a/src/lttng-statedump-impl.c b/src/lttng-statedump-impl.c +index 4d7b2921..0e753090 100644 +--- a/src/lttng-statedump-impl.c ++++ b/src/lttng-statedump-impl.c +@@ -41,7 +41,7 @@ + #include + #include + #include +-#include ++#include + #include + #include + #include +-- +2.19.1 + diff --git a/meta/recipes-kernel/lttng/lttng-modules/0010-fix-mm-compaction-cleanup-the-compaction-trace-event.patch b/meta/recipes-kernel/lttng/lttng-modules/0010-fix-mm-compaction-cleanup-the-compaction-trace-event.patch new file mode 100644 index 0000000000..892d3f0d23 --- /dev/null +++ b/meta/recipes-kernel/lttng/lttng-modules/0010-fix-mm-compaction-cleanup-the-compaction-trace-event.patch @@ -0,0 +1,106 @@ +From f9208dc00756dfa0a2f191799722030bdf3f793d Mon Sep 17 00:00:00 2001 +From: Michael Jeanson +Date: Mon, 4 Apr 2022 15:14:01 -0400 +Subject: [PATCH 10/10] fix: mm: compaction: cleanup the compaction trace + events (v5.18) + +See upstream commit : + + commit abd4349ff9b8d242376b67711254221f64f447c7 + Author: Baolin Wang + Date: Tue Mar 22 14:45:56 2022 -0700 + + mm: compaction: cleanup the compaction trace events + + As Steven suggested [1], we should access the pointers from the trace + event to avoid dereferencing them to the tracepoint function when the + tracepoint is disabled. + + [1] https://lkml.org/lkml/2021/11/3/409 + +Upstream-Status: Backport + +Change-Id: I6c08250df8596e8dbc76780ae5d95c899c12e6fe +Signed-off-by: Michael Jeanson +Signed-off-by: Mathieu Desnoyers +--- + include/instrumentation/events/compaction.h | 17 ++++++++++++++++- + src/probes/Kbuild | 17 ++++++++++++++++- + src/probes/lttng-probe-compaction.c | 5 +++++ + 3 files changed, 37 insertions(+), 2 deletions(-) + +diff --git a/include/instrumentation/events/compaction.h b/include/instrumentation/events/compaction.h +index 15964537..ecae39a8 100644 +--- a/include/instrumentation/events/compaction.h ++++ b/include/instrumentation/events/compaction.h +@@ -97,7 +97,22 @@ LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(compaction_isolate_template, + + #endif /* #else #if LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,0,0) */ + +-#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,17,0)) ++#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,18,0)) ++LTTNG_TRACEPOINT_EVENT_MAP(mm_compaction_migratepages, ++ ++ compaction_migratepages, ++ ++ TP_PROTO(struct compact_control *cc, ++ unsigned int nr_succeeded), ++ ++ TP_ARGS(cc, nr_succeeded), ++ ++ TP_FIELDS( ++ ctf_integer(unsigned long, nr_migrated, nr_succeeded) ++ ctf_integer(unsigned long, nr_failed, cc->nr_migratepages - nr_succeeded) ++ ) ++) ++#elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,17,0)) + LTTNG_TRACEPOINT_EVENT_MAP(mm_compaction_migratepages, + + compaction_migratepages, +diff --git a/src/probes/Kbuild b/src/probes/Kbuild +index 8d6ff0f2..54784477 100644 +--- a/src/probes/Kbuild ++++ b/src/probes/Kbuild +@@ -167,7 +167,22 @@ ifneq ($(CONFIG_BTRFS_FS),) + endif # $(wildcard $(btrfs_dep)) + endif # CONFIG_BTRFS_FS + +-obj-$(CONFIG_LTTNG) += lttng-probe-compaction.o ++# A dependency on internal header 'mm/internal.h' was introduced in v5.18 ++compaction_dep = $(srctree)/mm/internal.h ++compaction_dep_wildcard = $(wildcard $(compaction_dep)) ++compaction_dep_check = $(shell \ ++if [ \( $(VERSION) -ge 6 \ ++ -o \( $(VERSION) -eq 5 -a $(PATCHLEVEL) -ge 18 \) \) -a \ ++ -z "$(compaction_dep_wildcard)" ] ; then \ ++ echo "warn" ; \ ++else \ ++ echo "ok" ; \ ++fi ;) ++ifeq ($(compaction_dep_check),ok) ++ obj-$(CONFIG_LTTNG) += lttng-probe-compaction.o ++else ++ $(warning Files $(compaction_dep) not found. Probe "compaction" is disabled. Use full kernel source tree to enable it.) ++endif # $(wildcard $(compaction_dep)) + + ifneq ($(CONFIG_EXT4_FS),) + ext4_dep = $(srctree)/fs/ext4/*.h +diff --git a/src/probes/lttng-probe-compaction.c b/src/probes/lttng-probe-compaction.c +index f8ddf384..ffaf45f0 100644 +--- a/src/probes/lttng-probe-compaction.c ++++ b/src/probes/lttng-probe-compaction.c +@@ -10,6 +10,11 @@ + + #include + #include ++#include ++ ++#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,18,0)) ++#include "../mm/internal.h" ++#endif + + /* + * Create the tracepoint static inlines from the kernel to validate that our +-- +2.19.1 + diff --git a/meta/recipes-kernel/lttng/lttng-modules_2.13.3.bb b/meta/recipes-kernel/lttng/lttng-modules_2.13.3.bb index a959ce9211..c33920e0d0 100644 --- a/meta/recipes-kernel/lttng/lttng-modules_2.13.3.bb +++ b/meta/recipes-kernel/lttng/lttng-modules_2.13.3.bb @@ -9,7 +9,19 @@ inherit module include lttng-platforms.inc -SRC_URI = "https://lttng.org/files/${BPN}/${BPN}-${PV}.tar.bz2" +SRC_URI = "https://lttng.org/files/${BPN}/${BPN}-${PV}.tar.bz2 \ + file://0001-Fix-compaction-migratepages-event-name.patch \ + file://0002-Fix-tracepoint-event-allow-same-provider-and-event-n.patch \ + file://0003-fix-sched-tracing-Don-t-re-read-p-state-when-emittin.patch \ + file://0004-fix-block-remove-genhd.h-v5.18.patch \ + file://0005-fix-scsi-block-Remove-REQ_OP_WRITE_SAME-support-v5.1.patch \ + file://0006-fix-random-remove-unused-tracepoints-v5.18.patch \ + file://0007-fix-kprobes-Use-rethook-for-kretprobe-if-possible-v5.patch \ + file://0008-fix-scsi-core-Remove-scsi-scsi_request.h-v5.18.patch \ + file://0009-Rename-genhd-wrapper-to-blkdev.patch \ + file://0010-fix-mm-compaction-cleanup-the-compaction-trace-event.patch \ + " + # Use :append here so that the patch is applied also when using devupstream SRC_URI:append = " file://0001-src-Kbuild-change-missing-CONFIG_TRACEPOINTS-to-warn.patch" From patchwork Wed May 11 02:57:31 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Mittal, Anuj" X-Patchwork-Id: 7892 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 1C2ADC433FE for ; Wed, 11 May 2022 02:58:18 +0000 (UTC) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mx.groups.io with SMTP id smtpd.web10.6480.1652237869110482622 for ; Tue, 10 May 2022 19:58:08 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=gmQEM9iF; spf=pass (domain: intel.com, ip: 134.134.136.20, mailfrom: anuj.mittal@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1652237887; x=1683773887; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=Jky4ijBz6D1uI3BE4IK+TWaFzO4RlBXnHJ278RVEEtI=; b=gmQEM9iFCS+arQ+iLytD5YtOWTDKNGGLLn2fgxwPVSTXomZaffkDSQWA c8+lwLKsEe15D7TQdwcCK80s8HzyQ7b+cS3UpTxCCzRtaMf+3ERyYktaq fNDkC2Siq8YcJwTjQOZmK9JHGBA3oraoaMG056M8VmylCZV8PpbyH3WgH xp2D4WXNGfzczCsLjXvVMZMdZgE2A9YR7I8sw8dI6QwKlvNJSQgKAiz8q 1ANg+6Fe60P+FPv9N1if+cRngsWr1B2sVomonGvwN+56Cw1qpvZbvz0Re wmFVOenpISRxeUkl/nRFPm7FRZkJexgcNoVIv60loVmeqIxkSCXaumjqL g==; X-IronPort-AV: E=McAfee;i="6400,9594,10343"; a="257106082" X-IronPort-AV: E=Sophos;i="5.91,215,1647327600"; d="scan'208";a="257106082" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 May 2022 19:58:07 -0700 X-IronPort-AV: E=Sophos;i="5.91,215,1647327600"; d="scan'208";a="602754881" Received: from ukandhax-mobl3.gar.corp.intel.com (HELO anmitta2-mobl3.intel.com) ([10.214.163.3]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 May 2022 19:58:06 -0700 From: Anuj Mittal To: openembedded-core@lists.openembedded.org Subject: [honister][PATCH 16/17] perf: sort-pmuevents: don't drop elements Date: Wed, 11 May 2022 10:57:31 +0800 Message-Id: X-Mailer: git-send-email 2.35.3 In-Reply-To: References: MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Wed, 11 May 2022 02:58:18 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/165484 From: Max Krummenacher If a struct element neither has an element cpuid or name it gets silenty dropped. Kernel 5.15 for some ARCHs have at least one array of structs matching this. e.g. for arm pmu-events.c: |#include "pmu-events/pmu-events.h" struct pmu_events_map pmu_events_map[] = { { .cpuid = 0, .version = 0, .type = 0, .table = 0, }, }; struct pmu_sys_events pmu_sys_event_tables[] = { { .table = 0 }, }; Before this patch the second struct is translated to an empty array:: struct pmu_sys_events pmu_sys_event_tables[] = { }; Signed-off-by: Max Krummenacher Signed-off-by: Bruce Ashfield (cherry picked from commit e1382583cd5060be301afaa9998ccf250cc8bca3) Signed-off-by: Anuj Mittal --- meta/recipes-kernel/perf/perf/sort-pmuevents.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/meta/recipes-kernel/perf/perf/sort-pmuevents.py b/meta/recipes-kernel/perf/perf/sort-pmuevents.py index 5ddf0f144f..4f841eb822 100755 --- a/meta/recipes-kernel/perf/perf/sort-pmuevents.py +++ b/meta/recipes-kernel/perf/perf/sort-pmuevents.py @@ -61,6 +61,8 @@ for struct in re.findall( struct_block_regex, data ): #print( " name found: %s" % name.group(1) ) entry_dict[struct[1]]['fields'][name.group(1)] = entry + if not entry_dict[struct[1]]['fields']: + entry_dict[struct[1]]['fields']['0'] = entry # created ordered dictionaries from the captured values. These are ordered by # a sorted() iteration of the keys. We don't care about the order we read From patchwork Wed May 11 02:57:32 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Mittal, Anuj" X-Patchwork-Id: 7891 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 1C280C433F5 for ; Wed, 11 May 2022 02:58:18 +0000 (UTC) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mx.groups.io with SMTP id smtpd.web10.6480.1652237869110482622 for ; Tue, 10 May 2022 19:58:08 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=UnbK0s0U; spf=pass (domain: intel.com, ip: 134.134.136.20, mailfrom: anuj.mittal@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1652237888; x=1683773888; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=8WBGJFLJSUFTAGqnTUj+UmXKATN6liXz7lAsRfKFAQ0=; b=UnbK0s0UvsQ1akum/036ZjYMUi4l1SC9CvIU2J58hkJHUQ+LQCduQvt+ s2urU4rvZysL6rr+wNtvG2ckjBEP6eqDsy/ISO0VAQOaTL7xZ4vpyHy60 j2LSzapYX5utgQn+5pAD4XaL2W2u8dI+XBZZetYYypy9+vPuPpE6W3Bjl LjONI0sKlP6Uj5nQXhNScU65oKbtlIxyxXO0+YpFsrHGJiCZi3SW2ot49 JYpCSog5N6PRlkLw8S2n9E1tLCKHNVtP/mzk6OfwBO2QUCv63MSle4fVm /e9rnMxJD9QSDfHD0Ui9PBRhG9tLg95MgUh6ZyPqEnwUJGkT9D8NKloh4 w==; X-IronPort-AV: E=McAfee;i="6400,9594,10343"; a="257106085" X-IronPort-AV: E=Sophos;i="5.91,215,1647327600"; d="scan'208";a="257106085" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 May 2022 19:58:08 -0700 X-IronPort-AV: E=Sophos;i="5.91,215,1647327600"; d="scan'208";a="602754893" Received: from ukandhax-mobl3.gar.corp.intel.com (HELO anmitta2-mobl3.intel.com) ([10.214.163.3]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 May 2022 19:58:07 -0700 From: Anuj Mittal To: openembedded-core@lists.openembedded.org Subject: [honister][PATCH 17/17] perf: sort-pmuevents: allow for additional type qualifiers and storage class Date: Wed, 11 May 2022 10:57:32 +0800 Message-Id: X-Mailer: git-send-email 2.35.3 In-Reply-To: References: MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Wed, 11 May 2022 02:58:18 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/165485 From: Max Krummenacher With kernel 5.16 some structs in pmu-events do get a const qualifier, some a static const storage class and qualifier. The current sort-pmuevents cannot cope with that and drops all struct arrays with such additional elements. This then leads to compiler errors. Allow '^struct', '^const struct', '^static struct', '^static const struct'. Signed-off-by: Max Krummenacher Signed-off-by: Bruce Ashfield (cherry picked from commit 8406e83ade1c34d8a7d8063f2e7445aafa471721) Signed-off-by: Anuj Mittal --- .../perf/perf/sort-pmuevents.py | 30 ++++++++++--------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/meta/recipes-kernel/perf/perf/sort-pmuevents.py b/meta/recipes-kernel/perf/perf/sort-pmuevents.py index 4f841eb822..09ba3328a7 100755 --- a/meta/recipes-kernel/perf/perf/sort-pmuevents.py +++ b/meta/recipes-kernel/perf/perf/sort-pmuevents.py @@ -33,10 +33,10 @@ if os.path.exists(outfile): with open(infile, 'r') as file: data = file.read() -preamble_regex = re.compile( '^(.*?)^struct', re.MULTILINE | re.DOTALL ) +preamble_regex = re.compile( '^(.*?)^(struct|const struct|static struct|static const struct)', re.MULTILINE | re.DOTALL ) preamble = re.search( preamble_regex, data ) -struct_block_regex = re.compile( '^struct.*?(\w+) (.*?)\[\] = {(.*?)^};', re.MULTILINE | re.DOTALL ) +struct_block_regex = re.compile( '^(struct|const struct|static struct|static const struct).*?(\w+) (.*?)\[\] = {(.*?)^};', re.MULTILINE | re.DOTALL ) field_regex = re.compile( '{.*?},', re.MULTILINE | re.DOTALL ) cpuid_regex = re.compile( '\.cpuid = (.*?),', re.MULTILINE | re.DOTALL ) name_regex = re.compile( '\.name = (.*?),', re.MULTILINE | re.DOTALL ) @@ -45,24 +45,25 @@ name_regex = re.compile( '\.name = (.*?),', re.MULTILINE | re.DOTALL ) # types and then their fields. entry_dict = {} for struct in re.findall( struct_block_regex, data ): - # print( "struct: %s %s" % (struct[0],struct[1]) ) - entry_dict[struct[1]] = {} - entry_dict[struct[1]]['type'] = struct[0] - entry_dict[struct[1]]['fields'] = {} - for entry in re.findall( field_regex, struct[2] ): + # print( "struct: %s %s %s" % (struct[0],struct[1],struct[2]) ) + entry_dict[struct[2]] = {} + entry_dict[struct[2]]['type_prefix'] = struct[0] + entry_dict[struct[2]]['type'] = struct[1] + entry_dict[struct[2]]['fields'] = {} + for entry in re.findall( field_regex, struct[3] ): #print( " entry: %s" % entry ) cpuid = re.search( cpuid_regex, entry ) if cpuid: #print( " cpuid found: %s" % cpuid.group(1) ) - entry_dict[struct[1]]['fields'][cpuid.group(1)] = entry - + entry_dict[struct[2]]['fields'][cpuid.group(1)] = entry + name = re.search( name_regex, entry ) if name: #print( " name found: %s" % name.group(1) ) - entry_dict[struct[1]]['fields'][name.group(1)] = entry - - if not entry_dict[struct[1]]['fields']: - entry_dict[struct[1]]['fields']['0'] = entry + entry_dict[struct[2]]['fields'][name.group(1)] = entry + + if not entry_dict[struct[2]]['fields']: + entry_dict[struct[2]]['fields']['0'] = entry # created ordered dictionaries from the captured values. These are ordered by # a sorted() iteration of the keys. We don't care about the order we read @@ -74,6 +75,7 @@ for struct in re.findall( struct_block_regex, data ): entry_dict_sorted = OrderedDict() for i in sorted(entry_dict.keys()): entry_dict_sorted[i] = {} + entry_dict_sorted[i]['type_prefix'] = entry_dict[i]['type_prefix'] entry_dict_sorted[i]['type'] = entry_dict[i]['type'] entry_dict_sorted[i]['fields'] = {} for f in sorted(entry_dict[i]['fields'].keys()): @@ -85,7 +87,7 @@ outf = open( outfile, 'w' ) print( preamble.group(1) ) outf.write( preamble.group(1) ) for d in entry_dict_sorted: - outf.write( "struct %s %s[] = {\n" % (entry_dict_sorted[d]['type'],d) ) + outf.write( "%s %s %s[] = {\n" % (entry_dict_sorted[d]['type_prefix'], entry_dict_sorted[d]['type'],d) ) for f in entry_dict_sorted[d]['fields']: outf.write( entry_dict_sorted[d]['fields'][f] + '\n' )