diff options
Diffstat (limited to 'recipes-kernel')
30 files changed, 338 insertions, 1294 deletions
diff --git a/recipes-kernel/intel-ethernet/ixgbe/0001-ixgbe-skip-host-depmod.patch b/recipes-kernel/intel-ethernet/ixgbe/0001-ixgbe-skip-host-depmod.patch deleted file mode 100644 index 0041af57..00000000 --- a/recipes-kernel/intel-ethernet/ixgbe/0001-ixgbe-skip-host-depmod.patch +++ /dev/null | |||
@@ -1,31 +0,0 @@ | |||
1 | From 5f87ef7ed60bc9762467184ed0a6d000b80713d9 Mon Sep 17 00:00:00 2001 | ||
2 | From: sweeaun <swee.aun.khor@intel.com> | ||
3 | Date: Sun, 8 Apr 2018 17:21:52 +0800 | ||
4 | Subject: [PATCH] ixgbe: skip host depmod | ||
5 | |||
6 | Upstream-Status: Inappropriate [Cross-Compile] | ||
7 | |||
8 | Depmod during do_install is irrelevant when cross-compiling. | ||
9 | Remove the depmod steps during do_install. | ||
10 | |||
11 | Signed-off-by: sweeaun <swee.aun.khor@intel.com> | ||
12 | --- | ||
13 | Makefile | 2 -- | ||
14 | 1 file changed, 2 deletions(-) | ||
15 | |||
16 | diff --git a/Makefile b/Makefile | ||
17 | index 545489a..07e422f 100644 | ||
18 | --- a/Makefile | ||
19 | +++ b/Makefile | ||
20 | @@ -141,8 +141,6 @@ install: default manfile | ||
21 | @install -D -m 644 ${DRIVER}.${MANSECTION}.gz ${INSTALL_MOD_PATH}${MANDIR}/man${MANSECTION}/${DRIVER}.${MANSECTION}.gz | ||
22 | @echo "Installing modules..." | ||
23 | @+$(call devkernelbuild,modules_install) | ||
24 | - @echo "Running depmod..." | ||
25 | - @$(call cmd_depmod) | ||
26 | |||
27 | uninstall: | ||
28 | rm -f ${INSTALL_MOD_PATH}/lib/modules/${KVER}/${INSTALL_MOD_DIR}/${DRIVER}.ko; | ||
29 | -- | ||
30 | 2.7.4 | ||
31 | |||
diff --git a/recipes-kernel/intel-ethernet/ixgbe_5.6.3.bb b/recipes-kernel/intel-ethernet/ixgbe_5.19.6.bb index fb09e037..7ef38650 100644 --- a/recipes-kernel/intel-ethernet/ixgbe_5.6.3.bb +++ b/recipes-kernel/intel-ethernet/ixgbe_5.19.6.bb | |||
@@ -4,15 +4,13 @@ PCI Express* 10 Gigabit Network Connections." | |||
4 | 4 | ||
5 | HOMEPAGE = "https://sourceforge.net/projects/e1000/" | 5 | HOMEPAGE = "https://sourceforge.net/projects/e1000/" |
6 | SECTION = "kernel/network" | 6 | SECTION = "kernel/network" |
7 | LICENSE = "GPLv2" | 7 | LICENSE = "GPL-2.0-only" |
8 | LIC_FILES_CHKSUM = "file://${WORKDIR}/${BP}/COPYING;md5=a216b4192dc6b777b6f0db560e9a8417" | 8 | LIC_FILES_CHKSUM = "file://${WORKDIR}/${BP}/COPYING;md5=a216b4192dc6b777b6f0db560e9a8417" |
9 | 9 | ||
10 | SRC_URI = "https://sourceforge.net/projects/e1000/files/ixgbe%20stable/${PV}/${BP}.tar.gz \ | 10 | SRC_URI = "https://sourceforge.net/projects/e1000/files/ixgbe%20stable/${PV}/${BP}.tar.gz \ |
11 | file://0001-ixgbe-skip-host-depmod.patch \ | ||
12 | " | 11 | " |
13 | 12 | ||
14 | SRC_URI[md5sum] = "990321b97c58b5cbf86e6b1e095d9cbf" | 13 | SRC_URI[sha256sum] = "a844f1fea8064e30b276792455c3b286c1d7af26731e8f865d4a4e9ed1dcf4ab" |
15 | SRC_URI[sha256sum] = "d6a5129b7be0a25bed65843be37e4ac913deab4ca169b215521088e10eb03ef1" | ||
16 | 14 | ||
17 | UPSTREAM_CHECK_URI = "https://sourceforge.net/projects/e1000/files/ixgbe%20stable/" | 15 | UPSTREAM_CHECK_URI = "https://sourceforge.net/projects/e1000/files/ixgbe%20stable/" |
18 | UPSTREAM_CHECK_REGEX = "ixgbe%20stable/(?P<pver>\d+(\.\d+)+)/" | 16 | UPSTREAM_CHECK_REGEX = "ixgbe%20stable/(?P<pver>\d+(\.\d+)+)/" |
@@ -20,16 +18,15 @@ UPSTREAM_CHECK_REGEX = "ixgbe%20stable/(?P<pver>\d+(\.\d+)+)/" | |||
20 | CVE_PRODUCT = "linux:linux_kernel_ixgbe" | 18 | CVE_PRODUCT = "linux:linux_kernel_ixgbe" |
21 | 19 | ||
22 | S = "${WORKDIR}/${BP}/src" | 20 | S = "${WORKDIR}/${BP}/src" |
23 | MODULES_INSTALL_TARGET = "install" | ||
24 | 21 | ||
25 | EXTRA_OEMAKE='KSRC="${STAGING_KERNEL_BUILDDIR}" KVER="${KERNEL_VERSION}" INSTALL_MOD_PATH="${D}"' | 22 | EXTRA_OEMAKE=' KSRC="${STAGING_KERNEL_DIR}" KOBJ="${STAGING_KERNEL_BUILDDIR}" KVER="${KERNEL_VERSION}" INSTALL_MOD_PATH="${D}"' |
26 | 23 | ||
27 | KERNEL_MODULE_AUTOLOAD_append_intel-core2-32 = " ixgbe" | 24 | KERNEL_MODULE_AUTOLOAD:append:intel-core2-32 = " ixgbe" |
28 | KERNEL_MODULE_AUTOLOAD_append_intel-corei7-64 = " ixgbe" | 25 | KERNEL_MODULE_AUTOLOAD:append:intel-corei7-64 = " ixgbe" |
29 | 26 | ||
30 | inherit module | 27 | inherit module |
31 | 28 | ||
32 | do_install_append () { | 29 | do_install:append () { |
33 | # Install scripts/set_irq_affinity | 30 | # Install scripts/set_irq_affinity |
34 | install -d ${D}${sysconfdir}/network | 31 | install -d ${D}${sysconfdir}/network |
35 | install -m 0755 ${S}/../scripts/set_irq_affinity ${D}${sysconfdir}/network | 32 | install -m 0755 ${S}/../scripts/set_irq_affinity ${D}${sysconfdir}/network |
@@ -39,4 +36,8 @@ do_install_append () { | |||
39 | 36 | ||
40 | PACKAGES += "${PN}-script" | 37 | PACKAGES += "${PN}-script" |
41 | 38 | ||
42 | FILES_${PN}-script += "${sysconfdir}/network/set_irq_affinity" | 39 | FILES:${PN}-script += "${sysconfdir}/network/set_irq_affinity" |
40 | |||
41 | EXCLUDE_FROM_WORLD = "1" | ||
42 | |||
43 | CVE_STATUS[CVE-2015-1142857] = "fixed-version: Fixed from version 4.4-rc1" | ||
diff --git a/recipes-kernel/intel-ethernet/ixgbevf/0001-ixgbevf-skip-host-depmod.patch b/recipes-kernel/intel-ethernet/ixgbevf/0001-ixgbevf-skip-host-depmod.patch deleted file mode 100644 index 656a897d..00000000 --- a/recipes-kernel/intel-ethernet/ixgbevf/0001-ixgbevf-skip-host-depmod.patch +++ /dev/null | |||
@@ -1,31 +0,0 @@ | |||
1 | From 9677d09f5c3984997ac8e7d90b5d4b11fb9ce277 Mon Sep 17 00:00:00 2001 | ||
2 | From: sweeaun <swee.aun.khor@intel.com> | ||
3 | Date: Sat, 7 Oct 2017 20:56:35 -0700 | ||
4 | Subject: [PATCH] ixgbevf: skip host depmod | ||
5 | |||
6 | Upstream-Status: Inappropriate [Cross-Compile] | ||
7 | |||
8 | Depmod during do_install is irrelevant when cross-compiling. | ||
9 | Remove the depmod steps during do_install. | ||
10 | |||
11 | Signed-off-by: sweeaun <swee.aun.khor@intel.com> | ||
12 | --- | ||
13 | Makefile | 2 -- | ||
14 | 1 file changed, 2 deletions(-) | ||
15 | |||
16 | diff --git a/Makefile b/Makefile | ||
17 | index 91df705..1dcf350 100644 | ||
18 | --- a/Makefile | ||
19 | +++ b/Makefile | ||
20 | @@ -104,8 +104,6 @@ modules_install: default manfile | ||
21 | @install -D -m 644 ${DRIVER}.${MANSECTION}.gz ${INSTALL_MOD_PATH}${MANDIR}/man${MANSECTION}/${DRIVER}.${MANSECTION}.gz | ||
22 | @echo "Installing modules..." | ||
23 | @+$(call kernelbuild,modules_install) | ||
24 | - @echo "Running depmod..." | ||
25 | - @$(call cmd_depmod) | ||
26 | |||
27 | uninstall: | ||
28 | rm -f ${INSTALL_MOD_PATH}/lib/modules/${KVER}/${INSTALL_MOD_DIR}/${DRIVER}.ko; | ||
29 | -- | ||
30 | 2.7.4 | ||
31 | |||
diff --git a/recipes-kernel/intel-ethernet/ixgbevf_4.6.1.bb b/recipes-kernel/intel-ethernet/ixgbevf_4.18.7.bb index 79856641..b21796c6 100644 --- a/recipes-kernel/intel-ethernet/ixgbevf_4.6.1.bb +++ b/recipes-kernel/intel-ethernet/ixgbevf_4.18.7.bb | |||
@@ -7,15 +7,13 @@ The guest OS loading this driver must support MSI-X interrupts." | |||
7 | 7 | ||
8 | HOMEPAGE = "https://sourceforge.net/projects/e1000/" | 8 | HOMEPAGE = "https://sourceforge.net/projects/e1000/" |
9 | SECTION = "kernel/network" | 9 | SECTION = "kernel/network" |
10 | LICENSE = "GPLv2" | 10 | LICENSE = "GPL-2.0-only" |
11 | LIC_FILES_CHKSUM = "file://${WORKDIR}/${BP}/COPYING;md5=a216b4192dc6b777b6f0db560e9a8417" | 11 | LIC_FILES_CHKSUM = "file://${WORKDIR}/${BP}/COPYING;md5=a216b4192dc6b777b6f0db560e9a8417" |
12 | 12 | ||
13 | SRC_URI = "https://sourceforge.net/projects/e1000/files/ixgbevf%20stable/${PV}/${BP}.tar.gz \ | 13 | SRC_URI = "https://sourceforge.net/projects/e1000/files/ixgbevf%20stable/${PV}/${BP}.tar.gz \ |
14 | file://0001-ixgbevf-skip-host-depmod.patch \ | ||
15 | " | 14 | " |
16 | 15 | ||
17 | SRC_URI[md5sum] = "e98bc636fea13cb62c11433159147851" | 16 | SRC_URI[sha256sum] = "90f6cd614008839b6fc748ae0f4ad3503435f8b788318d4f40cfc83c7029025e" |
18 | SRC_URI[sha256sum] = "2ca0a0a836d006375fa28a999e0b139bda93110a22ee3742ae1c8d0ac9130a41" | ||
19 | 17 | ||
20 | UPSTREAM_CHECK_URI = "https://sourceforge.net/projects/e1000/files/ixgbevf%20stable/" | 18 | UPSTREAM_CHECK_URI = "https://sourceforge.net/projects/e1000/files/ixgbevf%20stable/" |
21 | UPSTREAM_CHECK_REGEX = "ixgbevf%20stable/(?P<pver>\d+(\.\d+)+)/" | 19 | UPSTREAM_CHECK_REGEX = "ixgbevf%20stable/(?P<pver>\d+(\.\d+)+)/" |
@@ -23,16 +21,15 @@ UPSTREAM_CHECK_REGEX = "ixgbevf%20stable/(?P<pver>\d+(\.\d+)+)/" | |||
23 | CVE_PRODUCT = "linux:linux_kernel_ixgbe" | 21 | CVE_PRODUCT = "linux:linux_kernel_ixgbe" |
24 | 22 | ||
25 | S = "${WORKDIR}/${BP}/src" | 23 | S = "${WORKDIR}/${BP}/src" |
26 | MODULES_INSTALL_TARGET = "install" | ||
27 | 24 | ||
28 | EXTRA_OEMAKE='KSRC="${STAGING_KERNEL_BUILDDIR}" KVER="${KERNEL_VERSION}" INSTALL_MOD_PATH="${D}"' | 25 | EXTRA_OEMAKE='KSRC="${STAGING_KERNEL_DIR}" KOBJ="${STAGING_KERNEL_BUILDDIR}" KVER="${KERNEL_VERSION}" INSTALL_MOD_PATH="${D}"' |
29 | 26 | ||
30 | KERNEL_MODULE_AUTOLOAD_append_intel-core2-32 = " ixgbevf" | 27 | KERNEL_MODULE_AUTOLOAD:append:intel-core2-32 = " ixgbevf" |
31 | KERNEL_MODULE_AUTOLOAD_append_intel-corei7-64 = " ixgbevf" | 28 | KERNEL_MODULE_AUTOLOAD:append:intel-corei7-64 = " ixgbevf" |
32 | 29 | ||
33 | inherit module | 30 | inherit module |
34 | 31 | ||
35 | do_install_append () { | 32 | do_install:append () { |
36 | # Install scripts/set_irq_affinity | 33 | # Install scripts/set_irq_affinity |
37 | install -d ${D}${sysconfdir}/network | 34 | install -d ${D}${sysconfdir}/network |
38 | install -m 0755 ${S}/../scripts/set_irq_affinity ${D}${sysconfdir}/network | 35 | install -m 0755 ${S}/../scripts/set_irq_affinity ${D}${sysconfdir}/network |
@@ -42,4 +39,8 @@ do_install_append () { | |||
42 | 39 | ||
43 | PACKAGES += "${PN}-script" | 40 | PACKAGES += "${PN}-script" |
44 | 41 | ||
45 | FILES_${PN}-script += "${sysconfdir}/network/set_irq_affinity" | 42 | FILES:${PN}-script += "${sysconfdir}/network/set_irq_affinity" |
43 | |||
44 | CVE_STATUS[CVE-2015-1142857] = "fixed-version: Fixed from version 4.4-rc1" | ||
45 | |||
46 | EXCLUDE_FROM_WORLD = "1" | ||
diff --git a/recipes-kernel/iwlwifi/backport-iwlwifi_git.bb b/recipes-kernel/iwlwifi/backport-iwlwifi_git.bb index 9eb0a45d..ea36cfc3 100644 --- a/recipes-kernel/iwlwifi/backport-iwlwifi_git.bb +++ b/recipes-kernel/iwlwifi/backport-iwlwifi_git.bb | |||
@@ -1,13 +1,13 @@ | |||
1 | SUMMARY = "Intel Wireless LinuxCore kernel driver" | 1 | SUMMARY = "Intel Wireless LinuxCore kernel driver" |
2 | DESCRIPTION = "Intel Wireless LinuxCore kernel driver" | 2 | DESCRIPTION = "Intel Wireless LinuxCore kernel driver" |
3 | SECTION = "kernel" | 3 | SECTION = "kernel" |
4 | LICENSE = "GPL-2.0" | 4 | LICENSE = "GPL-2.0-only" |
5 | 5 | ||
6 | REQUIRED_DISTRO_FEATURES = "wifi" | 6 | REQUIRED_DISTRO_FEATURES = "wifi" |
7 | 7 | ||
8 | LIC_FILES_CHKSUM = "file://${S}/COPYING;md5=bbea815ee2795b2f4230826c0c6b8814" | 8 | LIC_FILES_CHKSUM = "file://${S}/COPYING;md5=6bc538ed5bd9a7fc9398086aedcd7e46" |
9 | 9 | ||
10 | inherit module | 10 | inherit module features_check |
11 | 11 | ||
12 | # For some iwfwifi LinuxCore supported wireless chips, the best/latest | 12 | # For some iwfwifi LinuxCore supported wireless chips, the best/latest |
13 | # firmware blobs are found in the iwlwifi's linux-firmware.git fork. | 13 | # firmware blobs are found in the iwlwifi's linux-firmware.git fork. |
@@ -17,8 +17,8 @@ inherit module | |||
17 | # When updating this recipe, ensure that the proper firmware is included from | 17 | # When updating this recipe, ensure that the proper firmware is included from |
18 | # either the linux-firmware or iwlwifi-firmware repos. | 18 | # either the linux-firmware or iwlwifi-firmware repos. |
19 | 19 | ||
20 | PV = "45" | 20 | PV = "79" |
21 | SRCREV = "a75c1de6b3fa87885556c67619429cfa87cc048f" | 21 | SRCREV = "574631d89d736fd2c76b0e2ea489270c50903e52" |
22 | 22 | ||
23 | SRC_URI = " \ | 23 | SRC_URI = " \ |
24 | git://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/backport-iwlwifi;branch=release/core${PV} \ | 24 | git://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/backport-iwlwifi;branch=release/core${PV} \ |
@@ -36,16 +36,18 @@ do_configure() { | |||
36 | 36 | ||
37 | MODULES_INSTALL_TARGET="install" | 37 | MODULES_INSTALL_TARGET="install" |
38 | 38 | ||
39 | do_install_append() { | 39 | do_install:append() { |
40 | ## install configs and service scripts | 40 | ## install configs and service scripts |
41 | install -d ${D}${sysconfdir}/modprobe.d | 41 | install -d ${D}${sysconfdir}/modprobe.d |
42 | install -m 0644 ${WORKDIR}/iwlwifi.conf ${D}${sysconfdir}/modprobe.d | 42 | install -m 0644 ${WORKDIR}/iwlwifi.conf ${D}${sysconfdir}/modprobe.d |
43 | } | 43 | } |
44 | 44 | ||
45 | RDEPENDS_${PN} = "linux-firmware-iwlwifi" | 45 | RDEPENDS:${PN} = "linux-firmware-iwlwifi" |
46 | 46 | ||
47 | KERNEL_MODULE_AUTOLOAD_append_core2-32-intel-common = " iwlwifi" | 47 | FILES:${PN} += "${sysconfdir}/modprobe.d/iwlwifi.conf" |
48 | KERNEL_MODULE_AUTOLOAD_append_corei7-64-intel-common = " iwlwifi" | 48 | |
49 | KERNEL_MODULE_AUTOLOAD:append:core2-32-intel-common = " iwlwifi" | ||
50 | KERNEL_MODULE_AUTOLOAD:append:corei7-64-intel-common = " iwlwifi" | ||
49 | 51 | ||
50 | KERNEL_MODULE_PACKAGE_PREFIX = "backport-iwlwifi" | 52 | KERNEL_MODULE_PACKAGE_PREFIX = "backport-iwlwifi" |
51 | 53 | ||
diff --git a/recipes-kernel/linux/linux-intel-dev.bb b/recipes-kernel/linux/linux-intel-dev.bb deleted file mode 100644 index 78d0f85a..00000000 --- a/recipes-kernel/linux/linux-intel-dev.bb +++ /dev/null | |||
@@ -1,34 +0,0 @@ | |||
1 | require recipes-kernel/linux/linux-yocto.inc | ||
2 | require recipes-kernel/linux/meta-intel-compat-kernel.inc | ||
3 | |||
4 | FILESEXTRAPATHS_prepend := "${THISDIR}/linux-intel:" | ||
5 | |||
6 | SRC_URI = " \ | ||
7 | git://github.com/intel/mainline-tracking.git;protocol=https;name=machine;nobranch=1; \ | ||
8 | git://git.yoctoproject.org/yocto-kernel-cache;type=kmeta;name=meta;branch=${KMETA_BRANCH};destsuffix=${KMETA} \ | ||
9 | file://0001-menuconfig-mconf-cfg-Allow-specification-of-ncurses-.patch \ | ||
10 | " | ||
11 | SRC_URI_append_core2-32-intel-common = " file://disable_skylake_sound.cfg" | ||
12 | |||
13 | KMETA = "kernel-meta" | ||
14 | KCONF_BSP_AUDIT_LEVEL = "2" | ||
15 | |||
16 | KMETA_BRANCH = "master" | ||
17 | |||
18 | LIC_FILES_CHKSUM = "file://COPYING;md5=bbea815ee2795b2f4230826c0c6b8814" | ||
19 | |||
20 | DEPENDS += "elfutils-native openssl-native util-linux-native" | ||
21 | |||
22 | LINUX_VERSION ?= "5.3-rc4" | ||
23 | SRCREV_machine ?= "20ac71f22ff4879d30215d9f45594fe70eb984b1" | ||
24 | SRCREV_meta ?= "8458df5a288ef0b7efa091556a7612a656898a18" | ||
25 | |||
26 | LINUX_VERSION_EXTENSION ?= "-mainline-tracking-${LINUX_KERNEL_TYPE}" | ||
27 | PV = "${LINUX_VERSION}+git${SRCPV}" | ||
28 | |||
29 | COMPATIBLE_MACHINE ?= "(intel-corei7-64|intel-core2-32)" | ||
30 | |||
31 | # Functionality flags | ||
32 | KERNEL_FEATURES_append = " ${KERNEL_EXTRA_FEATURES}" | ||
33 | KERNEL_FEATURES_append = " ${@bb.utils.contains("TUNE_FEATURES", "mx32", " cfg/x32.scc", "" ,d)}" | ||
34 | KERNEL_EXTRA_FEATURES ?= "features/netfilter/netfilter.scc features/security/security.scc" | ||
diff --git a/recipes-kernel/linux/linux-intel-rt_4.14.bb b/recipes-kernel/linux/linux-intel-rt_4.14.bb deleted file mode 100644 index ddf3a1bc..00000000 --- a/recipes-kernel/linux/linux-intel-rt_4.14.bb +++ /dev/null | |||
@@ -1,25 +0,0 @@ | |||
1 | require linux-intel.inc | ||
2 | |||
3 | # Skip processing of this recipe if it is not explicitly specified as the | ||
4 | # PREFERRED_PROVIDER for virtual/kernel. This avoids errors when trying | ||
5 | # to build multiple virtual/kernel providers, e.g. as dependency of | ||
6 | # core-image-rt-sdk, core-image-rt. | ||
7 | python () { | ||
8 | if d.getVar("KERNEL_PACKAGE_NAME", True) == "kernel" and d.getVar("PREFERRED_PROVIDER_virtual/kernel") != "linux-intel-rt": | ||
9 | raise bb.parse.SkipPackage("Set PREFERRED_PROVIDER_virtual/kernel to linux-intel-rt to enable it") | ||
10 | } | ||
11 | |||
12 | KBRANCH = "4.14/preempt-rt" | ||
13 | KMETA_BRANCH = "yocto-4.14" | ||
14 | |||
15 | # Fix for 32-bit perf issue. Remove when patch is backported to 4.14. | ||
16 | SRC_URI_append = " file://0001-perf-x86-32-explicitly-include-errno.h.patch \ | ||
17 | file://0001-perf-tools-Add-Python-3-support.patch" | ||
18 | |||
19 | DEPENDS += "elfutils-native openssl-native util-linux-native" | ||
20 | |||
21 | LINUX_VERSION ?= "4.14.146" | ||
22 | SRCREV_machine ?= "f8e35039bf37038f1cba7b125e3c4fa49745072b" | ||
23 | SRCREV_meta ?= "c8f030fdbf6046dede4b7ce6c94b5b24221c250e" | ||
24 | |||
25 | LINUX_KERNEL_TYPE = "preempt-rt" | ||
diff --git a/recipes-kernel/linux/linux-intel-rt_4.19.bb b/recipes-kernel/linux/linux-intel-rt_4.19.bb deleted file mode 100644 index a38ac388..00000000 --- a/recipes-kernel/linux/linux-intel-rt_4.19.bb +++ /dev/null | |||
@@ -1,24 +0,0 @@ | |||
1 | require linux-intel.inc | ||
2 | |||
3 | # Skip processing of this recipe if it is not explicitly specified as the | ||
4 | # PREFERRED_PROVIDER for virtual/kernel. This avoids errors when trying | ||
5 | # to build multiple virtual/kernel providers, e.g. as dependency of | ||
6 | # core-image-rt-sdk, core-image-rt. | ||
7 | python () { | ||
8 | if d.getVar("KERNEL_PACKAGE_NAME", True) == "kernel" and d.getVar("PREFERRED_PROVIDER_virtual/kernel") != "linux-intel-rt": | ||
9 | raise bb.parse.SkipPackage("Set PREFERRED_PROVIDER_virtual/kernel to linux-intel-rt to enable it") | ||
10 | } | ||
11 | |||
12 | LIC_FILES_CHKSUM = "file://COPYING;md5=bbea815ee2795b2f4230826c0c6b8814" | ||
13 | SRC_URI_append = " file://0001-menuconfig-mconf-cfg-Allow-specification-of-ncurses-.patch" | ||
14 | |||
15 | KBRANCH = "4.19/preempt-rt" | ||
16 | KMETA_BRANCH = "yocto-4.19" | ||
17 | |||
18 | DEPENDS += "elfutils-native openssl-native util-linux-native" | ||
19 | |||
20 | LINUX_VERSION ?= "4.19.72" | ||
21 | SRCREV_machine ?= "cf2e1ceb823576067ce01f02f1750a45c35adae5" | ||
22 | SRCREV_meta ?= "ad6f8b357720ca8167a090713b7746230cf4b314" | ||
23 | |||
24 | LINUX_KERNEL_TYPE = "preempt-rt" | ||
diff --git a/recipes-kernel/linux/linux-intel-rt_6.6.bb b/recipes-kernel/linux/linux-intel-rt_6.6.bb new file mode 100644 index 00000000..342679eb --- /dev/null +++ b/recipes-kernel/linux/linux-intel-rt_6.6.bb | |||
@@ -0,0 +1,33 @@ | |||
1 | require linux-intel.inc | ||
2 | |||
3 | SRC_URI:prepend = "git://github.com/intel/linux-intel-lts.git;protocol=https;name=machine;branch=${KBRANCH}; \ | ||
4 | " | ||
5 | |||
6 | # Skip processing of this recipe if it is not explicitly specified as the | ||
7 | # PREFERRED_PROVIDER for virtual/kernel. This avoids errors when trying | ||
8 | # to build multiple virtual/kernel providers, e.g. as dependency of | ||
9 | # core-image-rt-sdk, core-image-rt. | ||
10 | python () { | ||
11 | if d.getVar("KERNEL_PACKAGE_NAME", True) == "kernel" and d.getVar("PREFERRED_PROVIDER_virtual/kernel") != "linux-intel-rt": | ||
12 | raise bb.parse.SkipPackage("Set PREFERRED_PROVIDER_virtual/kernel to linux-intel-rt to enable it") | ||
13 | } | ||
14 | |||
15 | KBRANCH = "6.6/preempt-rt" | ||
16 | KMETA_BRANCH = "yocto-6.6" | ||
17 | |||
18 | LIC_FILES_CHKSUM = "file://COPYING;md5=6bc538ed5bd9a7fc9398086aedcd7e46" | ||
19 | |||
20 | DEPENDS += "elfutils-native openssl-native util-linux-native" | ||
21 | |||
22 | LINUX_VERSION_EXTENSION ??= "-intel-pk-${LINUX_KERNEL_TYPE}" | ||
23 | |||
24 | LINUX_VERSION ?= "6.6.25" | ||
25 | SRCREV_machine ?= "f8939454cf9bb7277239bb44e90c99474c599f37" | ||
26 | SRCREV_meta ?= "c3d1322fb6ff68cdcf4d7a3c1140d81bfdc1320a" | ||
27 | |||
28 | LINUX_KERNEL_TYPE = "preempt-rt" | ||
29 | |||
30 | # Functionality flags | ||
31 | KERNEL_EXTRA_FEATURES ?= "features/netfilter/netfilter.scc features/security/security.scc" | ||
32 | |||
33 | UPSTREAM_CHECK_GITTAGREGEX = "^lts-(?P<pver>v6.6.(\d+)-rt(\d)-preempt-rt-(\d+)T(\d+)Z)$" | ||
diff --git a/recipes-kernel/linux/linux-intel.inc b/recipes-kernel/linux/linux-intel.inc index f2ba0d13..f78f5205 100644 --- a/recipes-kernel/linux/linux-intel.inc +++ b/recipes-kernel/linux/linux-intel.inc | |||
@@ -1,25 +1,24 @@ | |||
1 | require recipes-kernel/linux/linux-yocto.inc | 1 | require recipes-kernel/linux/linux-yocto.inc |
2 | require recipes-kernel/linux/meta-intel-compat-kernel.inc | 2 | require recipes-kernel/linux/meta-intel-compat-kernel.inc |
3 | 3 | ||
4 | FILESEXTRAPATHS_prepend := "${THISDIR}/linux-intel:" | 4 | FILESEXTRAPATHS:prepend := "${THISDIR}/linux-intel:" |
5 | 5 | ||
6 | KERNEL_CONFIG_URI ?= "git://git.yoctoproject.org/yocto-kernel-cache;type=kmeta;name=meta;branch=${KMETA_BRANCH};destsuffix=${KMETA}" | 6 | KERNEL_CONFIG_URI ?= "git://git.yoctoproject.org/yocto-kernel-cache;type=kmeta;name=meta;branch=${KMETA_BRANCH};destsuffix=${KMETA}" |
7 | 7 | ||
8 | SRC_URI = " \ | 8 | SRC_URI = " \ |
9 | git://github.com/intel/linux-intel-lts.git;protocol=https;name=machine;branch=${KBRANCH}; \ | ||
10 | ${KERNEL_CONFIG_URI} \ | 9 | ${KERNEL_CONFIG_URI} \ |
10 | file://0001-vt-conmakehash-improve-reproducibility.patch \ | ||
11 | file://0001-lib-build_OID_registry-fix-reproducibility-issues.patch \ | ||
12 | file://fix-perf-reproducibility.patch \ | ||
13 | file://0001-menuconfig-mconf-cfg-Allow-specification-of-ncurses-.patch \ | ||
14 | file://0002-mconf-fix-output-of-cflags-and-libraries.patch \ | ||
11 | " | 15 | " |
12 | 16 | ||
13 | SRC_URI_append_core2-32-intel-common = " file://disable_skylake_sound.cfg" | ||
14 | |||
15 | LINUX_VERSION_EXTENSION ?= "-intel-pk-${LINUX_KERNEL_TYPE}" | ||
16 | |||
17 | PV = "${LINUX_VERSION}+git${SRCPV}" | 17 | PV = "${LINUX_VERSION}+git${SRCPV}" |
18 | 18 | ||
19 | KMETA = "kernel-meta" | 19 | KMETA = "kernel-meta" |
20 | KCONF_BSP_AUDIT_LEVEL = "2" | 20 | KCONF_BSP_AUDIT_LEVEL = "0" |
21 | 21 | ||
22 | COMPATIBLE_MACHINE ?= "(intel-corei7-64|intel-core2-32)" | 22 | COMPATIBLE_MACHINE ?= "(intel-corei7-64)" |
23 | 23 | ||
24 | KERNEL_FEATURES_append = " ${KERNEL_EXTRA_FEATURES}" | 24 | KERNEL_FEATURES:append = " ${KERNEL_EXTRA_FEATURES}" |
25 | KERNEL_FEATURES_append = " ${@bb.utils.contains("TUNE_FEATURES", "mx32", " cfg/x32.scc", "" ,d)}" | ||
diff --git a/recipes-kernel/linux/linux-intel/0001-lib-build_OID_registry-fix-reproducibility-issues.patch b/recipes-kernel/linux/linux-intel/0001-lib-build_OID_registry-fix-reproducibility-issues.patch new file mode 100644 index 00000000..d41c3f0b --- /dev/null +++ b/recipes-kernel/linux/linux-intel/0001-lib-build_OID_registry-fix-reproducibility-issues.patch | |||
@@ -0,0 +1,48 @@ | |||
1 | From 2fca0fd719812ea2ff67630b01355aa80481623e Mon Sep 17 00:00:00 2001 | ||
2 | From: Bruce Ashfield <bruce.ashfield@gmail.com> | ||
3 | Date: Sun, 10 Jul 2022 22:56:53 -0400 | ||
4 | Subject: [PATCH] lib/build_OID_registry: fix reproducibility issues | ||
5 | |||
6 | The script build_OID_registry captures the full path of itself | ||
7 | in the generated data. This causes reproduciblity issues as the | ||
8 | path is captured and packaged. | ||
9 | |||
10 | We use the basename of the script instead, and that allows us | ||
11 | to be reprodicible, with slightly less information captured in | ||
12 | the output data (but the generating script can still easily | ||
13 | be found). | ||
14 | |||
15 | Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com> | ||
16 | Upstream-Status: Inappropriate | ||
17 | |||
18 | Taken from linux-yocto, v5.15/standard/base. | ||
19 | |||
20 | Signed-off-by: Anuj Mittal <anuj.mittal@intel.com> | ||
21 | --- | ||
22 | lib/build_OID_registry | 3 ++- | ||
23 | 1 file changed, 2 insertions(+), 1 deletion(-) | ||
24 | |||
25 | diff --git a/lib/build_OID_registry b/lib/build_OID_registry | ||
26 | index d7fc32ea8ac2..f6de0a7f7457 100755 | ||
27 | --- a/lib/build_OID_registry | ||
28 | +++ b/lib/build_OID_registry | ||
29 | @@ -8,6 +8,7 @@ | ||
30 | # | ||
31 | |||
32 | use strict; | ||
33 | +use File::Basename; | ||
34 | |||
35 | my @names = (); | ||
36 | my @oids = (); | ||
37 | @@ -35,7 +36,7 @@ close IN_FILE || die; | ||
38 | # | ||
39 | open C_FILE, ">$ARGV[1]" or die; | ||
40 | print C_FILE "/*\n"; | ||
41 | -print C_FILE " * Automatically generated by ", $0, ". Do not edit\n"; | ||
42 | +print C_FILE " * Automatically generated by ", basename $0, ". Do not edit\n"; | ||
43 | print C_FILE " */\n"; | ||
44 | |||
45 | # | ||
46 | -- | ||
47 | 2.36.1 | ||
48 | |||
diff --git a/recipes-kernel/linux/linux-intel/0001-menuconfig-check-lxdiaglog.sh-Allow-specification-of.patch b/recipes-kernel/linux/linux-intel/0001-menuconfig-check-lxdiaglog.sh-Allow-specification-of.patch deleted file mode 100644 index a9e9213b..00000000 --- a/recipes-kernel/linux/linux-intel/0001-menuconfig-check-lxdiaglog.sh-Allow-specification-of.patch +++ /dev/null | |||
@@ -1,62 +0,0 @@ | |||
1 | From e6ebc8e654bba53f28af5229a1069fc74fa58b7b Mon Sep 17 00:00:00 2001 | ||
2 | From: Jason Wessel <jason.wessel@windriver.com> | ||
3 | Date: Thu, 25 Sep 2014 11:26:49 -0700 | ||
4 | Subject: [PATCH] menuconfig,check-lxdiaglog.sh: Allow specification of ncurses | ||
5 | location | ||
6 | |||
7 | In some cross build environments such as the Yocto Project build | ||
8 | environment it provides an ncurses library that is compiled | ||
9 | differently than the host's version. This causes display corruption | ||
10 | problems when the host's curses includes are used instead of the | ||
11 | includes from the provided compiler are overridden. There is a second | ||
12 | case where there is no curses libraries at all on the host system and | ||
13 | menuconfig will just fail entirely. | ||
14 | |||
15 | The solution is simply to allow an override variable in | ||
16 | check-lxdialog.sh for environments such as the Yocto Project. Adding | ||
17 | a CROSS_CURSES_LIB and CROSS_CURSES_INC solves the issue and allowing | ||
18 | compiling and linking against the right headers and libraries. | ||
19 | |||
20 | Upstream-Status: submitted [https://lkml.org/lkml/2013/3/3/103] | ||
21 | |||
22 | Signed-off-by: Jason Wessel <jason.wessel@windriver.com> | ||
23 | cc: Michal Marek <mmarek@suse.cz> | ||
24 | cc: linux-kbuild@vger.kernel.org | ||
25 | Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com> | ||
26 | Signed-off-by: California Sullivan <california.l.sullivan@intel.com> | ||
27 | --- | ||
28 | scripts/kconfig/lxdialog/check-lxdialog.sh | 8 ++++++++ | ||
29 | 1 file changed, 8 insertions(+) | ||
30 | mode change 100755 => 100644 scripts/kconfig/lxdialog/check-lxdialog.sh | ||
31 | |||
32 | diff --git a/scripts/kconfig/lxdialog/check-lxdialog.sh b/scripts/kconfig/lxdialog/check-lxdialog.sh | ||
33 | old mode 100755 | ||
34 | new mode 100644 | ||
35 | index 5075ebf2d3b9..ba9242101190 | ||
36 | --- a/scripts/kconfig/lxdialog/check-lxdialog.sh | ||
37 | +++ b/scripts/kconfig/lxdialog/check-lxdialog.sh | ||
38 | @@ -4,6 +4,10 @@ | ||
39 | # What library to link | ||
40 | ldflags() | ||
41 | { | ||
42 | + if [ "$CROSS_CURSES_LIB" != "" ]; then | ||
43 | + echo "$CROSS_CURSES_LIB" | ||
44 | + exit | ||
45 | + fi | ||
46 | pkg-config --libs ncursesw 2>/dev/null && exit | ||
47 | pkg-config --libs ncurses 2>/dev/null && exit | ||
48 | for ext in so a dll.a dylib ; do | ||
49 | @@ -21,6 +25,10 @@ ldflags() | ||
50 | # Where is ncurses.h? | ||
51 | ccflags() | ||
52 | { | ||
53 | + if [ x"$CROSS_CURSES_INC" != x ]; then | ||
54 | + echo "$CROSS_CURSES_INC" | ||
55 | + exit | ||
56 | + fi | ||
57 | if pkg-config --cflags ncursesw 2>/dev/null; then | ||
58 | echo '-DCURSES_LOC="<ncurses.h>" -DNCURSES_WIDECHAR=1' | ||
59 | elif pkg-config --cflags ncurses 2>/dev/null; then | ||
60 | -- | ||
61 | 2.14.3 | ||
62 | |||
diff --git a/recipes-kernel/linux/linux-intel/0001-menuconfig-mconf-cfg-Allow-specification-of-ncurses-.patch b/recipes-kernel/linux/linux-intel/0001-menuconfig-mconf-cfg-Allow-specification-of-ncurses-.patch index 3dc71ff2..a601e783 100644 --- a/recipes-kernel/linux/linux-intel/0001-menuconfig-mconf-cfg-Allow-specification-of-ncurses-.patch +++ b/recipes-kernel/linux/linux-intel/0001-menuconfig-mconf-cfg-Allow-specification-of-ncurses-.patch | |||
@@ -1,7 +1,8 @@ | |||
1 | From bebd63730a433ba62549a80114a9851328aa8897 Mon Sep 17 00:00:00 2001 | 1 | From 1811da09f42ca5e82282970e8ad014707bc94c82 Mon Sep 17 00:00:00 2001 |
2 | From: Bruce Ashfield <bruce.ashfield@windriver.com> | 2 | From: Bruce Ashfield <bruce.ashfield@windriver.com> |
3 | Date: Mon, 2 Jul 2018 23:10:28 -0400 | 3 | Date: Mon, 2 Jul 2018 23:10:28 -0400 |
4 | Subject: [PATCH] menuconfig,mconf-cfg: Allow specification of ncurses location | 4 | Subject: [PATCH 1/2] menuconfig,mconf-cfg: Allow specification of ncurses |
5 | location | ||
5 | 6 | ||
6 | In some cross build environments such as the Yocto Project build | 7 | In some cross build environments such as the Yocto Project build |
7 | environment it provides an ncurses library that is compiled | 8 | environment it provides an ncurses library that is compiled |
@@ -16,33 +17,36 @@ check-lxdialog.sh for environments such as the Yocto Project. Adding | |||
16 | a CROSS_CURSES_LIB and CROSS_CURSES_INC solves the issue and allowing | 17 | a CROSS_CURSES_LIB and CROSS_CURSES_INC solves the issue and allowing |
17 | compiling and linking against the right headers and libraries. | 18 | compiling and linking against the right headers and libraries. |
18 | 19 | ||
20 | Upstream-Status: Submitted | ||
21 | |||
19 | Signed-off-by: Jason Wessel <jason.wessel@windriver.com> | 22 | Signed-off-by: Jason Wessel <jason.wessel@windriver.com> |
20 | cc: Michal Marek <mmarek@suse.cz> | 23 | cc: Michal Marek <mmarek@suse.cz> |
21 | cc: linux-kbuild@vger.kernel.org | 24 | cc: linux-kbuild@vger.kernel.org |
22 | Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com> | 25 | Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com> |
26 | Signed-off-by: Naveen Saini <naveen.kumar.saini@intel.com> | ||
23 | --- | 27 | --- |
24 | scripts/kconfig/mconf-cfg.sh | 8 ++++++++ | 28 | scripts/kconfig/mconf-cfg.sh | 8 ++++++++ |
25 | 1 file changed, 8 insertions(+) | 29 | 1 file changed, 8 insertions(+) |
26 | 30 | ||
27 | diff --git a/scripts/kconfig/mconf-cfg.sh b/scripts/kconfig/mconf-cfg.sh | 31 | diff --git a/scripts/kconfig/mconf-cfg.sh b/scripts/kconfig/mconf-cfg.sh |
28 | index c812872d7f9d..42d20819025c 100755 | 32 | index 1e61f50a5905..38cf8304bb31 100755 |
29 | --- a/scripts/kconfig/mconf-cfg.sh | 33 | --- a/scripts/kconfig/mconf-cfg.sh |
30 | +++ b/scripts/kconfig/mconf-cfg.sh | 34 | +++ b/scripts/kconfig/mconf-cfg.sh |
31 | @@ -4,6 +4,14 @@ | 35 | @@ -7,6 +7,14 @@ libs=$2 |
32 | PKG="ncursesw" | 36 | PKG="ncursesw" |
33 | PKG2="ncurses" | 37 | PKG2="ncurses" |
34 | 38 | ||
35 | +if [ "$CROSS_CURSES_LIB" != "" ]; then | 39 | +if [ "$CROSS_CURSES_LIB" != "" ]; then |
36 | + echo libs=\'$CROSS_CURSES_LIB\' | 40 | + echo libs=\'$CROSS_CURSES_LIB\' |
37 | + if [ x"$CROSS_CURSES_INC" != x ]; then | 41 | + if [ x"$CROSS_CURSES_INC" != x ]; then |
38 | + echo cflags=\'$CROSS_CURSES_INC\' | 42 | + echo cflags=\'$CROSS_CURSES_INC\' |
39 | + fi | 43 | + fi |
40 | + exit 0 | 44 | + exit 0 |
41 | +fi | 45 | +fi |
42 | + | 46 | + |
43 | if [ -n "$(command -v pkg-config)" ]; then | 47 | if [ -n "$(command -v ${HOSTPKG_CONFIG})" ]; then |
44 | if pkg-config --exists $PKG; then | 48 | if ${HOSTPKG_CONFIG} --exists $PKG; then |
45 | echo cflags=\"$(pkg-config --cflags $PKG)\" | 49 | ${HOSTPKG_CONFIG} --cflags ${PKG} > ${cflags} |
46 | -- | 50 | -- |
47 | 2.17.1 | 51 | 2.34.1 |
48 | 52 | ||
diff --git a/recipes-kernel/linux/linux-intel/0001-perf-tools-Add-Python-3-support.patch b/recipes-kernel/linux/linux-intel/0001-perf-tools-Add-Python-3-support.patch deleted file mode 100644 index 74ce61e5..00000000 --- a/recipes-kernel/linux/linux-intel/0001-perf-tools-Add-Python-3-support.patch +++ /dev/null | |||
@@ -1,917 +0,0 @@ | |||
1 | From 8804547988bb772a00cd4bb832fe4e1a79f552b7 Mon Sep 17 00:00:00 2001 | ||
2 | From: =?UTF-8?q?Jaroslav=20=C5=A0karvada?= <jskarvad@redhat.com> | ||
3 | Date: Fri, 19 Jan 2018 21:56:41 +0100 | ||
4 | Subject: [PATCH] perf tools: Add Python 3 support | ||
5 | MIME-Version: 1.0 | ||
6 | Content-Type: text/plain; charset=UTF-8 | ||
7 | Content-Transfer-Encoding: 8bit | ||
8 | |||
9 | Added Python 3 support while keeping Python 2.7 compatibility. | ||
10 | |||
11 | Committer notes: | ||
12 | |||
13 | This doesn't make it to auto detect python 3, one has to explicitely ask | ||
14 | it to build with python 3 devel files, here are the instructions | ||
15 | provided by Jaroslav: | ||
16 | |||
17 | --- | ||
18 | $ cp -a tools/perf tools/python3-perf | ||
19 | $ make V=1 prefix=/usr -C tools/perf PYTHON=/usr/bin/python2 all | ||
20 | $ make V=1 prefix=/usr -C tools/python3-perf PYTHON=/usr/bin/python3 all | ||
21 | $ make V=1 prefix=/usr -C tools/python3-perf PYTHON=/usr/bin/python3 DESTDIR=%{buildroot} install-python_ext | ||
22 | $ make V=1 prefix=/usr -C tools/perf PYTHON=/usr/bin/python2 DESTDIR=%{buildroot} install-python_ext | ||
23 | --- | ||
24 | |||
25 | We need to make this automatic, just like the existing tests for checking if | ||
26 | the python2 devel files are in place, allowing the build with python3 if | ||
27 | available, fallbacking to python2 and then just disabling it if none are | ||
28 | available. | ||
29 | |||
30 | So, using the PYTHON variable to build it using O= we get: | ||
31 | |||
32 | Before this patch: | ||
33 | |||
34 | $ rpm -q python3 python3-devel | ||
35 | python3-3.6.4-7.fc27.x86_64 | ||
36 | python3-devel-3.6.4-7.fc27.x86_64 | ||
37 | $ rm -rf /tmp/build/perf/ ; mkdir -p /tmp/build/perf ; make O=/tmp/build/perf PYTHON=/usr/bin/python3 -C tools/perf install-bin | ||
38 | make: Entering directory '/home/acme/git/linux/tools/perf' | ||
39 | <SNIP> | ||
40 | Makefile.config:670: Python 3 is not yet supported; please set | ||
41 | Makefile.config:671: PYTHON and/or PYTHON_CONFIG appropriately. | ||
42 | Makefile.config:672: If you also have Python 2 installed, then | ||
43 | Makefile.config:673: try something like: | ||
44 | Makefile.config:674: | ||
45 | Makefile.config:675: make PYTHON=python2 | ||
46 | Makefile.config:676: | ||
47 | Makefile.config:677: Otherwise, disable Python support entirely: | ||
48 | Makefile.config:678: | ||
49 | Makefile.config:679: make NO_LIBPYTHON=1 | ||
50 | Makefile.config:680: | ||
51 | Makefile.config:681: *** . Stop. | ||
52 | make[1]: *** [Makefile.perf:212: sub-make] Error 2 | ||
53 | make: *** [Makefile:110: install-bin] Error 2 | ||
54 | make: Leaving directory '/home/acme/git/linux/tools/perf' | ||
55 | $ | ||
56 | |||
57 | After: | ||
58 | |||
59 | $ make O=/tmp/build/perf PYTHON=python3 -C tools/perf install-bin | ||
60 | $ ldd ~/bin/perf | grep python | ||
61 | libpython3.6m.so.1.0 => /lib64/libpython3.6m.so.1.0 (0x00007f58a31e8000) | ||
62 | $ rpm -qf /lib64/libpython3.6m.so.1.0 | ||
63 | python3-libs-3.6.4-7.fc27.x86_64 | ||
64 | $ | ||
65 | |||
66 | Now verify that when using the binding the right ELF file is loaded, | ||
67 | using perf trace: | ||
68 | |||
69 | $ perf trace -e open* perf test python | ||
70 | 0.051 ( 0.016 ms): perf/3927 openat(dfd: CWD, filename: /etc/ld.so.cache, flags: CLOEXEC ) = 3 | ||
71 | <SNIP> | ||
72 | 18: 'import perf' in python : | ||
73 | 8.849 ( 0.013 ms): sh/3929 openat(dfd: CWD, filename: /etc/ld.so.cache, flags: CLOEXEC ) = 3 | ||
74 | <SNIP> | ||
75 | 25.572 ( 0.008 ms): python3/3931 openat(dfd: CWD, filename: /tmp/build/perf/python/perf.cpython-36m-x86_64-linux-gnu.so, flags: CLOEXEC) = 3 | ||
76 | <SNIP> | ||
77 | Ok | ||
78 | <SNIP> | ||
79 | $ | ||
80 | |||
81 | And using tools/perf/python/twatch.py, to show PERF_RECORD_ metaevents: | ||
82 | |||
83 | $ python3 tools/perf/python/twatch.py | ||
84 | cpu: 3, pid: 16060, tid: 16060 { type: fork, pid: 5207, ppid: 16060, tid: 5207, ptid: 16060, time: 10798513015459} | ||
85 | cpu: 3, pid: 16060, tid: 16060 { type: fork, pid: 5208, ppid: 16060, tid: 5208, ptid: 16060, time: 10798513562503} | ||
86 | cpu: 0, pid: 5208, tid: 5208 { type: comm, pid: 5208, tid: 5208, comm: grep } | ||
87 | cpu: 2, pid: 5207, tid: 5207 { type: comm, pid: 5207, tid: 5207, comm: ps } | ||
88 | cpu: 2, pid: 5207, tid: 5207 { type: exit, pid: 5207, ppid: 5207, tid: 5207, ptid: 5207, time: 10798551337484} | ||
89 | cpu: 3, pid: 5208, tid: 5208 { type: exit, pid: 5208, ppid: 5208, tid: 5208, ptid: 5208, time: 10798551292153} | ||
90 | cpu: 3, pid: 601, tid: 601 { type: fork, pid: 5209, ppid: 601, tid: 5209, ptid: 601, time: 10801779977324} | ||
91 | ^CTraceback (most recent call last): | ||
92 | File "tools/perf/python/twatch.py", line 68, in <module> | ||
93 | main() | ||
94 | File "tools/perf/python/twatch.py", line 40, in main | ||
95 | evlist.poll(timeout = -1) | ||
96 | KeyboardInterrupt | ||
97 | $ | ||
98 | |||
99 | # ps ax|grep twatch | ||
100 | 5197 pts/8 S+ 0:00 python3 tools/perf/python/twatch.py | ||
101 | # ls -la /proc/5197/smaps | ||
102 | -r--r--r--. 1 acme acme 0 Feb 19 13:14 /proc/5197/smaps | ||
103 | # grep python /proc/5197/smaps | ||
104 | 558111307000-558111309000 r-xp 00000000 fd:00 3151710 /usr/bin/python3.6 | ||
105 | 558111508000-558111509000 r--p 00001000 fd:00 3151710 /usr/bin/python3.6 | ||
106 | 558111509000-55811150a000 rw-p 00002000 fd:00 3151710 /usr/bin/python3.6 | ||
107 | 7ffad6fc1000-7ffad7008000 r-xp 00000000 00:2d 220196 /tmp/build/perf/python/perf.cpython-36m-x86_64-linux-gnu.so | ||
108 | 7ffad7008000-7ffad7207000 ---p 00047000 00:2d 220196 /tmp/build/perf/python/perf.cpython-36m-x86_64-linux-gnu.so | ||
109 | 7ffad7207000-7ffad7208000 r--p 00046000 00:2d 220196 /tmp/build/perf/python/perf.cpython-36m-x86_64-linux-gnu.so | ||
110 | 7ffad7208000-7ffad7215000 rw-p 00047000 00:2d 220196 /tmp/build/perf/python/perf.cpython-36m-x86_64-linux-gnu.so | ||
111 | 7ffadea77000-7ffaded3d000 r-xp 00000000 fd:00 3151795 /usr/lib64/libpython3.6m.so.1.0 | ||
112 | 7ffaded3d000-7ffadef3c000 ---p 002c6000 fd:00 3151795 /usr/lib64/libpython3.6m.so.1.0 | ||
113 | 7ffadef3c000-7ffadef42000 r--p 002c5000 fd:00 3151795 /usr/lib64/libpython3.6m.so.1.0 | ||
114 | 7ffadef42000-7ffadefa5000 rw-p 002cb000 fd:00 3151795 /usr/lib64/libpython3.6m.so.1.0 | ||
115 | # | ||
116 | |||
117 | And with this patch, but building normally, without specifying the | ||
118 | PYTHON=python3 part, which will make it use python2 if its devel files are | ||
119 | available, like in this test: | ||
120 | |||
121 | $ make O=/tmp/build/perf -C tools/perf install-bin | ||
122 | $ ldd ~/bin/perf | grep python | ||
123 | libpython2.7.so.1.0 => /lib64/libpython2.7.so.1.0 (0x00007f6a44410000) | ||
124 | $ ldd /tmp/build/perf/python_ext_build/lib/perf.so | grep python | ||
125 | libpython2.7.so.1.0 => /lib64/libpython2.7.so.1.0 (0x00007fed28a2c000) | ||
126 | $ | ||
127 | |||
128 | [acme@jouet perf]$ tools/perf/python/twatch.py | ||
129 | cpu: 0, pid: 2817, tid: 2817 { type: fork, pid: 2817, ppid: 2817, tid: 8910, ptid: 2817, time: 11126454335306} | ||
130 | cpu: 0, pid: 2817, tid: 2817 { type: comm, pid: 2817, tid: 8910, comm: worker } | ||
131 | $ ps ax | grep twatch.py | ||
132 | 8909 pts/8 S+ 0:00 /usr/bin/python tools/perf/python/twatch.py | ||
133 | $ grep python /proc/8909/smaps | ||
134 | 5579de658000-5579de659000 r-xp 00000000 fd:00 3156044 /usr/bin/python2.7 | ||
135 | 5579de858000-5579de859000 r--p 00000000 fd:00 3156044 /usr/bin/python2.7 | ||
136 | 5579de859000-5579de85a000 rw-p 00001000 fd:00 3156044 /usr/bin/python2.7 | ||
137 | 7f0de01f7000-7f0de023e000 r-xp 00000000 00:2d 230695 /tmp/build/perf/python/perf.so | ||
138 | 7f0de023e000-7f0de043d000 ---p 00047000 00:2d 230695 /tmp/build/perf/python/perf.so | ||
139 | 7f0de043d000-7f0de043e000 r--p 00046000 00:2d 230695 /tmp/build/perf/python/perf.so | ||
140 | 7f0de043e000-7f0de044b000 rw-p 00047000 00:2d 230695 /tmp/build/perf/python/perf.so | ||
141 | 7f0de6f0f000-7f0de6f13000 r-xp 00000000 fd:00 134975 /usr/lib64/python2.7/lib-dynload/_localemodule.so | ||
142 | 7f0de6f13000-7f0de7113000 ---p 00004000 fd:00 134975 /usr/lib64/python2.7/lib-dynload/_localemodule.so | ||
143 | 7f0de7113000-7f0de7114000 r--p 00004000 fd:00 134975 /usr/lib64/python2.7/lib-dynload/_localemodule.so | ||
144 | 7f0de7114000-7f0de7115000 rw-p 00005000 fd:00 134975 /usr/lib64/python2.7/lib-dynload/_localemodule.so | ||
145 | 7f0de7e73000-7f0de8052000 r-xp 00000000 fd:00 3173292 /usr/lib64/libpython2.7.so.1.0 | ||
146 | 7f0de8052000-7f0de8251000 ---p 001df000 fd:00 3173292 /usr/lib64/libpython2.7.so.1.0 | ||
147 | 7f0de8251000-7f0de8255000 r--p 001de000 fd:00 3173292 /usr/lib64/libpython2.7.so.1.0 | ||
148 | 7f0de8255000-7f0de8291000 rw-p 001e2000 fd:00 3173292 /usr/lib64/libpython2.7.so.1.0 | ||
149 | $ | ||
150 | |||
151 | Signed-off-by: Jaroslav Å karvada <jskarvad@redhat.com> | ||
152 | Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com> | ||
153 | Cc: Adrian Hunter <adrian.hunter@intel.com> | ||
154 | Cc: David Ahern <dsahern@gmail.com> | ||
155 | Cc: Jiri Olsa <jolsa@kernel.org> | ||
156 | Cc: Namhyung Kim <namhyung@kernel.org> | ||
157 | Cc: Wang Nan <wangnan0@huawei.com> | ||
158 | LPU-Reference: 20180119205641.24242-1-jskarvad@redhat.com | ||
159 | Link: https://lkml.kernel.org/n/tip-8d7dt9kqp83vsz25hagug8fu@git.kernel.org | ||
160 | [ Removed explicit check for python version, allowing it to really build with python3 ] | ||
161 | Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> | ||
162 | |||
163 | Upstream status: Backport [https://github.com/torvalds/linux/commit/66dfdff03d196e51322c6a85c0d8db8bb2bdd655] | ||
164 | Signed-off-by: Naveen Saini <naveen.kumar.saini@intel.com> | ||
165 | --- | ||
166 | tools/perf/Makefile.config | 23 +-- | ||
167 | tools/perf/Makefile.perf | 4 +- | ||
168 | .../scripts/python/Perf-Trace-Util/Context.c | 34 +++- | ||
169 | tools/perf/util/python.c | 95 ++++++++--- | ||
170 | .../scripting-engines/trace-event-python.c | 147 +++++++++++++----- | ||
171 | tools/perf/util/setup.py | 6 +- | ||
172 | 6 files changed, 221 insertions(+), 88 deletions(-) | ||
173 | |||
174 | diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config | ||
175 | index f362ee46506a..ecdc3770d899 100644 | ||
176 | --- a/tools/perf/Makefile.config | ||
177 | +++ b/tools/perf/Makefile.config | ||
178 | @@ -622,25 +622,10 @@ else | ||
179 | ifneq ($(feature-libpython), 1) | ||
180 | $(call disable-python,No 'Python.h' (for Python 2.x support) was found: disables Python support - please install python-devel/python-dev) | ||
181 | else | ||
182 | - ifneq ($(feature-libpython-version), 1) | ||
183 | - $(warning Python 3 is not yet supported; please set) | ||
184 | - $(warning PYTHON and/or PYTHON_CONFIG appropriately.) | ||
185 | - $(warning If you also have Python 2 installed, then) | ||
186 | - $(warning try something like:) | ||
187 | - $(warning $(and ,)) | ||
188 | - $(warning $(and ,) make PYTHON=python2) | ||
189 | - $(warning $(and ,)) | ||
190 | - $(warning Otherwise, disable Python support entirely:) | ||
191 | - $(warning $(and ,)) | ||
192 | - $(warning $(and ,) make NO_LIBPYTHON=1) | ||
193 | - $(warning $(and ,)) | ||
194 | - $(error $(and ,)) | ||
195 | - else | ||
196 | - LDFLAGS += $(PYTHON_EMBED_LDFLAGS) | ||
197 | - EXTLIBS += $(PYTHON_EMBED_LIBADD) | ||
198 | - LANG_BINDINGS += $(obj-perf)python/perf.so | ||
199 | - $(call detected,CONFIG_LIBPYTHON) | ||
200 | - endif | ||
201 | + LDFLAGS += $(PYTHON_EMBED_LDFLAGS) | ||
202 | + EXTLIBS += $(PYTHON_EMBED_LIBADD) | ||
203 | + LANG_BINDINGS += $(obj-perf)python/perf.so | ||
204 | + $(call detected,CONFIG_LIBPYTHON) | ||
205 | endif | ||
206 | endif | ||
207 | endif | ||
208 | diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf | ||
209 | index 349ea5133d83..6879321c612d 100644 | ||
210 | --- a/tools/perf/Makefile.perf | ||
211 | +++ b/tools/perf/Makefile.perf | ||
212 | @@ -294,7 +294,7 @@ PYTHON_EXTBUILD_LIB := $(PYTHON_EXTBUILD)lib/ | ||
213 | PYTHON_EXTBUILD_TMP := $(PYTHON_EXTBUILD)tmp/ | ||
214 | export PYTHON_EXTBUILD_LIB PYTHON_EXTBUILD_TMP | ||
215 | |||
216 | -python-clean := $(call QUIET_CLEAN, python) $(RM) -r $(PYTHON_EXTBUILD) $(OUTPUT)python/perf.so | ||
217 | +python-clean := $(call QUIET_CLEAN, python) $(RM) -r $(PYTHON_EXTBUILD) $(OUTPUT)python/perf*.so | ||
218 | |||
219 | PYTHON_EXT_SRCS := $(shell grep -v ^\# util/python-ext-sources) | ||
220 | PYTHON_EXT_DEPS := util/python-ext-sources util/setup.py $(LIBTRACEEVENT) $(LIBAPI) | ||
221 | @@ -444,7 +444,7 @@ $(OUTPUT)python/perf.so: $(PYTHON_EXT_SRCS) $(PYTHON_EXT_DEPS) $(LIBTRACEEVENT_D | ||
222 | $(PYTHON_WORD) util/setup.py \ | ||
223 | --quiet build_ext; \ | ||
224 | mkdir -p $(OUTPUT)python && \ | ||
225 | - cp $(PYTHON_EXTBUILD_LIB)perf.so $(OUTPUT)python/ | ||
226 | + cp $(PYTHON_EXTBUILD_LIB)perf*.so $(OUTPUT)python/ | ||
227 | |||
228 | please_set_SHELL_PATH_to_a_more_modern_shell: | ||
229 | $(Q)$$(:) | ||
230 | diff --git a/tools/perf/scripts/python/Perf-Trace-Util/Context.c b/tools/perf/scripts/python/Perf-Trace-Util/Context.c | ||
231 | index fcd1dd667906..1a0d27757eec 100644 | ||
232 | --- a/tools/perf/scripts/python/Perf-Trace-Util/Context.c | ||
233 | +++ b/tools/perf/scripts/python/Perf-Trace-Util/Context.c | ||
234 | @@ -23,7 +23,17 @@ | ||
235 | #include "../../../perf.h" | ||
236 | #include "../../../util/trace-event.h" | ||
237 | |||
238 | +#if PY_MAJOR_VERSION < 3 | ||
239 | +#define _PyCapsule_GetPointer(arg1, arg2) \ | ||
240 | + PyCObject_AsVoidPtr(arg1) | ||
241 | + | ||
242 | PyMODINIT_FUNC initperf_trace_context(void); | ||
243 | +#else | ||
244 | +#define _PyCapsule_GetPointer(arg1, arg2) \ | ||
245 | + PyCapsule_GetPointer((arg1), (arg2)) | ||
246 | + | ||
247 | +PyMODINIT_FUNC PyInit_perf_trace_context(void); | ||
248 | +#endif | ||
249 | |||
250 | static PyObject *perf_trace_context_common_pc(PyObject *obj, PyObject *args) | ||
251 | { | ||
252 | @@ -34,7 +44,7 @@ static PyObject *perf_trace_context_common_pc(PyObject *obj, PyObject *args) | ||
253 | if (!PyArg_ParseTuple(args, "O", &context)) | ||
254 | return NULL; | ||
255 | |||
256 | - scripting_context = PyCObject_AsVoidPtr(context); | ||
257 | + scripting_context = _PyCapsule_GetPointer(context, NULL); | ||
258 | retval = common_pc(scripting_context); | ||
259 | |||
260 | return Py_BuildValue("i", retval); | ||
261 | @@ -50,7 +60,7 @@ static PyObject *perf_trace_context_common_flags(PyObject *obj, | ||
262 | if (!PyArg_ParseTuple(args, "O", &context)) | ||
263 | return NULL; | ||
264 | |||
265 | - scripting_context = PyCObject_AsVoidPtr(context); | ||
266 | + scripting_context = _PyCapsule_GetPointer(context, NULL); | ||
267 | retval = common_flags(scripting_context); | ||
268 | |||
269 | return Py_BuildValue("i", retval); | ||
270 | @@ -66,7 +76,7 @@ static PyObject *perf_trace_context_common_lock_depth(PyObject *obj, | ||
271 | if (!PyArg_ParseTuple(args, "O", &context)) | ||
272 | return NULL; | ||
273 | |||
274 | - scripting_context = PyCObject_AsVoidPtr(context); | ||
275 | + scripting_context = _PyCapsule_GetPointer(context, NULL); | ||
276 | retval = common_lock_depth(scripting_context); | ||
277 | |||
278 | return Py_BuildValue("i", retval); | ||
279 | @@ -82,7 +92,25 @@ static PyMethodDef ContextMethods[] = { | ||
280 | { NULL, NULL, 0, NULL} | ||
281 | }; | ||
282 | |||
283 | +#if PY_MAJOR_VERSION < 3 | ||
284 | PyMODINIT_FUNC initperf_trace_context(void) | ||
285 | { | ||
286 | (void) Py_InitModule("perf_trace_context", ContextMethods); | ||
287 | } | ||
288 | +#else | ||
289 | +PyMODINIT_FUNC PyInit_perf_trace_context(void) | ||
290 | +{ | ||
291 | + static struct PyModuleDef moduledef = { | ||
292 | + PyModuleDef_HEAD_INIT, | ||
293 | + "perf_trace_context", /* m_name */ | ||
294 | + "", /* m_doc */ | ||
295 | + -1, /* m_size */ | ||
296 | + ContextMethods, /* m_methods */ | ||
297 | + NULL, /* m_reload */ | ||
298 | + NULL, /* m_traverse */ | ||
299 | + NULL, /* m_clear */ | ||
300 | + NULL, /* m_free */ | ||
301 | + }; | ||
302 | + return PyModule_Create(&moduledef); | ||
303 | +} | ||
304 | +#endif | ||
305 | diff --git a/tools/perf/util/python.c b/tools/perf/util/python.c | ||
306 | index 8e49d9cafcfc..16620c37fd8c 100644 | ||
307 | --- a/tools/perf/util/python.c | ||
308 | +++ b/tools/perf/util/python.c | ||
309 | @@ -12,6 +12,30 @@ | ||
310 | #include "print_binary.h" | ||
311 | #include "thread_map.h" | ||
312 | |||
313 | +#if PY_MAJOR_VERSION < 3 | ||
314 | +#define _PyUnicode_FromString(arg) \ | ||
315 | + PyString_FromString(arg) | ||
316 | +#define _PyUnicode_AsString(arg) \ | ||
317 | + PyString_AsString(arg) | ||
318 | +#define _PyUnicode_FromFormat(...) \ | ||
319 | + PyString_FromFormat(__VA_ARGS__) | ||
320 | +#define _PyLong_FromLong(arg) \ | ||
321 | + PyInt_FromLong(arg) | ||
322 | + | ||
323 | +#else | ||
324 | + | ||
325 | +#define _PyUnicode_FromString(arg) \ | ||
326 | + PyUnicode_FromString(arg) | ||
327 | +#define _PyUnicode_FromFormat(...) \ | ||
328 | + PyUnicode_FromFormat(__VA_ARGS__) | ||
329 | +#define _PyLong_FromLong(arg) \ | ||
330 | + PyLong_FromLong(arg) | ||
331 | +#endif | ||
332 | + | ||
333 | +#ifndef Py_TYPE | ||
334 | +#define Py_TYPE(ob) (((PyObject*)(ob))->ob_type) | ||
335 | +#endif | ||
336 | + | ||
337 | /* | ||
338 | * Provide these two so that we don't have to link against callchain.c and | ||
339 | * start dragging hist.c, etc. | ||
340 | @@ -49,7 +73,11 @@ int eprintf(int level, int var, const char *fmt, ...) | ||
341 | # define PyVarObject_HEAD_INIT(type, size) PyObject_HEAD_INIT(type) size, | ||
342 | #endif | ||
343 | |||
344 | +#if PY_MAJOR_VERSION < 3 | ||
345 | PyMODINIT_FUNC initperf(void); | ||
346 | +#else | ||
347 | +PyMODINIT_FUNC PyInit_perf(void); | ||
348 | +#endif | ||
349 | |||
350 | #define member_def(type, member, ptype, help) \ | ||
351 | { #member, ptype, \ | ||
352 | @@ -107,7 +135,7 @@ static PyObject *pyrf_mmap_event__repr(struct pyrf_event *pevent) | ||
353 | pevent->event.mmap.pgoff, pevent->event.mmap.filename) < 0) { | ||
354 | ret = PyErr_NoMemory(); | ||
355 | } else { | ||
356 | - ret = PyString_FromString(s); | ||
357 | + ret = _PyUnicode_FromString(s); | ||
358 | free(s); | ||
359 | } | ||
360 | return ret; | ||
361 | @@ -138,7 +166,7 @@ static PyMemberDef pyrf_task_event__members[] = { | ||
362 | |||
363 | static PyObject *pyrf_task_event__repr(struct pyrf_event *pevent) | ||
364 | { | ||
365 | - return PyString_FromFormat("{ type: %s, pid: %u, ppid: %u, tid: %u, " | ||
366 | + return _PyUnicode_FromFormat("{ type: %s, pid: %u, ppid: %u, tid: %u, " | ||
367 | "ptid: %u, time: %" PRIu64 "}", | ||
368 | pevent->event.header.type == PERF_RECORD_FORK ? "fork" : "exit", | ||
369 | pevent->event.fork.pid, | ||
370 | @@ -171,7 +199,7 @@ static PyMemberDef pyrf_comm_event__members[] = { | ||
371 | |||
372 | static PyObject *pyrf_comm_event__repr(struct pyrf_event *pevent) | ||
373 | { | ||
374 | - return PyString_FromFormat("{ type: comm, pid: %u, tid: %u, comm: %s }", | ||
375 | + return _PyUnicode_FromFormat("{ type: comm, pid: %u, tid: %u, comm: %s }", | ||
376 | pevent->event.comm.pid, | ||
377 | pevent->event.comm.tid, | ||
378 | pevent->event.comm.comm); | ||
379 | @@ -202,7 +230,7 @@ static PyObject *pyrf_throttle_event__repr(struct pyrf_event *pevent) | ||
380 | { | ||
381 | struct throttle_event *te = (struct throttle_event *)(&pevent->event.header + 1); | ||
382 | |||
383 | - return PyString_FromFormat("{ type: %sthrottle, time: %" PRIu64 ", id: %" PRIu64 | ||
384 | + return _PyUnicode_FromFormat("{ type: %sthrottle, time: %" PRIu64 ", id: %" PRIu64 | ||
385 | ", stream_id: %" PRIu64 " }", | ||
386 | pevent->event.header.type == PERF_RECORD_THROTTLE ? "" : "un", | ||
387 | te->time, te->id, te->stream_id); | ||
388 | @@ -237,7 +265,7 @@ static PyObject *pyrf_lost_event__repr(struct pyrf_event *pevent) | ||
389 | pevent->event.lost.id, pevent->event.lost.lost) < 0) { | ||
390 | ret = PyErr_NoMemory(); | ||
391 | } else { | ||
392 | - ret = PyString_FromString(s); | ||
393 | + ret = _PyUnicode_FromString(s); | ||
394 | free(s); | ||
395 | } | ||
396 | return ret; | ||
397 | @@ -264,7 +292,7 @@ static PyMemberDef pyrf_read_event__members[] = { | ||
398 | |||
399 | static PyObject *pyrf_read_event__repr(struct pyrf_event *pevent) | ||
400 | { | ||
401 | - return PyString_FromFormat("{ type: read, pid: %u, tid: %u }", | ||
402 | + return _PyUnicode_FromFormat("{ type: read, pid: %u, tid: %u }", | ||
403 | pevent->event.read.pid, | ||
404 | pevent->event.read.tid); | ||
405 | /* | ||
406 | @@ -299,7 +327,7 @@ static PyObject *pyrf_sample_event__repr(struct pyrf_event *pevent) | ||
407 | if (asprintf(&s, "{ type: sample }") < 0) { | ||
408 | ret = PyErr_NoMemory(); | ||
409 | } else { | ||
410 | - ret = PyString_FromString(s); | ||
411 | + ret = _PyUnicode_FromString(s); | ||
412 | free(s); | ||
413 | } | ||
414 | return ret; | ||
415 | @@ -330,7 +358,7 @@ tracepoint_field(struct pyrf_event *pe, struct format_field *field) | ||
416 | } | ||
417 | if (field->flags & FIELD_IS_STRING && | ||
418 | is_printable_array(data + offset, len)) { | ||
419 | - ret = PyString_FromString((char *)data + offset); | ||
420 | + ret = _PyUnicode_FromString((char *)data + offset); | ||
421 | } else { | ||
422 | ret = PyByteArray_FromStringAndSize((const char *) data + offset, len); | ||
423 | field->flags &= ~FIELD_IS_STRING; | ||
424 | @@ -352,7 +380,7 @@ tracepoint_field(struct pyrf_event *pe, struct format_field *field) | ||
425 | static PyObject* | ||
426 | get_tracepoint_field(struct pyrf_event *pevent, PyObject *attr_name) | ||
427 | { | ||
428 | - const char *str = PyString_AsString(PyObject_Str(attr_name)); | ||
429 | + const char *str = _PyUnicode_AsString(PyObject_Str(attr_name)); | ||
430 | struct perf_evsel *evsel = pevent->evsel; | ||
431 | struct format_field *field; | ||
432 | |||
433 | @@ -416,7 +444,7 @@ static PyObject *pyrf_context_switch_event__repr(struct pyrf_event *pevent) | ||
434 | !!(pevent->event.header.misc & PERF_RECORD_MISC_SWITCH_OUT)) < 0) { | ||
435 | ret = PyErr_NoMemory(); | ||
436 | } else { | ||
437 | - ret = PyString_FromString(s); | ||
438 | + ret = _PyUnicode_FromString(s); | ||
439 | free(s); | ||
440 | } | ||
441 | return ret; | ||
442 | @@ -528,7 +556,7 @@ static int pyrf_cpu_map__init(struct pyrf_cpu_map *pcpus, | ||
443 | static void pyrf_cpu_map__delete(struct pyrf_cpu_map *pcpus) | ||
444 | { | ||
445 | cpu_map__put(pcpus->cpus); | ||
446 | - pcpus->ob_type->tp_free((PyObject*)pcpus); | ||
447 | + Py_TYPE(pcpus)->tp_free((PyObject*)pcpus); | ||
448 | } | ||
449 | |||
450 | static Py_ssize_t pyrf_cpu_map__length(PyObject *obj) | ||
451 | @@ -597,7 +625,7 @@ static int pyrf_thread_map__init(struct pyrf_thread_map *pthreads, | ||
452 | static void pyrf_thread_map__delete(struct pyrf_thread_map *pthreads) | ||
453 | { | ||
454 | thread_map__put(pthreads->threads); | ||
455 | - pthreads->ob_type->tp_free((PyObject*)pthreads); | ||
456 | + Py_TYPE(pthreads)->tp_free((PyObject*)pthreads); | ||
457 | } | ||
458 | |||
459 | static Py_ssize_t pyrf_thread_map__length(PyObject *obj) | ||
460 | @@ -759,7 +787,7 @@ static int pyrf_evsel__init(struct pyrf_evsel *pevsel, | ||
461 | static void pyrf_evsel__delete(struct pyrf_evsel *pevsel) | ||
462 | { | ||
463 | perf_evsel__exit(&pevsel->evsel); | ||
464 | - pevsel->ob_type->tp_free((PyObject*)pevsel); | ||
465 | + Py_TYPE(pevsel)->tp_free((PyObject*)pevsel); | ||
466 | } | ||
467 | |||
468 | static PyObject *pyrf_evsel__open(struct pyrf_evsel *pevsel, | ||
469 | @@ -850,7 +878,7 @@ static int pyrf_evlist__init(struct pyrf_evlist *pevlist, | ||
470 | static void pyrf_evlist__delete(struct pyrf_evlist *pevlist) | ||
471 | { | ||
472 | perf_evlist__exit(&pevlist->evlist); | ||
473 | - pevlist->ob_type->tp_free((PyObject*)pevlist); | ||
474 | + Py_TYPE(pevlist)->tp_free((PyObject*)pevlist); | ||
475 | } | ||
476 | |||
477 | static PyObject *pyrf_evlist__mmap(struct pyrf_evlist *pevlist, | ||
478 | @@ -902,12 +930,16 @@ static PyObject *pyrf_evlist__get_pollfd(struct pyrf_evlist *pevlist, | ||
479 | |||
480 | for (i = 0; i < evlist->pollfd.nr; ++i) { | ||
481 | PyObject *file; | ||
482 | +#if PY_MAJOR_VERSION < 3 | ||
483 | FILE *fp = fdopen(evlist->pollfd.entries[i].fd, "r"); | ||
484 | |||
485 | if (fp == NULL) | ||
486 | goto free_list; | ||
487 | |||
488 | file = PyFile_FromFile(fp, "perf", "r", NULL); | ||
489 | +#else | ||
490 | + file = PyFile_FromFd(evlist->pollfd.entries[i].fd, "perf", "r", -1, NULL, NULL, NULL, 1); | ||
491 | +#endif | ||
492 | if (file == NULL) | ||
493 | goto free_list; | ||
494 | |||
495 | @@ -1194,9 +1226,9 @@ static PyObject *pyrf__tracepoint(struct pyrf_evsel *pevsel, | ||
496 | |||
497 | tp_format = trace_event__tp_format(sys, name); | ||
498 | if (IS_ERR(tp_format)) | ||
499 | - return PyInt_FromLong(-1); | ||
500 | + return _PyLong_FromLong(-1); | ||
501 | |||
502 | - return PyInt_FromLong(tp_format->id); | ||
503 | + return _PyLong_FromLong(tp_format->id); | ||
504 | } | ||
505 | |||
506 | static PyMethodDef perf__methods[] = { | ||
507 | @@ -1209,11 +1241,31 @@ static PyMethodDef perf__methods[] = { | ||
508 | { .ml_name = NULL, } | ||
509 | }; | ||
510 | |||
511 | +#if PY_MAJOR_VERSION < 3 | ||
512 | PyMODINIT_FUNC initperf(void) | ||
513 | +#else | ||
514 | +PyMODINIT_FUNC PyInit_perf(void) | ||
515 | +#endif | ||
516 | { | ||
517 | PyObject *obj; | ||
518 | int i; | ||
519 | - PyObject *dict, *module = Py_InitModule("perf", perf__methods); | ||
520 | + PyObject *dict; | ||
521 | +#if PY_MAJOR_VERSION < 3 | ||
522 | + PyObject *module = Py_InitModule("perf", perf__methods); | ||
523 | +#else | ||
524 | + static struct PyModuleDef moduledef = { | ||
525 | + PyModuleDef_HEAD_INIT, | ||
526 | + "perf", /* m_name */ | ||
527 | + "", /* m_doc */ | ||
528 | + -1, /* m_size */ | ||
529 | + perf__methods, /* m_methods */ | ||
530 | + NULL, /* m_reload */ | ||
531 | + NULL, /* m_traverse */ | ||
532 | + NULL, /* m_clear */ | ||
533 | + NULL, /* m_free */ | ||
534 | + }; | ||
535 | + PyObject *module = PyModule_Create(&moduledef); | ||
536 | +#endif | ||
537 | |||
538 | if (module == NULL || | ||
539 | pyrf_event__setup_types() < 0 || | ||
540 | @@ -1221,7 +1273,11 @@ PyMODINIT_FUNC initperf(void) | ||
541 | pyrf_evsel__setup_types() < 0 || | ||
542 | pyrf_thread_map__setup_types() < 0 || | ||
543 | pyrf_cpu_map__setup_types() < 0) | ||
544 | +#if PY_MAJOR_VERSION < 3 | ||
545 | return; | ||
546 | +#else | ||
547 | + return module; | ||
548 | +#endif | ||
549 | |||
550 | /* The page_size is placed in util object. */ | ||
551 | page_size = sysconf(_SC_PAGE_SIZE); | ||
552 | @@ -1270,7 +1326,7 @@ PyMODINIT_FUNC initperf(void) | ||
553 | goto error; | ||
554 | |||
555 | for (i = 0; perf__constants[i].name != NULL; i++) { | ||
556 | - obj = PyInt_FromLong(perf__constants[i].value); | ||
557 | + obj = _PyLong_FromLong(perf__constants[i].value); | ||
558 | if (obj == NULL) | ||
559 | goto error; | ||
560 | PyDict_SetItemString(dict, perf__constants[i].name, obj); | ||
561 | @@ -1280,6 +1336,9 @@ PyMODINIT_FUNC initperf(void) | ||
562 | error: | ||
563 | if (PyErr_Occurred()) | ||
564 | PyErr_SetString(PyExc_ImportError, "perf: Init failed!"); | ||
565 | +#if PY_MAJOR_VERSION >= 3 | ||
566 | + return module; | ||
567 | +#endif | ||
568 | } | ||
569 | |||
570 | /* | ||
571 | diff --git a/tools/perf/util/scripting-engines/trace-event-python.c b/tools/perf/util/scripting-engines/trace-event-python.c | ||
572 | index f03fa7a835a1..8db28d4ff4b6 100644 | ||
573 | --- a/tools/perf/util/scripting-engines/trace-event-python.c | ||
574 | +++ b/tools/perf/util/scripting-engines/trace-event-python.c | ||
575 | @@ -50,7 +50,37 @@ | ||
576 | #include "print_binary.h" | ||
577 | #include "stat.h" | ||
578 | |||
579 | +#if PY_MAJOR_VERSION < 3 | ||
580 | +#define _PyUnicode_FromString(arg) \ | ||
581 | + PyString_FromString(arg) | ||
582 | +#define _PyUnicode_FromStringAndSize(arg1, arg2) \ | ||
583 | + PyString_FromStringAndSize((arg1), (arg2)) | ||
584 | +#define _PyBytes_FromStringAndSize(arg1, arg2) \ | ||
585 | + PyString_FromStringAndSize((arg1), (arg2)) | ||
586 | +#define _PyLong_FromLong(arg) \ | ||
587 | + PyInt_FromLong(arg) | ||
588 | +#define _PyLong_AsLong(arg) \ | ||
589 | + PyInt_AsLong(arg) | ||
590 | +#define _PyCapsule_New(arg1, arg2, arg3) \ | ||
591 | + PyCObject_FromVoidPtr((arg1), (arg2)) | ||
592 | + | ||
593 | PyMODINIT_FUNC initperf_trace_context(void); | ||
594 | +#else | ||
595 | +#define _PyUnicode_FromString(arg) \ | ||
596 | + PyUnicode_FromString(arg) | ||
597 | +#define _PyUnicode_FromStringAndSize(arg1, arg2) \ | ||
598 | + PyUnicode_FromStringAndSize((arg1), (arg2)) | ||
599 | +#define _PyBytes_FromStringAndSize(arg1, arg2) \ | ||
600 | + PyBytes_FromStringAndSize((arg1), (arg2)) | ||
601 | +#define _PyLong_FromLong(arg) \ | ||
602 | + PyLong_FromLong(arg) | ||
603 | +#define _PyLong_AsLong(arg) \ | ||
604 | + PyLong_AsLong(arg) | ||
605 | +#define _PyCapsule_New(arg1, arg2, arg3) \ | ||
606 | + PyCapsule_New((arg1), (arg2), (arg3)) | ||
607 | + | ||
608 | +PyMODINIT_FUNC PyInit_perf_trace_context(void); | ||
609 | +#endif | ||
610 | |||
611 | #define TRACE_EVENT_TYPE_MAX \ | ||
612 | ((1 << (sizeof(unsigned short) * 8)) - 1) | ||
613 | @@ -136,7 +166,7 @@ static int get_argument_count(PyObject *handler) | ||
614 | PyObject *arg_count_obj = PyObject_GetAttrString(code_obj, | ||
615 | "co_argcount"); | ||
616 | if (arg_count_obj) { | ||
617 | - arg_count = (int) PyInt_AsLong(arg_count_obj); | ||
618 | + arg_count = (int) _PyLong_AsLong(arg_count_obj); | ||
619 | Py_DECREF(arg_count_obj); | ||
620 | } | ||
621 | Py_DECREF(code_obj); | ||
622 | @@ -183,10 +213,10 @@ static void define_value(enum print_arg_type field_type, | ||
623 | |||
624 | value = eval_flag(field_value); | ||
625 | |||
626 | - PyTuple_SetItem(t, n++, PyString_FromString(ev_name)); | ||
627 | - PyTuple_SetItem(t, n++, PyString_FromString(field_name)); | ||
628 | - PyTuple_SetItem(t, n++, PyInt_FromLong(value)); | ||
629 | - PyTuple_SetItem(t, n++, PyString_FromString(field_str)); | ||
630 | + PyTuple_SetItem(t, n++, _PyUnicode_FromString(ev_name)); | ||
631 | + PyTuple_SetItem(t, n++, _PyUnicode_FromString(field_name)); | ||
632 | + PyTuple_SetItem(t, n++, _PyLong_FromLong(value)); | ||
633 | + PyTuple_SetItem(t, n++, _PyUnicode_FromString(field_str)); | ||
634 | |||
635 | try_call_object(handler_name, t); | ||
636 | |||
637 | @@ -224,10 +254,10 @@ static void define_field(enum print_arg_type field_type, | ||
638 | if (!t) | ||
639 | Py_FatalError("couldn't create Python tuple"); | ||
640 | |||
641 | - PyTuple_SetItem(t, n++, PyString_FromString(ev_name)); | ||
642 | - PyTuple_SetItem(t, n++, PyString_FromString(field_name)); | ||
643 | + PyTuple_SetItem(t, n++, _PyUnicode_FromString(ev_name)); | ||
644 | + PyTuple_SetItem(t, n++, _PyUnicode_FromString(field_name)); | ||
645 | if (field_type == PRINT_FLAGS) | ||
646 | - PyTuple_SetItem(t, n++, PyString_FromString(delim)); | ||
647 | + PyTuple_SetItem(t, n++, _PyUnicode_FromString(delim)); | ||
648 | |||
649 | try_call_object(handler_name, t); | ||
650 | |||
651 | @@ -326,12 +356,12 @@ static PyObject *get_field_numeric_entry(struct event_format *event, | ||
652 | if (field->flags & FIELD_IS_SIGNED) { | ||
653 | if ((long long)val >= LONG_MIN && | ||
654 | (long long)val <= LONG_MAX) | ||
655 | - obj = PyInt_FromLong(val); | ||
656 | + obj = _PyLong_FromLong(val); | ||
657 | else | ||
658 | obj = PyLong_FromLongLong(val); | ||
659 | } else { | ||
660 | if (val <= LONG_MAX) | ||
661 | - obj = PyInt_FromLong(val); | ||
662 | + obj = _PyLong_FromLong(val); | ||
663 | else | ||
664 | obj = PyLong_FromUnsignedLongLong(val); | ||
665 | } | ||
666 | @@ -390,9 +420,9 @@ static PyObject *python_process_callchain(struct perf_sample *sample, | ||
667 | pydict_set_item_string_decref(pysym, "end", | ||
668 | PyLong_FromUnsignedLongLong(node->sym->end)); | ||
669 | pydict_set_item_string_decref(pysym, "binding", | ||
670 | - PyInt_FromLong(node->sym->binding)); | ||
671 | + _PyLong_FromLong(node->sym->binding)); | ||
672 | pydict_set_item_string_decref(pysym, "name", | ||
673 | - PyString_FromStringAndSize(node->sym->name, | ||
674 | + _PyUnicode_FromStringAndSize(node->sym->name, | ||
675 | node->sym->namelen)); | ||
676 | pydict_set_item_string_decref(pyelem, "sym", pysym); | ||
677 | } | ||
678 | @@ -407,7 +437,7 @@ static PyObject *python_process_callchain(struct perf_sample *sample, | ||
679 | dsoname = map->dso->name; | ||
680 | } | ||
681 | pydict_set_item_string_decref(pyelem, "dso", | ||
682 | - PyString_FromString(dsoname)); | ||
683 | + _PyUnicode_FromString(dsoname)); | ||
684 | } | ||
685 | |||
686 | callchain_cursor_advance(&callchain_cursor); | ||
687 | @@ -484,16 +514,16 @@ static PyObject *get_perf_sample_dict(struct perf_sample *sample, | ||
688 | if (!dict_sample) | ||
689 | Py_FatalError("couldn't create Python dictionary"); | ||
690 | |||
691 | - pydict_set_item_string_decref(dict, "ev_name", PyString_FromString(perf_evsel__name(evsel))); | ||
692 | - pydict_set_item_string_decref(dict, "attr", PyString_FromStringAndSize( | ||
693 | + pydict_set_item_string_decref(dict, "ev_name", _PyUnicode_FromString(perf_evsel__name(evsel))); | ||
694 | + pydict_set_item_string_decref(dict, "attr", _PyUnicode_FromStringAndSize( | ||
695 | (const char *)&evsel->attr, sizeof(evsel->attr))); | ||
696 | |||
697 | pydict_set_item_string_decref(dict_sample, "pid", | ||
698 | - PyInt_FromLong(sample->pid)); | ||
699 | + _PyLong_FromLong(sample->pid)); | ||
700 | pydict_set_item_string_decref(dict_sample, "tid", | ||
701 | - PyInt_FromLong(sample->tid)); | ||
702 | + _PyLong_FromLong(sample->tid)); | ||
703 | pydict_set_item_string_decref(dict_sample, "cpu", | ||
704 | - PyInt_FromLong(sample->cpu)); | ||
705 | + _PyLong_FromLong(sample->cpu)); | ||
706 | pydict_set_item_string_decref(dict_sample, "ip", | ||
707 | PyLong_FromUnsignedLongLong(sample->ip)); | ||
708 | pydict_set_item_string_decref(dict_sample, "time", | ||
709 | @@ -503,17 +533,17 @@ static PyObject *get_perf_sample_dict(struct perf_sample *sample, | ||
710 | set_sample_read_in_dict(dict_sample, sample, evsel); | ||
711 | pydict_set_item_string_decref(dict, "sample", dict_sample); | ||
712 | |||
713 | - pydict_set_item_string_decref(dict, "raw_buf", PyString_FromStringAndSize( | ||
714 | + pydict_set_item_string_decref(dict, "raw_buf", _PyBytes_FromStringAndSize( | ||
715 | (const char *)sample->raw_data, sample->raw_size)); | ||
716 | pydict_set_item_string_decref(dict, "comm", | ||
717 | - PyString_FromString(thread__comm_str(al->thread))); | ||
718 | + _PyUnicode_FromString(thread__comm_str(al->thread))); | ||
719 | if (al->map) { | ||
720 | pydict_set_item_string_decref(dict, "dso", | ||
721 | - PyString_FromString(al->map->dso->name)); | ||
722 | + _PyUnicode_FromString(al->map->dso->name)); | ||
723 | } | ||
724 | if (al->sym) { | ||
725 | pydict_set_item_string_decref(dict, "symbol", | ||
726 | - PyString_FromString(al->sym->name)); | ||
727 | + _PyUnicode_FromString(al->sym->name)); | ||
728 | } | ||
729 | |||
730 | pydict_set_item_string_decref(dict, "callchain", callchain); | ||
731 | @@ -573,9 +603,9 @@ static void python_process_tracepoint(struct perf_sample *sample, | ||
732 | scripting_context->event_data = data; | ||
733 | scripting_context->pevent = evsel->tp_format->pevent; | ||
734 | |||
735 | - context = PyCObject_FromVoidPtr(scripting_context, NULL); | ||
736 | + context = _PyCapsule_New(scripting_context, NULL, NULL); | ||
737 | |||
738 | - PyTuple_SetItem(t, n++, PyString_FromString(handler_name)); | ||
739 | + PyTuple_SetItem(t, n++, _PyUnicode_FromString(handler_name)); | ||
740 | PyTuple_SetItem(t, n++, context); | ||
741 | |||
742 | /* ip unwinding */ | ||
743 | @@ -584,18 +614,18 @@ static void python_process_tracepoint(struct perf_sample *sample, | ||
744 | Py_INCREF(callchain); | ||
745 | |||
746 | if (!dict) { | ||
747 | - PyTuple_SetItem(t, n++, PyInt_FromLong(cpu)); | ||
748 | - PyTuple_SetItem(t, n++, PyInt_FromLong(s)); | ||
749 | - PyTuple_SetItem(t, n++, PyInt_FromLong(ns)); | ||
750 | - PyTuple_SetItem(t, n++, PyInt_FromLong(pid)); | ||
751 | - PyTuple_SetItem(t, n++, PyString_FromString(comm)); | ||
752 | + PyTuple_SetItem(t, n++, _PyLong_FromLong(cpu)); | ||
753 | + PyTuple_SetItem(t, n++, _PyLong_FromLong(s)); | ||
754 | + PyTuple_SetItem(t, n++, _PyLong_FromLong(ns)); | ||
755 | + PyTuple_SetItem(t, n++, _PyLong_FromLong(pid)); | ||
756 | + PyTuple_SetItem(t, n++, _PyUnicode_FromString(comm)); | ||
757 | PyTuple_SetItem(t, n++, callchain); | ||
758 | } else { | ||
759 | - pydict_set_item_string_decref(dict, "common_cpu", PyInt_FromLong(cpu)); | ||
760 | - pydict_set_item_string_decref(dict, "common_s", PyInt_FromLong(s)); | ||
761 | - pydict_set_item_string_decref(dict, "common_ns", PyInt_FromLong(ns)); | ||
762 | - pydict_set_item_string_decref(dict, "common_pid", PyInt_FromLong(pid)); | ||
763 | - pydict_set_item_string_decref(dict, "common_comm", PyString_FromString(comm)); | ||
764 | + pydict_set_item_string_decref(dict, "common_cpu", _PyLong_FromLong(cpu)); | ||
765 | + pydict_set_item_string_decref(dict, "common_s", _PyLong_FromLong(s)); | ||
766 | + pydict_set_item_string_decref(dict, "common_ns", _PyLong_FromLong(ns)); | ||
767 | + pydict_set_item_string_decref(dict, "common_pid", _PyLong_FromLong(pid)); | ||
768 | + pydict_set_item_string_decref(dict, "common_comm", _PyUnicode_FromString(comm)); | ||
769 | pydict_set_item_string_decref(dict, "common_callchain", callchain); | ||
770 | } | ||
771 | for (field = event->format.fields; field; field = field->next) { | ||
772 | @@ -614,7 +644,7 @@ static void python_process_tracepoint(struct perf_sample *sample, | ||
773 | } | ||
774 | if (field->flags & FIELD_IS_STRING && | ||
775 | is_printable_array(data + offset, len)) { | ||
776 | - obj = PyString_FromString((char *) data + offset); | ||
777 | + obj = _PyUnicode_FromString((char *) data + offset); | ||
778 | } else { | ||
779 | obj = PyByteArray_FromStringAndSize((const char *) data + offset, len); | ||
780 | field->flags &= ~FIELD_IS_STRING; | ||
781 | @@ -664,7 +694,7 @@ static PyObject *tuple_new(unsigned int sz) | ||
782 | static int tuple_set_u64(PyObject *t, unsigned int pos, u64 val) | ||
783 | { | ||
784 | #if BITS_PER_LONG == 64 | ||
785 | - return PyTuple_SetItem(t, pos, PyInt_FromLong(val)); | ||
786 | + return PyTuple_SetItem(t, pos, _PyLong_FromLong(val)); | ||
787 | #endif | ||
788 | #if BITS_PER_LONG == 32 | ||
789 | return PyTuple_SetItem(t, pos, PyLong_FromLongLong(val)); | ||
790 | @@ -673,12 +703,12 @@ static int tuple_set_u64(PyObject *t, unsigned int pos, u64 val) | ||
791 | |||
792 | static int tuple_set_s32(PyObject *t, unsigned int pos, s32 val) | ||
793 | { | ||
794 | - return PyTuple_SetItem(t, pos, PyInt_FromLong(val)); | ||
795 | + return PyTuple_SetItem(t, pos, _PyLong_FromLong(val)); | ||
796 | } | ||
797 | |||
798 | static int tuple_set_string(PyObject *t, unsigned int pos, const char *s) | ||
799 | { | ||
800 | - return PyTuple_SetItem(t, pos, PyString_FromString(s)); | ||
801 | + return PyTuple_SetItem(t, pos, _PyUnicode_FromString(s)); | ||
802 | } | ||
803 | |||
804 | static int python_export_evsel(struct db_export *dbe, struct perf_evsel *evsel) | ||
805 | @@ -1024,8 +1054,8 @@ process_stat(struct perf_evsel *counter, int cpu, int thread, u64 tstamp, | ||
806 | return; | ||
807 | } | ||
808 | |||
809 | - PyTuple_SetItem(t, n++, PyInt_FromLong(cpu)); | ||
810 | - PyTuple_SetItem(t, n++, PyInt_FromLong(thread)); | ||
811 | + PyTuple_SetItem(t, n++, _PyLong_FromLong(cpu)); | ||
812 | + PyTuple_SetItem(t, n++, _PyLong_FromLong(thread)); | ||
813 | |||
814 | tuple_set_u64(t, n++, tstamp); | ||
815 | tuple_set_u64(t, n++, count->val); | ||
816 | @@ -1207,27 +1237,58 @@ static void set_table_handlers(struct tables *tables) | ||
817 | SET_TABLE_HANDLER(call_return); | ||
818 | } | ||
819 | |||
820 | +#if PY_MAJOR_VERSION < 3 | ||
821 | +static void _free_command_line(const char **command_line, int num) | ||
822 | +{ | ||
823 | + free(command_line); | ||
824 | +} | ||
825 | +#else | ||
826 | +static void _free_command_line(wchar_t **command_line, int num) | ||
827 | +{ | ||
828 | + int i; | ||
829 | + for (i = 0; i < num; i++) | ||
830 | + PyMem_RawFree(command_line[i]); | ||
831 | + free(command_line); | ||
832 | +} | ||
833 | +#endif | ||
834 | + | ||
835 | + | ||
836 | /* | ||
837 | * Start trace script | ||
838 | */ | ||
839 | static int python_start_script(const char *script, int argc, const char **argv) | ||
840 | { | ||
841 | struct tables *tables = &tables_global; | ||
842 | +#if PY_MAJOR_VERSION < 3 | ||
843 | const char **command_line; | ||
844 | +#else | ||
845 | + wchar_t **command_line; | ||
846 | +#endif | ||
847 | char buf[PATH_MAX]; | ||
848 | int i, err = 0; | ||
849 | FILE *fp; | ||
850 | |||
851 | +#if PY_MAJOR_VERSION < 3 | ||
852 | command_line = malloc((argc + 1) * sizeof(const char *)); | ||
853 | command_line[0] = script; | ||
854 | for (i = 1; i < argc + 1; i++) | ||
855 | command_line[i] = argv[i - 1]; | ||
856 | +#else | ||
857 | + command_line = malloc((argc + 1) * sizeof(wchar_t *)); | ||
858 | + command_line[0] = Py_DecodeLocale(script, NULL); | ||
859 | + for (i = 1; i < argc + 1; i++) | ||
860 | + command_line[i] = Py_DecodeLocale(argv[i - 1], NULL); | ||
861 | +#endif | ||
862 | |||
863 | Py_Initialize(); | ||
864 | |||
865 | +#if PY_MAJOR_VERSION < 3 | ||
866 | initperf_trace_context(); | ||
867 | - | ||
868 | PySys_SetArgv(argc + 1, (char **)command_line); | ||
869 | +#else | ||
870 | + PyInit_perf_trace_context(); | ||
871 | + PySys_SetArgv(argc + 1, command_line); | ||
872 | +#endif | ||
873 | |||
874 | fp = fopen(script, "r"); | ||
875 | if (!fp) { | ||
876 | @@ -1257,12 +1318,12 @@ static int python_start_script(const char *script, int argc, const char **argv) | ||
877 | goto error; | ||
878 | } | ||
879 | |||
880 | - free(command_line); | ||
881 | + _free_command_line(command_line, argc + 1); | ||
882 | |||
883 | return err; | ||
884 | error: | ||
885 | Py_Finalize(); | ||
886 | - free(command_line); | ||
887 | + _free_command_line(command_line, argc + 1); | ||
888 | |||
889 | return err; | ||
890 | } | ||
891 | diff --git a/tools/perf/util/setup.py b/tools/perf/util/setup.py | ||
892 | index 23f1bf175179..a5f9e236cc71 100644 | ||
893 | --- a/tools/perf/util/setup.py | ||
894 | +++ b/tools/perf/util/setup.py | ||
895 | @@ -1,4 +1,4 @@ | ||
896 | -#!/usr/bin/python2 | ||
897 | +#!/usr/bin/python | ||
898 | |||
899 | from os import getenv | ||
900 | |||
901 | @@ -37,11 +37,11 @@ build_tmp = getenv('PYTHON_EXTBUILD_TMP') | ||
902 | libtraceevent = getenv('LIBTRACEEVENT') | ||
903 | libapikfs = getenv('LIBAPI') | ||
904 | |||
905 | -ext_sources = [f.strip() for f in file('util/python-ext-sources') | ||
906 | +ext_sources = [f.strip() for f in open('util/python-ext-sources') | ||
907 | if len(f.strip()) > 0 and f[0] != '#'] | ||
908 | |||
909 | # use full paths with source files | ||
910 | -ext_sources = map(lambda x: '%s/%s' % (src_perf, x) , ext_sources) | ||
911 | +ext_sources = list(map(lambda x: '%s/%s' % (src_perf, x) , ext_sources)) | ||
912 | |||
913 | perf = Extension('perf', | ||
914 | sources = ext_sources, | ||
915 | -- | ||
916 | 2.17.1 | ||
917 | |||
diff --git a/recipes-kernel/linux/linux-intel/0001-perf-x86-32-explicitly-include-errno.h.patch b/recipes-kernel/linux/linux-intel/0001-perf-x86-32-explicitly-include-errno.h.patch deleted file mode 100644 index 5c8b27c7..00000000 --- a/recipes-kernel/linux/linux-intel/0001-perf-x86-32-explicitly-include-errno.h.patch +++ /dev/null | |||
@@ -1,41 +0,0 @@ | |||
1 | From 57af599929263e7bb6f2f369c9e4bc1e440528a9 Mon Sep 17 00:00:00 2001 | ||
2 | From: Bruce Ashfield <bruce.ashfield@windriver.com> | ||
3 | Date: Mon, 21 Aug 2017 13:52:53 -0400 | ||
4 | Subject: [PATCH 1/1] perf: x86-32: explicitly include <errno.h> | ||
5 | |||
6 | Upstream-Status: submitted | ||
7 | |||
8 | The 32bit x86 perf build does not find the system definitions of error | ||
9 | return values, hence we end up with: | ||
10 | |||
11 | | In file included from util/libunwind/x86_32.c:32:0: | ||
12 | | util/libunwind/../../arch/x86/util/unwind-libunwind.c: In function 'libunwind__x86_reg_id': | ||
13 | | util/libunwind/../../arch/x86/util/unwind-libunwind.c:109:11: error: 'EINVAL' undeclared (first use in this function); did you mean 'UNW_EINVAL'? | ||
14 | | return -EINVAL; | ||
15 | | ^~~~~~ | ||
16 | | UNW_EINVAL | ||
17 | |||
18 | By explicitly including errno.h, we can fix this build without impacting | ||
19 | other architectures. | ||
20 | |||
21 | Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com> | ||
22 | --- | ||
23 | |||
24 | tools/perf/util/libunwind/x86_32.c | 1 + | ||
25 | 1 file changed, 1 insertion(+) | ||
26 | |||
27 | diff --git a/tools/perf/util/libunwind/x86_32.c b/tools/perf/util/libunwind/x86_32.c | ||
28 | index 957ffff72428..d781f7bdeb88 100644 | ||
29 | --- a/tools/perf/util/libunwind/x86_32.c | ||
30 | +++ b/tools/perf/util/libunwind/x86_32.c | ||
31 | @@ -20,6 +20,7 @@ | ||
32 | #define LIBUNWIND__ARCH_REG_IP PERF_REG_X86_IP | ||
33 | #define LIBUNWIND__ARCH_REG_SP PERF_REG_X86_SP | ||
34 | |||
35 | +#include <errno.h> | ||
36 | #include "unwind.h" | ||
37 | #include "debug.h" | ||
38 | #include "libunwind-x86.h" | ||
39 | -- | ||
40 | 2.14.3 | ||
41 | |||
diff --git a/recipes-kernel/linux/linux-intel/0001-vt-conmakehash-improve-reproducibility.patch b/recipes-kernel/linux/linux-intel/0001-vt-conmakehash-improve-reproducibility.patch new file mode 100644 index 00000000..33280063 --- /dev/null +++ b/recipes-kernel/linux/linux-intel/0001-vt-conmakehash-improve-reproducibility.patch | |||
@@ -0,0 +1,58 @@ | |||
1 | From 0f586f4ee8adacac79b64d1f3d47799a5eb7fbea Mon Sep 17 00:00:00 2001 | ||
2 | From: Bruce Ashfield <bruce.ashfield@gmail.com> | ||
3 | Date: Sun, 10 Jul 2022 21:37:07 -0400 | ||
4 | Subject: [PATCH] vt/conmakehash: improve reproducibility | ||
5 | |||
6 | The file generated by conmakehash capture the application | ||
7 | path used to generate the file. While that can be informative, | ||
8 | it varies based on where the kernel was built, as the full | ||
9 | path is captured. | ||
10 | |||
11 | We tweak the application to use a second input as the "capture | ||
12 | name", and then modify the Makefile to pass the basename of | ||
13 | the source, making it reproducible. | ||
14 | |||
15 | This could be improved by using some sort of path mapping, | ||
16 | or the application manipualing argv[1] itself, but for now | ||
17 | this solves the reprodicibility issue. | ||
18 | |||
19 | Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com> | ||
20 | |||
21 | Upstream-Status: Inappropriate | ||
22 | |||
23 | Taken from linux-yocto, v5.15/standard/base | ||
24 | Signed-off-by: Anuj Mittal <anuj.mittal@intel.com> | ||
25 | --- | ||
26 | drivers/tty/vt/Makefile | 2 +- | ||
27 | drivers/tty/vt/conmakehash.c | 2 +- | ||
28 | 2 files changed, 2 insertions(+), 2 deletions(-) | ||
29 | |||
30 | diff --git a/drivers/tty/vt/Makefile b/drivers/tty/vt/Makefile | ||
31 | index fe30ce512819..cb51c21b58f9 100644 | ||
32 | --- a/drivers/tty/vt/Makefile | ||
33 | +++ b/drivers/tty/vt/Makefile | ||
34 | @@ -15,7 +15,7 @@ clean-files := consolemap_deftbl.c defkeymap.c | ||
35 | hostprogs += conmakehash | ||
36 | |||
37 | quiet_cmd_conmk = CONMK $@ | ||
38 | - cmd_conmk = $(obj)/conmakehash $< > $@ | ||
39 | + cmd_conmk = $(obj)/conmakehash $< $(shell basename $<) > $@ | ||
40 | |||
41 | $(obj)/consolemap_deftbl.c: $(src)/$(FONTMAPFILE) $(obj)/conmakehash | ||
42 | $(call cmd,conmk) | ||
43 | diff --git a/drivers/tty/vt/conmakehash.c b/drivers/tty/vt/conmakehash.c | ||
44 | index cddd789fe46e..d62510b280e9 100644 | ||
45 | --- a/drivers/tty/vt/conmakehash.c | ||
46 | +++ b/drivers/tty/vt/conmakehash.c | ||
47 | @@ -253,7 +253,7 @@ int main(int argc, char *argv[]) | ||
48 | #include <linux/types.h>\n\ | ||
49 | \n\ | ||
50 | u8 dfont_unicount[%d] = \n\ | ||
51 | -{\n\t", argv[1], fontlen); | ||
52 | +{\n\t", argv[2], fontlen); | ||
53 | |||
54 | for ( i = 0 ; i < fontlen ; i++ ) | ||
55 | { | ||
56 | -- | ||
57 | 2.36.1 | ||
58 | |||
diff --git a/recipes-kernel/linux/linux-intel/0002-mconf-fix-output-of-cflags-and-libraries.patch b/recipes-kernel/linux/linux-intel/0002-mconf-fix-output-of-cflags-and-libraries.patch new file mode 100644 index 00000000..a96b68d9 --- /dev/null +++ b/recipes-kernel/linux/linux-intel/0002-mconf-fix-output-of-cflags-and-libraries.patch | |||
@@ -0,0 +1,40 @@ | |||
1 | From 1b53d82a8152843afcddd7f16b0c43b6b4f22895 Mon Sep 17 00:00:00 2001 | ||
2 | From: Bruce Ashfield <bruce.ashfield@gmail.com> | ||
3 | Date: Mon, 17 Jul 2023 17:17:55 -0400 | ||
4 | Subject: [PATCH 2/2] mconf: fix output of cflags and libraries | ||
5 | |||
6 | commit 3122c84409d578a5df8bcb1 [kconfig: refactor Makefile to reduce | ||
7 | process forks] changes the way that flags are detected. They are | ||
8 | no longer just echo'd and captured, they are written to a file and | ||
9 | later read. | ||
10 | |||
11 | We adjust our CROSS ncurses patch accordingly. | ||
12 | |||
13 | We'll eventually be able to drop this patch, but not quite yet. | ||
14 | |||
15 | Upstream-Status: Inappropriate [OE-Specific] | ||
16 | Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com> | ||
17 | Signed-off-by: Naveen Saini <naveen.kumar.saini@intel.com> | ||
18 | --- | ||
19 | scripts/kconfig/mconf-cfg.sh | 4 ++-- | ||
20 | 1 file changed, 2 insertions(+), 2 deletions(-) | ||
21 | |||
22 | diff --git a/scripts/kconfig/mconf-cfg.sh b/scripts/kconfig/mconf-cfg.sh | ||
23 | index 38cf8304bb31..a5ae56e08b07 100755 | ||
24 | --- a/scripts/kconfig/mconf-cfg.sh | ||
25 | +++ b/scripts/kconfig/mconf-cfg.sh | ||
26 | @@ -8,9 +8,9 @@ PKG="ncursesw" | ||
27 | PKG2="ncurses" | ||
28 | |||
29 | if [ "$CROSS_CURSES_LIB" != "" ]; then | ||
30 | - echo libs=\'$CROSS_CURSES_LIB\' | ||
31 | + echo $CROSS_CURSES_LIB > ${libs} | ||
32 | if [ x"$CROSS_CURSES_INC" != x ]; then | ||
33 | - echo cflags=\'$CROSS_CURSES_INC\' | ||
34 | + echo $CROSS_CURSES_INC > ${cflags} | ||
35 | fi | ||
36 | exit 0 | ||
37 | fi | ||
38 | -- | ||
39 | 2.34.1 | ||
40 | |||
diff --git a/recipes-kernel/linux/linux-intel/disable_skylake_sound.cfg b/recipes-kernel/linux/linux-intel/disable_skylake_sound.cfg deleted file mode 100644 index b38cf6c2..00000000 --- a/recipes-kernel/linux/linux-intel/disable_skylake_sound.cfg +++ /dev/null | |||
@@ -1,12 +0,0 @@ | |||
1 | # CONFIG_SND_SOC_INTEL_SKYLAKE is not set | ||
2 | # CONFIG_SND_SOC_INTEL_BXT_DA7219_MAX98357A_MACH is not set | ||
3 | # CONFIG_SND_SOC_INTEL_BXT_RT298_MACH is not set | ||
4 | # CONFIG_SND_SOC_INTEL_BXT_TDF8532_MACH is not set | ||
5 | # CONFIG_SND_SOC_INTEL_KBL_RT5663_MAX98927_MACH is not set | ||
6 | # CONFIG_SND_SOC_INTEL_SKL_RT286_MACH is not set | ||
7 | # CONFIG_SND_SOC_INTEL_CNL_RT274_MACH is not set | ||
8 | # CONFIG_SND_SOC_INTEL_SKL_NAU88L25_SSM4567_MACH is not set | ||
9 | # CONFIG_SND_SOC_INTEL_SKL_NAU88L25_MAX98357A_MACH is not set | ||
10 | # CONFIG_SND_SOC_INTEL_CNL_CS42L42_MACH is not set | ||
11 | # CONFIG_SND_SOC_INTEL_CNL_RT700_MACH is not set | ||
12 | # CONFIG_SND_SOC_INTEL_CNL_SVFPGA_MACH is not set | ||
diff --git a/recipes-kernel/linux/linux-intel/fix-perf-reproducibility.patch b/recipes-kernel/linux/linux-intel/fix-perf-reproducibility.patch new file mode 100644 index 00000000..1a98b1db --- /dev/null +++ b/recipes-kernel/linux/linux-intel/fix-perf-reproducibility.patch | |||
@@ -0,0 +1,39 @@ | |||
1 | From b8cd0e429bf75b673c438a8277d4bc74327df992 Mon Sep 17 00:00:00 2001 | ||
2 | From: Tom Zanussi <tom.zanussi@intel.com> | ||
3 | Date: Tue, 3 Jul 2012 13:07:23 -0500 | ||
4 | Subject: perf: change --root to --prefix for python install | ||
5 | |||
6 | Otherwise we get the sysroot path appended to the build path, not what | ||
7 | we want. | ||
8 | |||
9 | Signed-off-by: Tom Zanussi <tom.zanussi@intel.com> | ||
10 | |||
11 | Upstream-Status: Inappropriate | ||
12 | |||
13 | Taken from linux-yocto, v5.15/standard/base | ||
14 | https://git.yoctoproject.org/linux-yocto/commit?id=b8cd0e429bf75b673c438a8277d4bc74327df992&h=v5.15%2Fstandard%2Fbase | ||
15 | |||
16 | Signed-off-by: Anuj Mittal <anuj.mittal@intel.com> | ||
17 | --- | ||
18 | tools/perf/Makefile.perf | 2 +- | ||
19 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
20 | |||
21 | (limited to 'tools/perf/Makefile.perf') | ||
22 | |||
23 | diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf | ||
24 | index 8f738e11356d..ee945d8e3996 100644 | ||
25 | --- a/tools/perf/Makefile.perf | ||
26 | +++ b/tools/perf/Makefile.perf | ||
27 | @@ -1022,7 +1022,7 @@ install-bin: install-tools install-tests install-traceevent-plugins | ||
28 | install: install-bin try-install-man | ||
29 | |||
30 | install-python_ext: | ||
31 | - $(PYTHON_WORD) util/setup.py --quiet install --root='/$(DESTDIR_SQ)' | ||
32 | + $(PYTHON_WORD) util/setup.py --quiet install --prefix='$(DESTDIR_SQ)/usr' | ||
33 | |||
34 | # 'make install-doc' should call 'make -C Documentation install' | ||
35 | $(INSTALL_DOC_TARGETS): | ||
36 | -- | ||
37 | cgit | ||
38 | |||
39 | |||
diff --git a/recipes-kernel/linux/linux-intel_4.14.bb b/recipes-kernel/linux/linux-intel_4.14.bb deleted file mode 100644 index 6aee4284..00000000 --- a/recipes-kernel/linux/linux-intel_4.14.bb +++ /dev/null | |||
@@ -1,23 +0,0 @@ | |||
1 | require linux-intel.inc | ||
2 | |||
3 | KBRANCH = "4.14/base" | ||
4 | KMETA_BRANCH = "yocto-4.14" | ||
5 | |||
6 | # Fix for 32-bit perf issue. Remove when patch is backported to 4.14. | ||
7 | SRC_URI_append = " file://0001-perf-x86-32-explicitly-include-errno.h.patch \ | ||
8 | file://0001-menuconfig-check-lxdiaglog.sh-Allow-specification-of.patch \ | ||
9 | file://0001-perf-tools-Add-Python-3-support.patch \ | ||
10 | " | ||
11 | |||
12 | DEPENDS += "elfutils-native openssl-native util-linux-native" | ||
13 | |||
14 | LINUX_VERSION ?= "4.14.152" | ||
15 | SRCREV_machine ?= "f500fab13d11290921fc16c0e8b08c671819ad43" | ||
16 | SRCREV_meta ?= "c8f030fdbf6046dede4b7ce6c94b5b24221c250e" | ||
17 | |||
18 | # For Crystalforest and Romley | ||
19 | KERNEL_MODULE_AUTOLOAD_append_core2-32-intel-common = " uio" | ||
20 | KERNEL_MODULE_AUTOLOAD_append_corei7-64-intel-common = " uio" | ||
21 | |||
22 | # Functionality flags | ||
23 | KERNEL_EXTRA_FEATURES ?= "features/netfilter/netfilter.scc features/security/security.scc" | ||
diff --git a/recipes-kernel/linux/linux-intel_4.19.bb b/recipes-kernel/linux/linux-intel_4.19.bb deleted file mode 100644 index 79727f91..00000000 --- a/recipes-kernel/linux/linux-intel_4.19.bb +++ /dev/null | |||
@@ -1,21 +0,0 @@ | |||
1 | require linux-intel.inc | ||
2 | |||
3 | KBRANCH = "4.19/base" | ||
4 | KMETA_BRANCH = "yocto-4.19" | ||
5 | |||
6 | LIC_FILES_CHKSUM = "file://COPYING;md5=bbea815ee2795b2f4230826c0c6b8814" | ||
7 | |||
8 | SRC_URI_append = " file://0001-menuconfig-mconf-cfg-Allow-specification-of-ncurses-.patch" | ||
9 | |||
10 | DEPENDS += "elfutils-native openssl-native util-linux-native" | ||
11 | |||
12 | LINUX_VERSION ?= "4.19.80" | ||
13 | SRCREV_machine ?= "6570cbed7b20741a3433c3192ed93ac0fea6c554" | ||
14 | SRCREV_meta ?= "a7cb57afb9fb9787079c28a1028d797632105e56" | ||
15 | |||
16 | # For Crystalforest and Romley | ||
17 | KERNEL_MODULE_AUTOLOAD_append_core2-32-intel-common = " uio" | ||
18 | KERNEL_MODULE_AUTOLOAD_append_corei7-64-intel-common = " uio" | ||
19 | |||
20 | # Functionality flags | ||
21 | KERNEL_EXTRA_FEATURES ?= "features/netfilter/netfilter.scc features/security/security.scc" | ||
diff --git a/recipes-kernel/linux/linux-intel_6.6.bb b/recipes-kernel/linux/linux-intel_6.6.bb new file mode 100644 index 00000000..3b917bfa --- /dev/null +++ b/recipes-kernel/linux/linux-intel_6.6.bb | |||
@@ -0,0 +1,21 @@ | |||
1 | require linux-intel.inc | ||
2 | |||
3 | SRC_URI:prepend = "git://github.com/intel/linux-intel-lts.git;protocol=https;name=machine;branch=${KBRANCH}; \ | ||
4 | " | ||
5 | KBRANCH = "6.6/linux" | ||
6 | KMETA_BRANCH = "yocto-6.6" | ||
7 | |||
8 | LIC_FILES_CHKSUM = "file://COPYING;md5=6bc538ed5bd9a7fc9398086aedcd7e46" | ||
9 | |||
10 | DEPENDS += "elfutils-native openssl-native util-linux-native" | ||
11 | |||
12 | LINUX_VERSION_EXTENSION ??= "-intel-pk-${LINUX_KERNEL_TYPE}" | ||
13 | |||
14 | LINUX_VERSION ?= "6.6.25" | ||
15 | SRCREV_machine ?= "lts-v6.6.25-linux-240415T215440Z" | ||
16 | SRCREV_meta ?= "c3d1322fb6ff68cdcf4d7a3c1140d81bfdc1320a" | ||
17 | |||
18 | # Functionality flags | ||
19 | KERNEL_EXTRA_FEATURES ?= "features/netfilter/netfilter.scc features/security/security.scc" | ||
20 | |||
21 | UPSTREAM_CHECK_GITTAGREGEX = "^lts-(?P<pver>v6.6.(\d+)-linux-(\d+)T(\d+)Z)$" | ||
diff --git a/recipes-kernel/linux/linux-intel_6.8.bb b/recipes-kernel/linux/linux-intel_6.8.bb new file mode 100644 index 00000000..036879db --- /dev/null +++ b/recipes-kernel/linux/linux-intel_6.8.bb | |||
@@ -0,0 +1,20 @@ | |||
1 | require linux-intel.inc | ||
2 | |||
3 | SRC_URI:prepend = "git://github.com/intel/mainline-tracking.git;protocol=https;name=machine;nobranch=1; \ | ||
4 | " | ||
5 | KMETA_BRANCH = "master" | ||
6 | |||
7 | LIC_FILES_CHKSUM = "file://COPYING;md5=6bc538ed5bd9a7fc9398086aedcd7e46" | ||
8 | |||
9 | DEPENDS += "elfutils-native openssl-native util-linux-native" | ||
10 | |||
11 | LINUX_VERSION_EXTENSION ??= "-mainline-tracking-${LINUX_KERNEL_TYPE}" | ||
12 | |||
13 | LINUX_VERSION ?= "6.8" | ||
14 | SRCREV_machine ?= "efbae83db36abbbbdb946d4f7bbdfda174107cd2" | ||
15 | SRCREV_meta ?= "27907f391a4fc508da21358b13419c6e86926c34" | ||
16 | |||
17 | # Functionality flags | ||
18 | KERNEL_EXTRA_FEATURES ?= "features/netfilter/netfilter.scc features/security/security.scc" | ||
19 | |||
20 | UPSTREAM_CHECK_GITTAGREGEX = "^mainline-tracking-v6.7-rc3-linux-(?P<pver>(\d+)T(\d+)Z)$" | ||
diff --git a/recipes-kernel/linux/linux-yocto-dev.bbappend b/recipes-kernel/linux/linux-yocto-dev.bbappend index 6173148c..deb19940 100644 --- a/recipes-kernel/linux/linux-yocto-dev.bbappend +++ b/recipes-kernel/linux/linux-yocto-dev.bbappend | |||
@@ -1,21 +1,21 @@ | |||
1 | FILESEXTRAPATHS_prepend_intel-x86-common := "${THISDIR}/${PN}:" | 1 | FILESEXTRAPATHS:prepend:intel-x86-common := "${THISDIR}/${PN}:" |
2 | 2 | ||
3 | COMPATIBLE_MACHINE_core2-32-intel-common = "${MACHINE}" | 3 | COMPATIBLE_MACHINE:core2-32-intel-common = "${MACHINE}" |
4 | KMACHINE_core2-32-intel-common = "intel-core2-32" | 4 | KMACHINE:core2-32-intel-common = "intel-core2-32" |
5 | KERNEL_FEATURES_append_core2-32-intel-common = "${KERNEL_FEATURES_INTEL_COMMON}" | 5 | KERNEL_FEATURES:append:core2-32-intel-common = "${KERNEL_FEATURES_INTEL_COMMON}" |
6 | 6 | ||
7 | COMPATIBLE_MACHINE_corei7-64-intel-common = "${MACHINE}" | 7 | COMPATIBLE_MACHINE:corei7-64-intel-common = "${MACHINE}" |
8 | KMACHINE_corei7-64-intel-common = "intel-corei7-64" | 8 | KMACHINE:corei7-64-intel-common = "intel-corei7-64" |
9 | KERNEL_FEATURES_append_corei7-64-intel-common = "${KERNEL_FEATURES_INTEL_COMMON}" | 9 | KERNEL_FEATURES:append:corei7-64-intel-common = "${KERNEL_FEATURES_INTEL_COMMON}" |
10 | 10 | ||
11 | # NOTE: We do not set SRCREVs here as -dev is intended to be built with AUTOREV | 11 | # NOTE: We do not set SRCREVs here as -dev is intended to be built with AUTOREV |
12 | # and setting them here breaks the default mechanism to use AUTOREV if the | 12 | # and setting them here breaks the default mechanism to use AUTOREV if the |
13 | # default SRCREV is set and linux-yocto-dev is the preferred provider. | 13 | # default SRCREV is set and linux-yocto-dev is the preferred provider. |
14 | 14 | ||
15 | # For Crystalforest and Romley | 15 | # For Crystalforest and Romley |
16 | KERNEL_MODULE_AUTOLOAD_append_core2-32-intel-common = " uio" | 16 | KERNEL_MODULE_AUTOLOAD:append:core2-32-intel-common = " uio" |
17 | KERNEL_MODULE_AUTOLOAD_append_corei7-64-intel-common = " uio" | 17 | KERNEL_MODULE_AUTOLOAD:append:corei7-64-intel-common = " uio" |
18 | 18 | ||
19 | # For FRI2, NUC | 19 | # For FRI2, NUC |
20 | KERNEL_MODULE_AUTOLOAD_append_core2-32-intel-common = " iwlwifi" | 20 | KERNEL_MODULE_AUTOLOAD:append:core2-32-intel-common = " iwlwifi" |
21 | KERNEL_MODULE_AUTOLOAD_append_corei7-64-intel-common = " iwlwifi" | 21 | KERNEL_MODULE_AUTOLOAD:append:corei7-64-intel-common = " iwlwifi" |
diff --git a/recipes-kernel/linux/linux-yocto-rt_4.19.bbappend b/recipes-kernel/linux/linux-yocto-rt_%.bbappend index daa7dd6b..daa7dd6b 100644 --- a/recipes-kernel/linux/linux-yocto-rt_4.19.bbappend +++ b/recipes-kernel/linux/linux-yocto-rt_%.bbappend | |||
diff --git a/recipes-kernel/linux/linux-yocto-rt_5.2.bbappend b/recipes-kernel/linux/linux-yocto-rt_5.2.bbappend deleted file mode 100644 index daa7dd6b..00000000 --- a/recipes-kernel/linux/linux-yocto-rt_5.2.bbappend +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | require meta-intel-compat-kernel.inc | ||
diff --git a/recipes-kernel/linux/linux-yocto_%.bbappend b/recipes-kernel/linux/linux-yocto_%.bbappend index 7c29be14..9f3d43e3 100644 --- a/recipes-kernel/linux/linux-yocto_%.bbappend +++ b/recipes-kernel/linux/linux-yocto_%.bbappend | |||
@@ -1,4 +1,6 @@ | |||
1 | require meta-intel-compat-kernel.inc | ||
2 | |||
1 | # The kernel build is 64-bit regardless, so include both common overrides. | 3 | # The kernel build is 64-bit regardless, so include both common overrides. |
2 | # Without this, the kernel will be missing vars that make it buildable for the | 4 | # Without this, the kernel will be missing vars that make it buildable for the |
3 | # intel-corei7-64 machine. | 5 | # intel-corei7-64 machine. |
4 | MACHINEOVERRIDES_prepend_corei7-64-x32-intel-common = "corei7-64-intel-common:" | 6 | MACHINEOVERRIDES:prepend:corei7-64-x32-intel-common = "corei7-64-intel-common:" |
diff --git a/recipes-kernel/linux/linux-yocto_4.19.bbappend b/recipes-kernel/linux/linux-yocto_4.19.bbappend deleted file mode 100644 index daa7dd6b..00000000 --- a/recipes-kernel/linux/linux-yocto_4.19.bbappend +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | require meta-intel-compat-kernel.inc | ||
diff --git a/recipes-kernel/linux/linux-yocto_5.2.bbappend b/recipes-kernel/linux/linux-yocto_5.2.bbappend deleted file mode 100644 index daa7dd6b..00000000 --- a/recipes-kernel/linux/linux-yocto_5.2.bbappend +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | require meta-intel-compat-kernel.inc | ||
diff --git a/recipes-kernel/linux/meta-intel-compat-kernel.inc b/recipes-kernel/linux/meta-intel-compat-kernel.inc index a985925f..0c861e13 100644 --- a/recipes-kernel/linux/meta-intel-compat-kernel.inc +++ b/recipes-kernel/linux/meta-intel-compat-kernel.inc | |||
@@ -3,12 +3,12 @@ | |||
3 | 3 | ||
4 | KERNEL_FEATURES_INTEL_COMMON ?= "" | 4 | KERNEL_FEATURES_INTEL_COMMON ?= "" |
5 | 5 | ||
6 | COMPATIBLE_MACHINE_intel-x86-common = "${MACHINE}" | 6 | COMPATIBLE_MACHINE:intel-x86-common = "${MACHINE}" |
7 | KERNEL_FEATURES_intel-x86-common = "${KERNEL_FEATURES_INTEL_COMMON}" | 7 | KERNEL_FEATURES:intel-x86-common = "${KERNEL_FEATURES_INTEL_COMMON}" |
8 | 8 | ||
9 | KMACHINE_corei7-64-intel-common = "intel-corei7-64" | 9 | KMACHINE:corei7-64-intel-common = "intel-corei7-64" |
10 | KMACHINE_core2-32-intel-common = "intel-core2-32" | 10 | KMACHINE:core2-32-intel-common = "intel-core2-32" |
11 | KMACHINE_skylake-64-intel-common = "intel-corei7-64" | 11 | KMACHINE:x86-64-v3-intel-common = "intel-corei7-64" |
12 | 12 | ||
13 | INTEL_COMMON_AUTOLOAD ?= " uio iwlwifi i915" | 13 | INTEL_COMMON_AUTOLOAD ?= " uio iwlwifi i915" |
14 | KERNEL_MODULE_AUTOLOAD_intel-x86-common = " ${INTEL_COMMON_AUTOLOAD}" | 14 | KERNEL_MODULE_AUTOLOAD:intel-x86-common = " ${INTEL_COMMON_AUTOLOAD}" |