From 09e448e13853e8bce535967454cf08e62e76c6c0 Mon Sep 17 00:00:00 2001 From: Martin Jansa Date: Thu, 7 Sep 2023 10:45:25 +0200 Subject: bcc: move to the right dynamic-layer * it depends not only on meta-oe, but on meta-python as well and because meta-python depends on meta-oe, we can enable this when ever meta-python is included * fixes: NOTE: Resolving any missing task queue dependencies ERROR: Nothing RPROVIDES 'python3-pyroute2' (but /OE/build/oe-core/meta-clang/dynamic-layers/openembedded-layer/recipes-devtools/bcc/bcc_0.28.0.bb RDEPENDS on or otherwise requires it) NOTE: Runtime target 'python3-pyroute2' is unbuildable, removing... Missing or unbuildable dependency chain was: ['python3-pyroute2'] ERROR: Nothing RPROVIDES 'python3-netaddr' (but /OE/build/oe-core/meta-clang/dynamic-layers/openembedded-layer/recipes-devtools/bcc/bcc_0.28.0.bb RDEPENDS on or otherwise requires it) NOTE: Runtime target 'python3-netaddr' is unbuildable, removing... Missing or unbuildable dependency chain was: ['python3-netaddr'] ERROR: Nothing RPROVIDES 'bcc-dev' (but /OE/build/oe-core/meta-clang/dynamic-layers/openembedded-layer/recipes-devtools/bcc/bcc_0.28.0.bb RDEPENDS on or otherwise requires it) No eligible RPROVIDERs exist for 'bcc-dev' NOTE: Runtime target 'bcc-dev' is unbuildable, removing... Missing or unbuildable dependency chain was: ['bcc-dev'] ERROR: Nothing RPROVIDES 'bcc' (but /OE/build/oe-core/meta-clang/dynamic-layers/openembedded-layer/recipes-devtools/bcc/bcc_0.28.0.bb RDEPENDS on or otherwise requires it) No eligible RPROVIDERs exist for 'bcc' NOTE: Runtime target 'bcc' is unbuildable, removing... Missing or unbuildable dependency chain was: ['bcc'] --- ...MakeLists.txt-override-the-PY_CMD_ESCAPED.patch | 41 +++++++ ...-enough-extra-headers-to-allow-libbpf-to-.patch | 124 +++++++++++++++++++++ ...eLists.txt-Remove-check-for-host-etc-debi.patch | 35 ++++++ .../bcc/bcc/0001-tests-cc-Use-c-14-standard.patch | 29 +++++ .../0001-tools-trace.py-Fix-failing-to-exit.patch | 41 +++++++ .../recipes-devtools/bcc/bcc/ptest_wrapper.sh | 16 +++ .../meta-python/recipes-devtools/bcc/bcc/run-ptest | 42 +++++++ .../meta-python/recipes-devtools/bcc/bcc_0.28.0.bb | 76 +++++++++++++ ...MakeLists.txt-override-the-PY_CMD_ESCAPED.patch | 41 ------- ...-enough-extra-headers-to-allow-libbpf-to-.patch | 124 --------------------- ...eLists.txt-Remove-check-for-host-etc-debi.patch | 35 ------ .../bcc/bcc/0001-tests-cc-Use-c-14-standard.patch | 29 ----- .../0001-tools-trace.py-Fix-failing-to-exit.patch | 41 ------- .../recipes-devtools/bcc/bcc/ptest_wrapper.sh | 16 --- .../recipes-devtools/bcc/bcc/run-ptest | 42 ------- .../recipes-devtools/bcc/bcc_0.28.0.bb | 76 ------------- 16 files changed, 404 insertions(+), 404 deletions(-) create mode 100644 dynamic-layers/meta-python/recipes-devtools/bcc/bcc/0001-CMakeLists.txt-override-the-PY_CMD_ESCAPED.patch create mode 100644 dynamic-layers/meta-python/recipes-devtools/bcc/bcc/0001-Vendor-just-enough-extra-headers-to-allow-libbpf-to-.patch create mode 100644 dynamic-layers/meta-python/recipes-devtools/bcc/bcc/0001-python-CMakeLists.txt-Remove-check-for-host-etc-debi.patch create mode 100644 dynamic-layers/meta-python/recipes-devtools/bcc/bcc/0001-tests-cc-Use-c-14-standard.patch create mode 100644 dynamic-layers/meta-python/recipes-devtools/bcc/bcc/0001-tools-trace.py-Fix-failing-to-exit.patch create mode 100644 dynamic-layers/meta-python/recipes-devtools/bcc/bcc/ptest_wrapper.sh create mode 100644 dynamic-layers/meta-python/recipes-devtools/bcc/bcc/run-ptest create mode 100644 dynamic-layers/meta-python/recipes-devtools/bcc/bcc_0.28.0.bb delete mode 100644 dynamic-layers/openembedded-layer/recipes-devtools/bcc/bcc/0001-CMakeLists.txt-override-the-PY_CMD_ESCAPED.patch delete mode 100644 dynamic-layers/openembedded-layer/recipes-devtools/bcc/bcc/0001-Vendor-just-enough-extra-headers-to-allow-libbpf-to-.patch delete mode 100644 dynamic-layers/openembedded-layer/recipes-devtools/bcc/bcc/0001-python-CMakeLists.txt-Remove-check-for-host-etc-debi.patch delete mode 100644 dynamic-layers/openembedded-layer/recipes-devtools/bcc/bcc/0001-tests-cc-Use-c-14-standard.patch delete mode 100644 dynamic-layers/openembedded-layer/recipes-devtools/bcc/bcc/0001-tools-trace.py-Fix-failing-to-exit.patch delete mode 100644 dynamic-layers/openembedded-layer/recipes-devtools/bcc/bcc/ptest_wrapper.sh delete mode 100644 dynamic-layers/openembedded-layer/recipes-devtools/bcc/bcc/run-ptest delete mode 100644 dynamic-layers/openembedded-layer/recipes-devtools/bcc/bcc_0.28.0.bb (limited to 'dynamic-layers') diff --git a/dynamic-layers/meta-python/recipes-devtools/bcc/bcc/0001-CMakeLists.txt-override-the-PY_CMD_ESCAPED.patch b/dynamic-layers/meta-python/recipes-devtools/bcc/bcc/0001-CMakeLists.txt-override-the-PY_CMD_ESCAPED.patch new file mode 100644 index 0000000..3e0a6aa --- /dev/null +++ b/dynamic-layers/meta-python/recipes-devtools/bcc/bcc/0001-CMakeLists.txt-override-the-PY_CMD_ESCAPED.patch @@ -0,0 +1,41 @@ +From 4f64ed40e1ffea7ea278627f30a01018e57dcbcf Mon Sep 17 00:00:00 2001 +From: Mingli Yu +Date: Wed, 9 Sep 2020 05:48:19 +0000 +Subject: [PATCH] CMakeLists.txt: override the PY_CMD_ESCAPED + +Override the PY_CMD_ESCAPED as the PY_CMD_ESCAPED is constructed by +the full path of the python3. In some cases, the path is so long and +result in the PY_CMD_ESCAPED exceeds 255 characters and comes below +do_configure error: + | CMake Error at src/python/CMakeLists.txt:18 (configure_file): + | configure_file Problem configuring file + | + | CMake Error: Could not open file for write in copy operation /buildarea1/test/wr_build/wr1020_20200909_bcc/bcc_long_Kernel/auto-standalone_next/200827/lxbuilds/Intel-Snow-Ridge-NS_platform_up/intel-x86-64-standard-glibc-std/wrlinux/build/tmp-glibc/work/corei7-64-wrs-linux/bcc/0.15.0-r0/build/src/python/bcc--buildarea1-test-wr_build-wr1020_20200909_bcc-bcc_long_Kernel-auto-standalone_next-200827-lxbuilds-Intel-Snow-Ridge-NS_platform_up-intel-x86-64-standard-glibc-std-wrlinux-build-tmp-glibc-work-corei7-64-wrs-linux-bcc-0.15.0-r0-recipe-sysroot-native-usr-bin-python3-native-python3/bcc/version.py.tmp + +Upstream-Status: Pending + +Signed-off-by: Mingli Yu +--- + src/python/CMakeLists.txt | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/src/python/CMakeLists.txt ++++ b/src/python/CMakeLists.txt +@@ -12,7 +12,7 @@ file(GLOB_RECURSE PYTHON_INCLUDES RELATI + + foreach(PY_CMD ${PYTHON_CMD}) + string(REPLACE "/" "-" PY_CMD_ESCAPED ${PY_CMD}) +- set(PY_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bcc-${PY_CMD_ESCAPED}) ++ set(PY_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bcc-python3) + + foreach(PY_SRC ${PYTHON_SOURCES}) + configure_file(${PY_SRC} ${PY_DIRECTORY}/${PY_SRC} COPYONLY) +@@ -31,7 +31,7 @@ foreach(PY_CMD ${PYTHON_CMD}) + DEPENDS ${PYTHON_SOURCES} ${PYTHON_INCLUDES} + COMMENT "Building sdist for ${PY_CMD}" + ) +- add_custom_target(bcc_py_${PY_CMD_ESCAPED} ALL DEPENDS ${PIP_INSTALLABLE}) ++ add_custom_target(bcc_py_python3 ALL DEPENDS ${PIP_INSTALLABLE}) + + install( + CODE " diff --git a/dynamic-layers/meta-python/recipes-devtools/bcc/bcc/0001-Vendor-just-enough-extra-headers-to-allow-libbpf-to-.patch b/dynamic-layers/meta-python/recipes-devtools/bcc/bcc/0001-Vendor-just-enough-extra-headers-to-allow-libbpf-to-.patch new file mode 100644 index 0000000..c3c787d --- /dev/null +++ b/dynamic-layers/meta-python/recipes-devtools/bcc/bcc/0001-Vendor-just-enough-extra-headers-to-allow-libbpf-to-.patch @@ -0,0 +1,124 @@ +From 6cffc195eca6b53a12865d325ff97e7b5ba8f22b Mon Sep 17 00:00:00 2001 +From: Daniel Thompson +Date: Thu, 19 May 2022 09:14:20 +0000 +Subject: [PATCH] Vendor just enough extra headers to allow libbpf to be + de-vendored + +Currently it is not possible to build the bcc recipe when we de-vendor +libbpf and adopt the packaged version. Ironically this is due to the +deliberate vendoring of some depreciated btf code that is being removed +upstream because bcc was the only user! In other words the vendored code +doesn't work the de-vendored libbpf because also ends up de-vendoring +one of the Linux uapi headers. + +This is obviously an OE specific issue (due to the current combination +of linux headers, libbpf and bcc). It's a bit of a mess and the right +solution is probably to update the system UAPI headers but I am committing +this for now simply so I can easily show why we must de-vendor libbpf in +the first place! + +Upstream-Status: Inappropriate [other] + +Signed-off-by: Daniel Thompson +--- + src/cc/bcc_btf.cc | 87 +++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 87 insertions(+) + +diff --git a/src/cc/bcc_btf.cc b/src/cc/bcc_btf.cc +index 7f551ae8..cca3c6c3 100644 +--- a/src/cc/bcc_btf.cc ++++ b/src/cc/bcc_btf.cc +@@ -33,6 +33,93 @@ + + namespace btf_ext_vendored { + ++#ifdef HAVE_EXTERNAL_LIBBPF ++/* ++ * When we de-vendor libbpf we end up picking up an older version of ++ * [uapi/]linux/bpf.h which misses out some of the data structures needed ++ * to compile this file. Annoyingly the code that doesn't compile it ++ * a result of de-vendoring ++ * ++ * This section is a minimized re-vendoring to fix that. It is not robust ++ * against version skew: When the system linux/bpf.h is updated then this ++ * will break the build and the patch can be dropped. ++ */ ++ ++/* bpf_core_relo_kind encodes which aspect of captured field/type/enum value ++ * has to be adjusted by relocations. It is emitted by llvm and passed to ++ * libbpf and later to the kernel. ++ */ ++enum bpf_core_relo_kind { ++ BPF_CORE_FIELD_BYTE_OFFSET = 0, /* field byte offset */ ++ BPF_CORE_FIELD_BYTE_SIZE = 1, /* field size in bytes */ ++ BPF_CORE_FIELD_EXISTS = 2, /* field existence in target kernel */ ++ BPF_CORE_FIELD_SIGNED = 3, /* field signedness (0 - unsigned, 1 - signed) */ ++ BPF_CORE_FIELD_LSHIFT_U64 = 4, /* bitfield-specific left bitshift */ ++ BPF_CORE_FIELD_RSHIFT_U64 = 5, /* bitfield-specific right bitshift */ ++ BPF_CORE_TYPE_ID_LOCAL = 6, /* type ID in local BPF object */ ++ BPF_CORE_TYPE_ID_TARGET = 7, /* type ID in target kernel */ ++ BPF_CORE_TYPE_EXISTS = 8, /* type existence in target kernel */ ++ BPF_CORE_TYPE_SIZE = 9, /* type size in bytes */ ++ BPF_CORE_ENUMVAL_EXISTS = 10, /* enum value existence in target kernel */ ++ BPF_CORE_ENUMVAL_VALUE = 11, /* enum value integer value */ ++}; ++ ++/* ++ * "struct bpf_core_relo" is used to pass relocation data form LLVM to libbpf ++ * and from libbpf to the kernel. ++ * ++ * CO-RE relocation captures the following data: ++ * - insn_off - instruction offset (in bytes) within a BPF program that needs ++ * its insn->imm field to be relocated with actual field info; ++ * - type_id - BTF type ID of the "root" (containing) entity of a relocatable ++ * type or field; ++ * - access_str_off - offset into corresponding .BTF string section. String ++ * interpretation depends on specific relocation kind: ++ * - for field-based relocations, string encodes an accessed field using ++ * a sequence of field and array indices, separated by colon (:). It's ++ * conceptually very close to LLVM's getelementptr ([0]) instruction's ++ * arguments for identifying offset to a field. ++ * - for type-based relocations, strings is expected to be just "0"; ++ * - for enum value-based relocations, string contains an index of enum ++ * value within its enum type; ++ * - kind - one of enum bpf_core_relo_kind; ++ * ++ * Example: ++ * struct sample { ++ * int a; ++ * struct { ++ * int b[10]; ++ * }; ++ * }; ++ * ++ * struct sample *s = ...; ++ * int *x = &s->a; // encoded as "0:0" (a is field #0) ++ * int *y = &s->b[5]; // encoded as "0:1:0:5" (anon struct is field #1, ++ * // b is field #0 inside anon struct, accessing elem #5) ++ * int *z = &s[10]->b; // encoded as "10:1" (ptr is used as an array) ++ * ++ * type_id for all relocs in this example will capture BTF type id of ++ * `struct sample`. ++ * ++ * Such relocation is emitted when using __builtin_preserve_access_index() ++ * Clang built-in, passing expression that captures field address, e.g.: ++ * ++ * bpf_probe_read(&dst, sizeof(dst), ++ * __builtin_preserve_access_index(&src->a.b.c)); ++ * ++ * In this case Clang will emit field relocation recording necessary data to ++ * be able to find offset of embedded `a.b.c` field within `src` struct. ++ * ++ * [0] https://llvm.org/docs/LangRef.html#getelementptr-instruction ++ */ ++struct bpf_core_relo { ++ __u32 insn_off; ++ __u32 type_id; ++ __u32 access_str_off; ++ enum bpf_core_relo_kind kind; ++}; ++#endif /* HAVE_EXTERNAL_LIBBPF */ ++ + /* The minimum bpf_func_info checked by the loader */ + struct bpf_func_info_min { + uint32_t insn_off; diff --git a/dynamic-layers/meta-python/recipes-devtools/bcc/bcc/0001-python-CMakeLists.txt-Remove-check-for-host-etc-debi.patch b/dynamic-layers/meta-python/recipes-devtools/bcc/bcc/0001-python-CMakeLists.txt-Remove-check-for-host-etc-debi.patch new file mode 100644 index 0000000..3ca7fdd --- /dev/null +++ b/dynamic-layers/meta-python/recipes-devtools/bcc/bcc/0001-python-CMakeLists.txt-Remove-check-for-host-etc-debi.patch @@ -0,0 +1,35 @@ +From cb3f032b55b32c50201862b26c76ea18ad37cb39 Mon Sep 17 00:00:00 2001 +From: Ovidiu Panait +Date: Thu, 30 Jan 2020 14:19:33 +0200 +Subject: [PATCH] python/CMakeLists.txt: Remove check for host + /etc/debian_version + +Fix the following error that occurs during do_install when using the native +version of python3: +usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...] + or: setup.py --help [cmd1 cmd2 ...] + or: setup.py --help-commands + or: setup.py cmd --help + +error: option --install-layout not recognized + +Upstream-Status: Inappropriate [oe-specific] + +Signed-off-by: Ovidiu Panait +--- + src/python/CMakeLists.txt | 4 ---- + 1 file changed, 4 deletions(-) + +--- a/src/python/CMakeLists.txt ++++ b/src/python/CMakeLists.txt +@@ -5,10 +5,6 @@ if(NOT PYTHON_CMD) + set(PYTHON_CMD "python3") + endif() + +-if(EXISTS "/etc/debian_version") +- set(PYTHON_FLAGS "${PYTHON_FLAGS} --install-layout deb") +-endif() +- + file(GLOB_RECURSE PYTHON_SOURCES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/*.py) + file(GLOB_RECURSE PYTHON_INCLUDES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} diff --git a/dynamic-layers/meta-python/recipes-devtools/bcc/bcc/0001-tests-cc-Use-c-14-standard.patch b/dynamic-layers/meta-python/recipes-devtools/bcc/bcc/0001-tests-cc-Use-c-14-standard.patch new file mode 100644 index 0000000..dcd9dc1 --- /dev/null +++ b/dynamic-layers/meta-python/recipes-devtools/bcc/bcc/0001-tests-cc-Use-c-14-standard.patch @@ -0,0 +1,29 @@ +From 9f45e12ad4689ca2c41844b77c6d789d21509a13 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Mon, 6 Mar 2023 13:26:11 -0800 +Subject: [PATCH] tests/cc: Use c++14 standard + +default c++ standard was bumped to c++17 when using clang16+ compiler +via 907b89cc9, however, tests which use check tool is not yet ported +to work with c++17 standard, therefore use c++14 on tests + +Upstream-Status: Submitted [https://github.com/iovisor/bcc/pull/4506] +Signed-off-by: Khem Raj +Cc: Hengqi Chen +--- + tests/cc/CMakeLists.txt | 4 ++++ + 1 file changed, 4 insertions(+) + +--- a/tests/cc/CMakeLists.txt ++++ b/tests/cc/CMakeLists.txt +@@ -27,6 +27,10 @@ if(${LLVM_PACKAGE_VERSION} VERSION_EQUAL + set(CMAKE_CXX_STANDARD 14) + endif() + ++if(${LLVM_PACKAGE_VERSION} VERSION_EQUAL 16 OR ${LLVM_PACKAGE_VERSION} VERSION_GREATER 16) ++set(CMAKE_CXX_STANDARD 14) ++endif() ++ + if(ENABLE_USDT) + set(TEST_LIBBCC_SOURCES + test_libbcc.cc diff --git a/dynamic-layers/meta-python/recipes-devtools/bcc/bcc/0001-tools-trace.py-Fix-failing-to-exit.patch b/dynamic-layers/meta-python/recipes-devtools/bcc/bcc/0001-tools-trace.py-Fix-failing-to-exit.patch new file mode 100644 index 0000000..6ac7219 --- /dev/null +++ b/dynamic-layers/meta-python/recipes-devtools/bcc/bcc/0001-tools-trace.py-Fix-failing-to-exit.patch @@ -0,0 +1,41 @@ +From a9f59fc8605de1bcca0b6c2d8132585f40c3b9bc Mon Sep 17 00:00:00 2001 +From: He Zhe +Date: Thu, 13 Aug 2020 11:25:58 +0800 +Subject: [PATCH] tools/trace.py: Fix failing to exit + +Class Probe::print_event is used as a callback of a ctypes wrapper. With +Yocto latest python v3.8.5, the exception raised by exit() is ignored and +thus trace cannot exit. Use os._exit(0) instead. + +$ /usr/share/bcc/tools/trace do_sys_open -M 1 +PID TID COMM FUNC +3740 3740 irqbalance do_sys_open +Exception ignored on calling ctypes callback function: +.raw_cb at 0x7f7c9efea280> +Traceback (most recent call last): +File "/usr/lib64/python3.8/site-packages/bcc/table.py", line 685, in raw_cb_ +callback(cpu, data, size) +File "/usr/share/bcc/tools/trace", line 630, in print_event +exit() +File "/usr/lib64/python3.8/sitebuiltins.py", line 26, in __call_ +raise SystemExit(code) +SystemExit: None + +Upstream-Status: Pending + +Signed-off-by: He Zhe +--- + tools/trace.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/tools/trace.py ++++ b/tools/trace.py +@@ -671,7 +671,7 @@ BPF_PERF_OUTPUT(%s); + if self.aggregate: + self.print_aggregate_events() + sys.stdout.flush() +- exit() ++ os._exit(0) + + def attach(self, bpf, verbose): + if len(self.library) == 0: diff --git a/dynamic-layers/meta-python/recipes-devtools/bcc/bcc/ptest_wrapper.sh b/dynamic-layers/meta-python/recipes-devtools/bcc/bcc/ptest_wrapper.sh new file mode 100644 index 0000000..92d0156 --- /dev/null +++ b/dynamic-layers/meta-python/recipes-devtools/bcc/bcc/ptest_wrapper.sh @@ -0,0 +1,16 @@ +#!/bin/sh +# Simple OE specific wrapper for bcc python tests + +name=$1 +kind=$2 +cmd=$3 +shift 3 + +case $kind in + simple|sudo) + $cmd "$@" + ;; + *) + echo "Invalid kind $kind of test $name" + exit 1 +esac diff --git a/dynamic-layers/meta-python/recipes-devtools/bcc/bcc/run-ptest b/dynamic-layers/meta-python/recipes-devtools/bcc/bcc/run-ptest new file mode 100644 index 0000000..a27f697 --- /dev/null +++ b/dynamic-layers/meta-python/recipes-devtools/bcc/bcc/run-ptest @@ -0,0 +1,42 @@ +#!/bin/sh + +cd tests || exit 1 + +PASS_CNT=0 +FAIL_CNT=0 +FAILED="" + +print_test_result() { + if [ $? -eq 0 ]; then + echo PASS: "$1" + PASS_CNT=$((PASS_CNT + 1)) + else + echo FAIL: "$1" + FAIL_CNT=$((FAIL_CNT + 1)) + FAILED="$FAILED $1;" + fi +} + +# Run CC tests, set IFS as test names have spaces +IFS=$(printf '\n\t') +for test_name in $(./cc/test_libbcc_no_libbpf --list-test-names-only); do + ./cc/test_libbcc_no_libbpf "$test_name" > /dev/null 2>&1 + print_test_result "cc $test_name" +done +unset IFS + +# Run python tests, skip namespace tests as they currently don't work +if cmake -DCMAKE_TESTING_ENABLED=ON -DTEST_WRAPPER="$(pwd)/ptest_wrapper.sh" python > /dev/null 2>&1; then + for test_name in $(awk -F '[( ]' '/^add_test/ && !/namespace/ {print $2}' CTestTestfile.cmake); do + ctest -Q -R "$test_name" + print_test_result "python $test_name" + done +else + print_test_result "cmake error, couldn't start python tests" +fi + +echo "#### bcc tests summary ####" +echo "# TOTAL: $((PASS_CNT + FAIL_CNT))" +echo "# PASS: $PASS_CNT" +echo "# FAIL: $FAIL_CNT ($FAILED)" +echo "###########################" diff --git a/dynamic-layers/meta-python/recipes-devtools/bcc/bcc_0.28.0.bb b/dynamic-layers/meta-python/recipes-devtools/bcc/bcc_0.28.0.bb new file mode 100644 index 0000000..105995d --- /dev/null +++ b/dynamic-layers/meta-python/recipes-devtools/bcc/bcc_0.28.0.bb @@ -0,0 +1,76 @@ +SUMMARY = "BPF Compiler Collection (BCC)" +HOMEPAGE = "https://github.com/iovisor/bcc" +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=e3fc50a88d0a364313df4b21ef20c29e" + +inherit cmake python3native manpages ptest + +DEPENDS += "bison-native \ + flex-native \ + zip-native \ + flex \ + elfutils \ + ${LUAJIT} \ + clang \ + libbpf \ + python3-setuptools-native \ + " + +LUAJIT ?= "luajit" +LUAJIT:powerpc64le = "" +LUAJIT:powerpc64 = "" +LUAJIT:riscv64 = "" + +RDEPENDS:${PN} += "bash python3 python3-core python3-setuptools xz" +RDEPENDS:${PN}-ptest = "cmake python3 python3-distutils python3-netaddr python3-pyroute2" + +SRC_URI = "gitsm://github.com/iovisor/bcc;branch=master;protocol=https \ + file://0001-python-CMakeLists.txt-Remove-check-for-host-etc-debi.patch \ + file://0001-tools-trace.py-Fix-failing-to-exit.patch \ + file://0001-CMakeLists.txt-override-the-PY_CMD_ESCAPED.patch \ + file://0001-Vendor-just-enough-extra-headers-to-allow-libbpf-to-.patch \ + file://0001-tests-cc-Use-c-14-standard.patch \ + file://run-ptest \ + file://ptest_wrapper.sh \ + " + +SRCREV = "8422cd449ad2e60414a4508aa4a150a9db39c4a3" + +PV .= "+git${SRCPV}" + +S = "${WORKDIR}/git" + +PACKAGECONFIG ??= "examples" +PACKAGECONFIG:remove:libc-musl = "examples" + +PACKAGECONFIG[manpages] = "-DENABLE_MAN=ON,-DENABLE_MAN=OFF," +PACKAGECONFIG[examples] = "-DENABLE_EXAMPLES=ON,-DENABLE_EXAMPLES=OFF," + +EXTRA_OECMAKE = " \ + -DCMAKE_USE_LIBBPF_PACKAGE=ON \ + -DENABLE_LLVM_SHARED=ON \ + -DENABLE_CLANG_JIT=ON \ + -DLLVM_PACKAGE_VERSION=${LLVMVERSION} \ + -DPYTHON_CMD=${PYTHON} \ + -DPYTHON_FLAGS=--install-lib=${PYTHON_SITEPACKAGES_DIR} \ +" + +do_install:append() { + sed -e 's@#!/usr/bin/env python@#!/usr/bin/env python3@g' \ + -i $(find ${D}${datadir}/${PN} -type f) + sed -e 's@#!/usr/bin/python.*@#!/usr/bin/env python3@g' \ + -i $(find ${D}${datadir}/${PN} -type f) +} + +do_install_ptest() { + install -d ${D}${PTEST_PATH}/tests/cc + install ${B}/tests/cc/test_libbcc_no_libbpf ${B}/tests/cc/libusdt_test_lib.so ${D}${PTEST_PATH}/tests/cc + cp -rf ${S}/tests/python ${D}${PTEST_PATH}/tests/python + install ${WORKDIR}/ptest_wrapper.sh ${D}${PTEST_PATH}/tests + install ${S}/examples/networking/simulation.py ${D}${PTEST_PATH}/tests/python +} + +FILES:${PN} += "${PYTHON_SITEPACKAGES_DIR}" +FILES:${PN}-doc += "${datadir}/${PN}/man" + +COMPATIBLE_HOST = "(x86_64.*|aarch64.*|powerpc64.*|riscv64.*)-linux" diff --git a/dynamic-layers/openembedded-layer/recipes-devtools/bcc/bcc/0001-CMakeLists.txt-override-the-PY_CMD_ESCAPED.patch b/dynamic-layers/openembedded-layer/recipes-devtools/bcc/bcc/0001-CMakeLists.txt-override-the-PY_CMD_ESCAPED.patch deleted file mode 100644 index 3e0a6aa..0000000 --- a/dynamic-layers/openembedded-layer/recipes-devtools/bcc/bcc/0001-CMakeLists.txt-override-the-PY_CMD_ESCAPED.patch +++ /dev/null @@ -1,41 +0,0 @@ -From 4f64ed40e1ffea7ea278627f30a01018e57dcbcf Mon Sep 17 00:00:00 2001 -From: Mingli Yu -Date: Wed, 9 Sep 2020 05:48:19 +0000 -Subject: [PATCH] CMakeLists.txt: override the PY_CMD_ESCAPED - -Override the PY_CMD_ESCAPED as the PY_CMD_ESCAPED is constructed by -the full path of the python3. In some cases, the path is so long and -result in the PY_CMD_ESCAPED exceeds 255 characters and comes below -do_configure error: - | CMake Error at src/python/CMakeLists.txt:18 (configure_file): - | configure_file Problem configuring file - | - | CMake Error: Could not open file for write in copy operation /buildarea1/test/wr_build/wr1020_20200909_bcc/bcc_long_Kernel/auto-standalone_next/200827/lxbuilds/Intel-Snow-Ridge-NS_platform_up/intel-x86-64-standard-glibc-std/wrlinux/build/tmp-glibc/work/corei7-64-wrs-linux/bcc/0.15.0-r0/build/src/python/bcc--buildarea1-test-wr_build-wr1020_20200909_bcc-bcc_long_Kernel-auto-standalone_next-200827-lxbuilds-Intel-Snow-Ridge-NS_platform_up-intel-x86-64-standard-glibc-std-wrlinux-build-tmp-glibc-work-corei7-64-wrs-linux-bcc-0.15.0-r0-recipe-sysroot-native-usr-bin-python3-native-python3/bcc/version.py.tmp - -Upstream-Status: Pending - -Signed-off-by: Mingli Yu ---- - src/python/CMakeLists.txt | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - ---- a/src/python/CMakeLists.txt -+++ b/src/python/CMakeLists.txt -@@ -12,7 +12,7 @@ file(GLOB_RECURSE PYTHON_INCLUDES RELATI - - foreach(PY_CMD ${PYTHON_CMD}) - string(REPLACE "/" "-" PY_CMD_ESCAPED ${PY_CMD}) -- set(PY_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bcc-${PY_CMD_ESCAPED}) -+ set(PY_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bcc-python3) - - foreach(PY_SRC ${PYTHON_SOURCES}) - configure_file(${PY_SRC} ${PY_DIRECTORY}/${PY_SRC} COPYONLY) -@@ -31,7 +31,7 @@ foreach(PY_CMD ${PYTHON_CMD}) - DEPENDS ${PYTHON_SOURCES} ${PYTHON_INCLUDES} - COMMENT "Building sdist for ${PY_CMD}" - ) -- add_custom_target(bcc_py_${PY_CMD_ESCAPED} ALL DEPENDS ${PIP_INSTALLABLE}) -+ add_custom_target(bcc_py_python3 ALL DEPENDS ${PIP_INSTALLABLE}) - - install( - CODE " diff --git a/dynamic-layers/openembedded-layer/recipes-devtools/bcc/bcc/0001-Vendor-just-enough-extra-headers-to-allow-libbpf-to-.patch b/dynamic-layers/openembedded-layer/recipes-devtools/bcc/bcc/0001-Vendor-just-enough-extra-headers-to-allow-libbpf-to-.patch deleted file mode 100644 index c3c787d..0000000 --- a/dynamic-layers/openembedded-layer/recipes-devtools/bcc/bcc/0001-Vendor-just-enough-extra-headers-to-allow-libbpf-to-.patch +++ /dev/null @@ -1,124 +0,0 @@ -From 6cffc195eca6b53a12865d325ff97e7b5ba8f22b Mon Sep 17 00:00:00 2001 -From: Daniel Thompson -Date: Thu, 19 May 2022 09:14:20 +0000 -Subject: [PATCH] Vendor just enough extra headers to allow libbpf to be - de-vendored - -Currently it is not possible to build the bcc recipe when we de-vendor -libbpf and adopt the packaged version. Ironically this is due to the -deliberate vendoring of some depreciated btf code that is being removed -upstream because bcc was the only user! In other words the vendored code -doesn't work the de-vendored libbpf because also ends up de-vendoring -one of the Linux uapi headers. - -This is obviously an OE specific issue (due to the current combination -of linux headers, libbpf and bcc). It's a bit of a mess and the right -solution is probably to update the system UAPI headers but I am committing -this for now simply so I can easily show why we must de-vendor libbpf in -the first place! - -Upstream-Status: Inappropriate [other] - -Signed-off-by: Daniel Thompson ---- - src/cc/bcc_btf.cc | 87 +++++++++++++++++++++++++++++++++++++++++++++++ - 1 file changed, 87 insertions(+) - -diff --git a/src/cc/bcc_btf.cc b/src/cc/bcc_btf.cc -index 7f551ae8..cca3c6c3 100644 ---- a/src/cc/bcc_btf.cc -+++ b/src/cc/bcc_btf.cc -@@ -33,6 +33,93 @@ - - namespace btf_ext_vendored { - -+#ifdef HAVE_EXTERNAL_LIBBPF -+/* -+ * When we de-vendor libbpf we end up picking up an older version of -+ * [uapi/]linux/bpf.h which misses out some of the data structures needed -+ * to compile this file. Annoyingly the code that doesn't compile it -+ * a result of de-vendoring -+ * -+ * This section is a minimized re-vendoring to fix that. It is not robust -+ * against version skew: When the system linux/bpf.h is updated then this -+ * will break the build and the patch can be dropped. -+ */ -+ -+/* bpf_core_relo_kind encodes which aspect of captured field/type/enum value -+ * has to be adjusted by relocations. It is emitted by llvm and passed to -+ * libbpf and later to the kernel. -+ */ -+enum bpf_core_relo_kind { -+ BPF_CORE_FIELD_BYTE_OFFSET = 0, /* field byte offset */ -+ BPF_CORE_FIELD_BYTE_SIZE = 1, /* field size in bytes */ -+ BPF_CORE_FIELD_EXISTS = 2, /* field existence in target kernel */ -+ BPF_CORE_FIELD_SIGNED = 3, /* field signedness (0 - unsigned, 1 - signed) */ -+ BPF_CORE_FIELD_LSHIFT_U64 = 4, /* bitfield-specific left bitshift */ -+ BPF_CORE_FIELD_RSHIFT_U64 = 5, /* bitfield-specific right bitshift */ -+ BPF_CORE_TYPE_ID_LOCAL = 6, /* type ID in local BPF object */ -+ BPF_CORE_TYPE_ID_TARGET = 7, /* type ID in target kernel */ -+ BPF_CORE_TYPE_EXISTS = 8, /* type existence in target kernel */ -+ BPF_CORE_TYPE_SIZE = 9, /* type size in bytes */ -+ BPF_CORE_ENUMVAL_EXISTS = 10, /* enum value existence in target kernel */ -+ BPF_CORE_ENUMVAL_VALUE = 11, /* enum value integer value */ -+}; -+ -+/* -+ * "struct bpf_core_relo" is used to pass relocation data form LLVM to libbpf -+ * and from libbpf to the kernel. -+ * -+ * CO-RE relocation captures the following data: -+ * - insn_off - instruction offset (in bytes) within a BPF program that needs -+ * its insn->imm field to be relocated with actual field info; -+ * - type_id - BTF type ID of the "root" (containing) entity of a relocatable -+ * type or field; -+ * - access_str_off - offset into corresponding .BTF string section. String -+ * interpretation depends on specific relocation kind: -+ * - for field-based relocations, string encodes an accessed field using -+ * a sequence of field and array indices, separated by colon (:). It's -+ * conceptually very close to LLVM's getelementptr ([0]) instruction's -+ * arguments for identifying offset to a field. -+ * - for type-based relocations, strings is expected to be just "0"; -+ * - for enum value-based relocations, string contains an index of enum -+ * value within its enum type; -+ * - kind - one of enum bpf_core_relo_kind; -+ * -+ * Example: -+ * struct sample { -+ * int a; -+ * struct { -+ * int b[10]; -+ * }; -+ * }; -+ * -+ * struct sample *s = ...; -+ * int *x = &s->a; // encoded as "0:0" (a is field #0) -+ * int *y = &s->b[5]; // encoded as "0:1:0:5" (anon struct is field #1, -+ * // b is field #0 inside anon struct, accessing elem #5) -+ * int *z = &s[10]->b; // encoded as "10:1" (ptr is used as an array) -+ * -+ * type_id for all relocs in this example will capture BTF type id of -+ * `struct sample`. -+ * -+ * Such relocation is emitted when using __builtin_preserve_access_index() -+ * Clang built-in, passing expression that captures field address, e.g.: -+ * -+ * bpf_probe_read(&dst, sizeof(dst), -+ * __builtin_preserve_access_index(&src->a.b.c)); -+ * -+ * In this case Clang will emit field relocation recording necessary data to -+ * be able to find offset of embedded `a.b.c` field within `src` struct. -+ * -+ * [0] https://llvm.org/docs/LangRef.html#getelementptr-instruction -+ */ -+struct bpf_core_relo { -+ __u32 insn_off; -+ __u32 type_id; -+ __u32 access_str_off; -+ enum bpf_core_relo_kind kind; -+}; -+#endif /* HAVE_EXTERNAL_LIBBPF */ -+ - /* The minimum bpf_func_info checked by the loader */ - struct bpf_func_info_min { - uint32_t insn_off; diff --git a/dynamic-layers/openembedded-layer/recipes-devtools/bcc/bcc/0001-python-CMakeLists.txt-Remove-check-for-host-etc-debi.patch b/dynamic-layers/openembedded-layer/recipes-devtools/bcc/bcc/0001-python-CMakeLists.txt-Remove-check-for-host-etc-debi.patch deleted file mode 100644 index 3ca7fdd..0000000 --- a/dynamic-layers/openembedded-layer/recipes-devtools/bcc/bcc/0001-python-CMakeLists.txt-Remove-check-for-host-etc-debi.patch +++ /dev/null @@ -1,35 +0,0 @@ -From cb3f032b55b32c50201862b26c76ea18ad37cb39 Mon Sep 17 00:00:00 2001 -From: Ovidiu Panait -Date: Thu, 30 Jan 2020 14:19:33 +0200 -Subject: [PATCH] python/CMakeLists.txt: Remove check for host - /etc/debian_version - -Fix the following error that occurs during do_install when using the native -version of python3: -usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...] - or: setup.py --help [cmd1 cmd2 ...] - or: setup.py --help-commands - or: setup.py cmd --help - -error: option --install-layout not recognized - -Upstream-Status: Inappropriate [oe-specific] - -Signed-off-by: Ovidiu Panait ---- - src/python/CMakeLists.txt | 4 ---- - 1 file changed, 4 deletions(-) - ---- a/src/python/CMakeLists.txt -+++ b/src/python/CMakeLists.txt -@@ -5,10 +5,6 @@ if(NOT PYTHON_CMD) - set(PYTHON_CMD "python3") - endif() - --if(EXISTS "/etc/debian_version") -- set(PYTHON_FLAGS "${PYTHON_FLAGS} --install-layout deb") --endif() -- - file(GLOB_RECURSE PYTHON_SOURCES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_CURRENT_SOURCE_DIR}/*.py) - file(GLOB_RECURSE PYTHON_INCLUDES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} diff --git a/dynamic-layers/openembedded-layer/recipes-devtools/bcc/bcc/0001-tests-cc-Use-c-14-standard.patch b/dynamic-layers/openembedded-layer/recipes-devtools/bcc/bcc/0001-tests-cc-Use-c-14-standard.patch deleted file mode 100644 index dcd9dc1..0000000 --- a/dynamic-layers/openembedded-layer/recipes-devtools/bcc/bcc/0001-tests-cc-Use-c-14-standard.patch +++ /dev/null @@ -1,29 +0,0 @@ -From 9f45e12ad4689ca2c41844b77c6d789d21509a13 Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Mon, 6 Mar 2023 13:26:11 -0800 -Subject: [PATCH] tests/cc: Use c++14 standard - -default c++ standard was bumped to c++17 when using clang16+ compiler -via 907b89cc9, however, tests which use check tool is not yet ported -to work with c++17 standard, therefore use c++14 on tests - -Upstream-Status: Submitted [https://github.com/iovisor/bcc/pull/4506] -Signed-off-by: Khem Raj -Cc: Hengqi Chen ---- - tests/cc/CMakeLists.txt | 4 ++++ - 1 file changed, 4 insertions(+) - ---- a/tests/cc/CMakeLists.txt -+++ b/tests/cc/CMakeLists.txt -@@ -27,6 +27,10 @@ if(${LLVM_PACKAGE_VERSION} VERSION_EQUAL - set(CMAKE_CXX_STANDARD 14) - endif() - -+if(${LLVM_PACKAGE_VERSION} VERSION_EQUAL 16 OR ${LLVM_PACKAGE_VERSION} VERSION_GREATER 16) -+set(CMAKE_CXX_STANDARD 14) -+endif() -+ - if(ENABLE_USDT) - set(TEST_LIBBCC_SOURCES - test_libbcc.cc diff --git a/dynamic-layers/openembedded-layer/recipes-devtools/bcc/bcc/0001-tools-trace.py-Fix-failing-to-exit.patch b/dynamic-layers/openembedded-layer/recipes-devtools/bcc/bcc/0001-tools-trace.py-Fix-failing-to-exit.patch deleted file mode 100644 index 6ac7219..0000000 --- a/dynamic-layers/openembedded-layer/recipes-devtools/bcc/bcc/0001-tools-trace.py-Fix-failing-to-exit.patch +++ /dev/null @@ -1,41 +0,0 @@ -From a9f59fc8605de1bcca0b6c2d8132585f40c3b9bc Mon Sep 17 00:00:00 2001 -From: He Zhe -Date: Thu, 13 Aug 2020 11:25:58 +0800 -Subject: [PATCH] tools/trace.py: Fix failing to exit - -Class Probe::print_event is used as a callback of a ctypes wrapper. With -Yocto latest python v3.8.5, the exception raised by exit() is ignored and -thus trace cannot exit. Use os._exit(0) instead. - -$ /usr/share/bcc/tools/trace do_sys_open -M 1 -PID TID COMM FUNC -3740 3740 irqbalance do_sys_open -Exception ignored on calling ctypes callback function: -.raw_cb at 0x7f7c9efea280> -Traceback (most recent call last): -File "/usr/lib64/python3.8/site-packages/bcc/table.py", line 685, in raw_cb_ -callback(cpu, data, size) -File "/usr/share/bcc/tools/trace", line 630, in print_event -exit() -File "/usr/lib64/python3.8/sitebuiltins.py", line 26, in __call_ -raise SystemExit(code) -SystemExit: None - -Upstream-Status: Pending - -Signed-off-by: He Zhe ---- - tools/trace.py | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - ---- a/tools/trace.py -+++ b/tools/trace.py -@@ -671,7 +671,7 @@ BPF_PERF_OUTPUT(%s); - if self.aggregate: - self.print_aggregate_events() - sys.stdout.flush() -- exit() -+ os._exit(0) - - def attach(self, bpf, verbose): - if len(self.library) == 0: diff --git a/dynamic-layers/openembedded-layer/recipes-devtools/bcc/bcc/ptest_wrapper.sh b/dynamic-layers/openembedded-layer/recipes-devtools/bcc/bcc/ptest_wrapper.sh deleted file mode 100644 index 92d0156..0000000 --- a/dynamic-layers/openembedded-layer/recipes-devtools/bcc/bcc/ptest_wrapper.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh -# Simple OE specific wrapper for bcc python tests - -name=$1 -kind=$2 -cmd=$3 -shift 3 - -case $kind in - simple|sudo) - $cmd "$@" - ;; - *) - echo "Invalid kind $kind of test $name" - exit 1 -esac diff --git a/dynamic-layers/openembedded-layer/recipes-devtools/bcc/bcc/run-ptest b/dynamic-layers/openembedded-layer/recipes-devtools/bcc/bcc/run-ptest deleted file mode 100644 index a27f697..0000000 --- a/dynamic-layers/openembedded-layer/recipes-devtools/bcc/bcc/run-ptest +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/sh - -cd tests || exit 1 - -PASS_CNT=0 -FAIL_CNT=0 -FAILED="" - -print_test_result() { - if [ $? -eq 0 ]; then - echo PASS: "$1" - PASS_CNT=$((PASS_CNT + 1)) - else - echo FAIL: "$1" - FAIL_CNT=$((FAIL_CNT + 1)) - FAILED="$FAILED $1;" - fi -} - -# Run CC tests, set IFS as test names have spaces -IFS=$(printf '\n\t') -for test_name in $(./cc/test_libbcc_no_libbpf --list-test-names-only); do - ./cc/test_libbcc_no_libbpf "$test_name" > /dev/null 2>&1 - print_test_result "cc $test_name" -done -unset IFS - -# Run python tests, skip namespace tests as they currently don't work -if cmake -DCMAKE_TESTING_ENABLED=ON -DTEST_WRAPPER="$(pwd)/ptest_wrapper.sh" python > /dev/null 2>&1; then - for test_name in $(awk -F '[( ]' '/^add_test/ && !/namespace/ {print $2}' CTestTestfile.cmake); do - ctest -Q -R "$test_name" - print_test_result "python $test_name" - done -else - print_test_result "cmake error, couldn't start python tests" -fi - -echo "#### bcc tests summary ####" -echo "# TOTAL: $((PASS_CNT + FAIL_CNT))" -echo "# PASS: $PASS_CNT" -echo "# FAIL: $FAIL_CNT ($FAILED)" -echo "###########################" diff --git a/dynamic-layers/openembedded-layer/recipes-devtools/bcc/bcc_0.28.0.bb b/dynamic-layers/openembedded-layer/recipes-devtools/bcc/bcc_0.28.0.bb deleted file mode 100644 index 105995d..0000000 --- a/dynamic-layers/openembedded-layer/recipes-devtools/bcc/bcc_0.28.0.bb +++ /dev/null @@ -1,76 +0,0 @@ -SUMMARY = "BPF Compiler Collection (BCC)" -HOMEPAGE = "https://github.com/iovisor/bcc" -LICENSE = "Apache-2.0" -LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=e3fc50a88d0a364313df4b21ef20c29e" - -inherit cmake python3native manpages ptest - -DEPENDS += "bison-native \ - flex-native \ - zip-native \ - flex \ - elfutils \ - ${LUAJIT} \ - clang \ - libbpf \ - python3-setuptools-native \ - " - -LUAJIT ?= "luajit" -LUAJIT:powerpc64le = "" -LUAJIT:powerpc64 = "" -LUAJIT:riscv64 = "" - -RDEPENDS:${PN} += "bash python3 python3-core python3-setuptools xz" -RDEPENDS:${PN}-ptest = "cmake python3 python3-distutils python3-netaddr python3-pyroute2" - -SRC_URI = "gitsm://github.com/iovisor/bcc;branch=master;protocol=https \ - file://0001-python-CMakeLists.txt-Remove-check-for-host-etc-debi.patch \ - file://0001-tools-trace.py-Fix-failing-to-exit.patch \ - file://0001-CMakeLists.txt-override-the-PY_CMD_ESCAPED.patch \ - file://0001-Vendor-just-enough-extra-headers-to-allow-libbpf-to-.patch \ - file://0001-tests-cc-Use-c-14-standard.patch \ - file://run-ptest \ - file://ptest_wrapper.sh \ - " - -SRCREV = "8422cd449ad2e60414a4508aa4a150a9db39c4a3" - -PV .= "+git${SRCPV}" - -S = "${WORKDIR}/git" - -PACKAGECONFIG ??= "examples" -PACKAGECONFIG:remove:libc-musl = "examples" - -PACKAGECONFIG[manpages] = "-DENABLE_MAN=ON,-DENABLE_MAN=OFF," -PACKAGECONFIG[examples] = "-DENABLE_EXAMPLES=ON,-DENABLE_EXAMPLES=OFF," - -EXTRA_OECMAKE = " \ - -DCMAKE_USE_LIBBPF_PACKAGE=ON \ - -DENABLE_LLVM_SHARED=ON \ - -DENABLE_CLANG_JIT=ON \ - -DLLVM_PACKAGE_VERSION=${LLVMVERSION} \ - -DPYTHON_CMD=${PYTHON} \ - -DPYTHON_FLAGS=--install-lib=${PYTHON_SITEPACKAGES_DIR} \ -" - -do_install:append() { - sed -e 's@#!/usr/bin/env python@#!/usr/bin/env python3@g' \ - -i $(find ${D}${datadir}/${PN} -type f) - sed -e 's@#!/usr/bin/python.*@#!/usr/bin/env python3@g' \ - -i $(find ${D}${datadir}/${PN} -type f) -} - -do_install_ptest() { - install -d ${D}${PTEST_PATH}/tests/cc - install ${B}/tests/cc/test_libbcc_no_libbpf ${B}/tests/cc/libusdt_test_lib.so ${D}${PTEST_PATH}/tests/cc - cp -rf ${S}/tests/python ${D}${PTEST_PATH}/tests/python - install ${WORKDIR}/ptest_wrapper.sh ${D}${PTEST_PATH}/tests - install ${S}/examples/networking/simulation.py ${D}${PTEST_PATH}/tests/python -} - -FILES:${PN} += "${PYTHON_SITEPACKAGES_DIR}" -FILES:${PN}-doc += "${datadir}/${PN}/man" - -COMPATIBLE_HOST = "(x86_64.*|aarch64.*|powerpc64.*|riscv64.*)-linux" -- cgit v1.2.3-54-g00ecf