All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCHv2] lttng-modules: Make it build when CONFIG_TRACEPOINTS is not enabled again
@ 2021-08-25 13:20 Peter Kjellerstedt
  2021-08-25 15:10 ` [OE-core] " Andrey Zhizhikin
  0 siblings, 1 reply; 2+ messages in thread
From: Peter Kjellerstedt @ 2021-08-25 13:20 UTC (permalink / raw)
  To: Bruce Ashfield, openembedded-core

Makefile-Do-not-fail-if-CONFIG_TRACEPOINTS-is-not-en.patch was updated
with the 2.13.0 update (commit 5dad15af), but unfortunately it no
longer did what it was intended to do. There is also
0001-src-Kbuild-change-missing-CONFIG_TRACEPOINTS-to-warn.patch, which
was based on the former patch, but it too does not solve the problem.

Unify the two patches, and actually disable building of the kernel
module if CONFIG_TRACEPOINTS is not enabled, the way it was intended.

Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
---

PATCHv2: Unify
Makefile-Do-not-fail-if-CONFIG_TRACEPOINTS-is-not-en.patch and
0001-src-Kbuild-change-missing-CONFIG_TRACEPOINTS-to-warn.patch into
the latter, and use that both with and without devupstream.

 ...e-missing-CONFIG_TRACEPOINTS-to-warn.patch | 25 +++++++++----
 ...fail-if-CONFIG_TRACEPOINTS-is-not-en.patch | 37 -------------------
 .../lttng/lttng-modules_2.13.0.bb             | 10 ++---
 3 files changed, 21 insertions(+), 51 deletions(-)
 delete mode 100644 meta/recipes-kernel/lttng/lttng-modules/Makefile-Do-not-fail-if-CONFIG_TRACEPOINTS-is-not-en.patch

diff --git a/meta/recipes-kernel/lttng/lttng-modules/0001-src-Kbuild-change-missing-CONFIG_TRACEPOINTS-to-warn.patch b/meta/recipes-kernel/lttng/lttng-modules/0001-src-Kbuild-change-missing-CONFIG_TRACEPOINTS-to-warn.patch
index 6d81c81efe..76a5787c37 100644
--- a/meta/recipes-kernel/lttng/lttng-modules/0001-src-Kbuild-change-missing-CONFIG_TRACEPOINTS-to-warn.patch
+++ b/meta/recipes-kernel/lttng/lttng-modules/0001-src-Kbuild-change-missing-CONFIG_TRACEPOINTS-to-warn.patch
@@ -1,4 +1,4 @@
-From 0287f5c32b9fd99078e71c22ca679343d18f1513 Mon Sep 17 00:00:00 2001
+From 878f89b6136ff7b870a19e04901cc6f316bbe10a Mon Sep 17 00:00:00 2001
 From: Bruce Ashfield <bruce.ashfield@gmail.com>
 Date: Sat, 15 May 2021 10:26:38 -0400
 Subject: [PATCH] src/Kbuild: change missing CONFIG_TRACEPOINTS to warning
@@ -16,22 +16,31 @@ Upstream-Status: Inappropriate [embedded specific]
 
 Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
 ---
- src/Kbuild | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
+ src/Kbuild | 7 ++++++-
+ 1 file changed, 6 insertions(+), 1 deletion(-)
 
 diff --git a/src/Kbuild b/src/Kbuild
-index 7137874f..18a43b50 100644
+index 7137874..04eb5c9 100644
 --- a/src/Kbuild
 +++ b/src/Kbuild
-@@ -2,7 +2,7 @@
+@@ -2,10 +2,13 @@
  
  ifdef CONFIG_LOCALVERSION	# Check if dot-config is included.
    ifeq ($(CONFIG_TRACEPOINTS),)
 -    $(error The option CONFIG_TRACEPOINTS needs to be enabled in your kernel configuration)
 +    $(warning The option CONFIG_TRACEPOINTS needs to be enabled in your kernel configuration)
++    DISABLE_MODULE = y
    endif # CONFIG_TRACEPOINTS
  endif # ifdef CONFIG_LOCALVERSION
  
--- 
-2.19.1
-
++ifneq ($(DISABLE_MODULE),y)
++
+ TOP_LTTNG_MODULES_DIR := $(shell dirname $(lastword $(MAKEFILE_LIST)))/..
+ 
+ lttng_check_linux_version = $(shell pwd)/include/linux/version.h
+@@ -150,3 +153,5 @@ lttng-statedump-objs := lttng-statedump-impl.o
+ obj-$(CONFIG_LTTNG) += probes/
+ obj-$(CONFIG_LTTNG) += lib/
+ obj-$(CONFIG_LTTNG) += tests/
++
++endif # DISABLE_MODULE
diff --git a/meta/recipes-kernel/lttng/lttng-modules/Makefile-Do-not-fail-if-CONFIG_TRACEPOINTS-is-not-en.patch b/meta/recipes-kernel/lttng/lttng-modules/Makefile-Do-not-fail-if-CONFIG_TRACEPOINTS-is-not-en.patch
deleted file mode 100644
index a852834344..0000000000
--- a/meta/recipes-kernel/lttng/lttng-modules/Makefile-Do-not-fail-if-CONFIG_TRACEPOINTS-is-not-en.patch
+++ /dev/null
@@ -1,37 +0,0 @@
-From 1b0e574d680101105a6c1e8931c78824f5a97a42 Mon Sep 17 00:00:00 2001
-From: Otavio Salvador <otavio@ossystems.com.br>
-Date: Mon, 5 Sep 2016 17:08:56 +0000
-Subject: [PATCH] Makefile: Do not fail if CONFIG_TRACEPOINTS is not enabled
-Organization: O.S. Systems Software LTDA.
-
-The lttng-modules are being pulled by the tools-profile image feature,
-however, not every kernel has the CONFIG_TRACEPOINTS feature enabled.
-
-This change makes the build do not fail when CONFIG_TRACEPOINTS is not
-available, allowing it to be kept being pulled by default.
-
-Upstream-Status: Inappropriate [embedded specific]
-
-Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
-[bva: modified for lttng-modules 2.13+ context]
-Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
----
- Makefile | 9 +++++----
- 1 file changed, 5 insertions(+), 4 deletions(-)
-
-Index: lttng-modules-2.13.0/Makefile
-===================================================================
---- lttng-modules-2.13.0.orig/Makefile
-+++ lttng-modules-2.13.0/Makefile
-@@ -7,6 +7,11 @@
- 
- obj-$(CONFIG_LTTNG) += src/
- 
-+  ifdef CONFIG_LOCALVERSION	# Check if dot-config is included.
-+    ifneq ($(CONFIG_TRACEPOINTS),)
-+      $(warning The option CONFIG_TRACEPOINTS needs to be enabled in your kernel configuration)
-+    endif # CONFIG_TRACEPOINTS
-+  endif # ifdef CONFIG_LOCALVERSION
- else # KERNELRELEASE
- 
- # This part of the Makefile is used when the 'make' command is runned in the
diff --git a/meta/recipes-kernel/lttng/lttng-modules_2.13.0.bb b/meta/recipes-kernel/lttng/lttng-modules_2.13.0.bb
index b95d7ecaaf..109f5d6933 100644
--- a/meta/recipes-kernel/lttng/lttng-modules_2.13.0.bb
+++ b/meta/recipes-kernel/lttng/lttng-modules_2.13.0.bb
@@ -9,9 +9,9 @@ inherit module
 
 include lttng-platforms.inc
 
-SRC_URI = "https://lttng.org/files/${BPN}/${BPN}-${PV}.tar.bz2 \
-           file://Makefile-Do-not-fail-if-CONFIG_TRACEPOINTS-is-not-en.patch \
-           "
+SRC_URI = "https://lttng.org/files/${BPN}/${BPN}-${PV}.tar.bz2"
+# Use :append here so that the patch is applied also when using devupstream
+SRC_URI:append = " file://0001-src-Kbuild-change-missing-CONFIG_TRACEPOINTS-to-warn.patch"
 
 SRC_URI[sha256sum] = "5ebf2b3cd128b3a1c8afaea1e98d5a6f7f0676fd524fcf72361c34d9dc603356"
 
@@ -34,9 +34,7 @@ python do_package:prepend() {
 BBCLASSEXTEND = "devupstream:target"
 LIC_FILES_CHKSUM:class-devupstream = "file://LICENSE;md5=0464cff101a009c403cd2ed65d01d4c4"
 DEFAULT_PREFERENCE:class-devupstream = "-1"
-SRC_URI:class-devupstream = "git://git.lttng.org/lttng-modules;branch=stable-2.13 \
-           file://0001-src-Kbuild-change-missing-CONFIG_TRACEPOINTS-to-warn.patch \
-           "
+SRC_URI:class-devupstream = "git://git.lttng.org/lttng-modules;branch=stable-2.13"
 
 SRCREV:class-devupstream = "f982b51a98a29cb4aaf607cb9bbf2b509d8e6933"
 PV:class-devupstream = "2.13.0-rc2+git${SRCPV}"

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [OE-core] [PATCHv2] lttng-modules: Make it build when CONFIG_TRACEPOINTS is not enabled again
  2021-08-25 13:20 [PATCHv2] lttng-modules: Make it build when CONFIG_TRACEPOINTS is not enabled again Peter Kjellerstedt
@ 2021-08-25 15:10 ` Andrey Zhizhikin
  0 siblings, 0 replies; 2+ messages in thread
