ktap: deterministic build
cover ktap: deterministic build
Add some configuration to the build process of ktap, to get a more deterministic build. Currently, the v0.4 recipe will build with libelf support (from the elfutils recipe), if that is found during the compile stage, thus we have a non-deterministic build going on.
At the same time, I'm also adding support for the FFI configuration. This part has only been imlemented with a limited build test, as it's only supported on x86_64 (which I'm not normally building for).
The configuration of both LIBELF and FFI has been implemented using PACKAGECONFIG, even though it's only the LIBELF part that make any real use of that infrastructure. For FFI, it's only been used to get a consistent configuration tool for both options.
* basic FFI support (depend on CONFIG_KTAP_FFI) FFI will allow call kernel function from ktap script
cdef [[ int printk(char *fmt, ...); ]] C.printk("this is ffi printk from ktap\n")
(currently only support basic C types, structure support is ongoing)
The following changes since commit 6daf75e4e980b86d6e0a12513764044f7ea711be:
Update after toplevel LICENSE file checksum change (2014-01-04 08:47:18 +0100)
are available in the git repository at:
git://github.com/darander/meta-oe ktap_v0.4
https://github.com/darander/meta-oe/tree/ktap_v0.4
Anders Darander (1):
ktap: add configs for elfutils and ffi
meta-oe/recipes-kernel/ktap/ktap-module_0.4.bb | 5 ++++- meta-oe/recipes-kernel/ktap/ktap.inc | 2 ++ meta-oe/recipes-kernel/ktap/ktap_0.4.bb | 12 +++++++++++- 3 files changed, 17 insertions(+), 2 deletions(-)
Signature · 1 line
1.8.5.2
PATCH 1/1 ktap: add configs for elfutils and ffi
libelf (elfutils) is required for resolving symbols in DSO and for sdt (taken from ktap docs). The earlier v0.4 recipe built ktap against libelf if it was found, thus enable it per default.
FFI needs to be enabled for both userspace and kernel module. Currently, it is only supported for x86_64 (enforced when building ktap-module).
--- meta-oe/recipes-kernel/ktap/ktap-module_0.4.bb | 5 ++++- meta-oe/recipes-kernel/ktap/ktap.inc | 2 ++ meta-oe/recipes-kernel/ktap/ktap_0.4.bb | 12 +++++++++++- 3 files changed, 17 insertions(+), 2 deletions(-)
meta-oe/recipes-kernel/ktap/ktap-module_0.4.bb +4 -1
@@ -6,8 +6,11 @@ DESCRIPTION = "KTAP is a scripting dynamic tracing tool for Linux" inherit module +# Available package configs: ffi (only supported on x86_64) +PACKAGECONFIG ?= "" + # Only build the module -MAKE_TARGETS = "mod" +MAKE_TARGETS = "${@base_contains('PACKAGECONFIG', 'ffi', 'FFI=1', '', d)} mod" # Kernel module packages MUST begin with 'kernel-module-', otherwise # multilib image generation can fail.
meta-oe/recipes-kernel/ktap/ktap.inc +2 -0
@@ -9,3 +9,5 @@ SRC_URI = "git://github.com/ktap/ktap.git" S = "${WORKDIR}/git" +# Package config is abused as a general compile time configuration tool. +PACKAGECONFIG[ffi] = ""
meta-oe/recipes-kernel/ktap/ktap_0.4.bb +11 -1
@@ -5,8 +5,18 @@ require ktap.inc SUMMARY = "KTAP is a scripting dynamic tracing tool for Linux" DEPENDS = "ktap-module" +#Available package configs: +# libelf - needed to resolve symbols in DSO and for sdt +# ffi - only supports x86_64 for now!. Needs to be enabled for ktap-module too. +PACKAGECONFIG ?= "libelf" + +PACKAGECONFIG[libelf] = ",,elfutils" +PACKAGECONFIG[ffi] = "" + # Only build the userspace app -EXTRA_OEMAKE = "ktap" +EXTRA_OEMAKE = "${@base_contains('PACKAGECONFIG', 'libelf', '', 'NO_LIBELF=1', d)} \ + ${@base_contains('PACKAGECONFIG', 'ffi', 'FFI=1', '', d)} \ + ktap" do_install() { install -d ${D}${bindir}
Signature · 1 line
1.8.5.2
Re: [meta-oe][PATCH 1/1] ktap: add configs for elfutils and ffi
Quoted 46 lines · Anders Darander
libelf (elfutils) is required for resolving symbols in DSO and for sdt (taken from ktap docs). The earlier v0.4 recipe built ktap against libelf if it was found, thus enable it per default.
FFI needs to be enabled for both userspace and kernel module. Currently, it is only supported for
x86_64(enforced when building ktap-module).Signed-off-by Anders Darander <[email protected]>--- meta-oe/recipes-kernel/ktap/ktap-module_0.4.bb | 5 ++++- meta-oe/recipes-kernel/ktap/ktap.inc | 2 ++ meta-oe/recipes-kernel/ktap/ktap_0.4.bb | 12 +++++++++++- 3 files changed, 17 insertions(+), 2 deletions(-)meta-oe/recipes-kernel/ktap/ktap-module_0.4.bb +4
-1@@ -6,8 +6,11 @@ DESCRIPTION = "KTAP is a scripting dynamic tracing tool for Linux" inherit module +# Available package configs: ffi (only supported on x86_64) +PACKAGECONFIG ?= "" + # Only build the module -MAKE_TARGETS = "mod" +MAKE_TARGETS = "${@base_contains('PACKAGECONFIG', 'ffi', 'FFI=1', '', d)} mod" # Kernel module packages MUST begin with 'kernel-module-', otherwise # multilib image generation can fail.meta-oe/recipes-kernel/ktap/ktap.inc +2
-0@@ -9,3 +9,5 @@ SRC_URI = "git://github.com/ktap/ktap.git" S = "${WORKDIR}/git" +# Package config is abused as a general compile time configuration tool. +PACKAGECONFIG[ffi] = ""meta-oe/recipes-kernel/ktap/ktap_0.4.bb +0
-0
meta-oe/recipes-kernel/ktap/ktap_0.4.bb require ktap.inc · line 14
Quoted 10 lines
meta-oe/recipes-kernel/ktap/ktap_0.4.bb +7
-0@@ -5,8 +5,18 @@ require ktap.inc SUMMARY = "KTAP is a scripting dynamic tracing tool for Linux" DEPENDS = "ktap-module" +#Available package configs: +# libelf - needed to resolve symbols in DSO and for sdt +# ffi - only supports x86_64 for now!. Needs to be enabled for ktap-module too. +PACKAGECONFIG ?= "libelf" + +PACKAGECONFIG[libelf] = ",,elfutils" +PACKAGECONFIG[ffi] = ""
This line is already in ktap.inc
Otherwise looks good, I like deterministic shiny things.
Quoted 16 lines
meta-oe/recipes-kernel/ktap/ktap_0.4.bb +4
-1+ # Only build the userspace app -EXTRA_OEMAKE = "ktap" +EXTRA_OEMAKE = "${@base_contains('PACKAGECONFIG', 'libelf', '', 'NO_LIBELF=1', d)} \ + ${@base_contains('PACKAGECONFIG', 'ffi', 'FFI=1', '', d)} \ + ktap" do_install() { install -d ${D}${bindir}Signature · 6 lines
1.8.5.2 _______________________________________________ Openembedded-devel mailing list [email protected] http://lists.openembedded.org/mailman/listinfo/openembedded-devel
Signature · 1 line
Martin 'JaMa' Jansa jabber: [email protected]
Re: [meta-oe][PATCH 1/1] ktap: add configs for elfutils and ffi
Quoted 9 lines · Martin Jansa
Quoted 7 lines · Anders Darander
meta-oe/recipes-kernel/ktap/ktap_0.4.bb +0
-0@@ -5,8 +5,18 @@ require ktap.inc SUMMARY = "KTAP is a scripting dynamic tracing tool for Linux" DEPENDS = "ktap-module"
Quoted 9 lines
meta-oe/recipes-kernel/ktap/ktap_0.4.bb require ktap.inc · line 14
Quoted 7 lines
meta-oe/recipes-kernel/ktap/ktap_0.4.bb +7
-0+#Available package configs: +# libelf - needed to resolve symbols in DSO and for sdt +# ffi - only supports x86_64 for now!. Needs to be enabled for ktap-module too. +PACKAGECONFIG ?= "libelf" + +PACKAGECONFIG[libelf] = ",,elfutils" +PACKAGECONFIG[ffi] = ""This line is already in ktap.inc
Ah, damn it... Thanks for spotting this!
I had it here first, before realising that I needed the same options for ktap-module. I'll wait a day or two before I respin the patch, to allow for anyone else to comment on it.
Cheers,
Anders
Quoted 1 line
Otherwise looks good, I like deterministic shiny things.
Signature · 2 lines
Anders Darander ChargeStorm AB / eStorm AB