From: Andrey Zhizhikin @ 2021-08-25 15:10 UTC (permalink / raw)
  To: Peter Kjellerstedt; +Cc: Bruce Ashfield, OE Core mailing list

Hello Peter,

On Wed, Aug 25, 2021 at 3:21 PM Peter Kjellerstedt
<peter.kjellerstedt@axis.com> wrote:
>
> Makefile-Do-not-fail-if-CONFIG_TRACEPOINTS-is-not-en.patch was updated
> with the 2.13.0 update (commit 5dad15af), but unfortunately it no
> longer did what it was intended to do. There is also
> 0001-src-Kbuild-change-missing-CONFIG_TRACEPOINTS-to-warn.patch, which
> was based on the former patch, but it too does not solve the problem.
>
> Unify the two patches, and actually disable building of the kernel
> module if CONFIG_TRACEPOINTS is not enabled, the way it was intended.
>
> Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
> ---
>
> PATCHv2: Unify
> Makefile-Do-not-fail-if-CONFIG_TRACEPOINTS-is-not-en.patch and
> 0001-src-Kbuild-change-missing-CONFIG_TRACEPOINTS-to-warn.patch into
> the latter, and use that both with and without devupstream.

I've tried the patch on my end, but it seems as if it does not resolve
the build issue entirely.

Compile stage is skipped with the message:
"lttng-modules-2.13.0/src/Kbuild:5: The option CONFIG_TRACEPOINTS
needs to be enabled in your kernel configuration"
which is totally fine.

However, the install fails due to the do_install:append in recipe
contains following:
do_install:append() {
        # Delete empty directories to avoid QA failures if no modules were built
        find ${D}/${nonarch_base_libdir} -depth -type d -empty -exec rmdir {} \;
}

Since there was no module produced by do_compile() -
${D}/${nonarch_base_libdir} is non-existent, and find fails.

I was wondering if you've seen the same build failure on your end?

Also, if I explicitly check for folder existence like following:
do_install:append() {
        # Delete empty directories to avoid QA failures if no modules were built
        if [ -d ${D}/${nonarch_base_libdir} ]; then
                find ${D}/${nonarch_base_libdir} -depth -type d -empty
-exec rmdir {} \;
        fi
}

then package is built fine.

Wonder if you would want to apply it in your patch set?

>
>  ...e-missing-CONFIG_TRACEPOINTS-to-warn.patch | 25 +++++++++----
>  ...fail-if-CONFIG_TRACEPOINTS-is-not-en.patch | 37 -------------------
>  .../lttng/lttng-modules_2.13.0.bb             | 10 ++---
>  3 files changed, 21 insertions(+), 51 deletions(-)
>  delete mode 100644 meta/recipes-kernel/lttng/lttng-modules/Makefile-Do-not-fail-if-CONFIG_TRACEPOINTS-is-not-en.patch
>


-- 
Regards,
Andrey.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-08-25 15:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-25 13:20 [PATCHv2] lttng-modules: Make it build when CONFIG_TRACEPOINTS is not enabled again Peter Kjellerstedt
2021-08-25 15:10 ` [OE-core] " Andrey Zhizhikin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.