summaryrefslogtreecommitdiffstats
path: root/dynamic-layers/meta-python
diff options
context:
space:
mode:
authorMartin Jansa <martin.jansa@gmail.com>2024-09-03 12:09:56 +0200
committerKhem Raj <raj.khem@gmail.com>2024-09-04 00:18:50 -0700
commitacb53c7858a8a323aad1aa034e3bca028b0e1f4b (patch)
treeb14ea74047c42697f82872ac584dc8209182e5f8 /dynamic-layers/meta-python
parent304da50e7838a41c117e86fc641947a41bec4103 (diff)
downloadmeta-clang-acb53c7858a8a323aad1aa034e3bca028b0e1f4b.tar.gz
bpftrace: move from dynamic-layers/openembedded-layer to dynamic-layers/meta-python
* bpftrace itself doesn't depend on meta-python, but bpftrace from dynamic-layers/openembedded-layer depends on bcc from dynamic-layers/meta-python so better to move it there. This way both bcc and bpftrace are either both available at the same time or neither of them. * fixes https://github.com/kraj/meta-clang/issues/985 ERROR: Nothing PROVIDES 'bcc' (but /mnt/secondary/poky/meta-clang/dynamic-layers/openembedded-layer/recipes-devtools/bpftrace/bpftrace_0.20.1.bb DEPENDS on or otherwise requires it). Close matches: bc byacc NOTE: Runtime target 'bpftrace' is unbuildable, removing... Missing or unbuildable dependency chain was: ['bpftrace', 'bcc'] ERROR: Required build target 'core-image-minimal' has no buildable providers. Missing or unbuildable dependency chain was: ['core-image-minimal', 'bpftrace', 'bcc'] when only openembedded-layer (meta-oe) is in BBLAYERS and meta-python isn't. Signed-off-by: Martin Jansa <martin.jansa@gmail.com>
Diffstat (limited to 'dynamic-layers/meta-python')
-rw-r--r--dynamic-layers/meta-python/recipes-devtools/bpftrace/bpftrace/0001-cmake-Bump-max-LLVM-version-to-19.patch24
-rw-r--r--dynamic-layers/meta-python/recipes-devtools/bpftrace/bpftrace/run-ptest51
-rw-r--r--dynamic-layers/meta-python/recipes-devtools/bpftrace/bpftrace_0.21.2.bb55
3 files changed, 130 insertions, 0 deletions
diff --git a/dynamic-layers/meta-python/recipes-devtools/bpftrace/bpftrace/0001-cmake-Bump-max-LLVM-version-to-19.patch b/dynamic-layers/meta-python/recipes-devtools/bpftrace/bpftrace/0001-cmake-Bump-max-LLVM-version-to-19.patch
new file mode 100644
index 0000000..88dc60b
--- /dev/null
+++ b/dynamic-layers/meta-python/recipes-devtools/bpftrace/bpftrace/0001-cmake-Bump-max-LLVM-version-to-19.patch
@@ -0,0 +1,24 @@
1From 16186113346c268a0bb45424ba1c41768b7e94cf Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Fri, 16 Feb 2024 10:14:41 -0800
4Subject: [PATCH] cmake: Bump max LLVM version to 19
5
6Upstream-Status: Submitted [https://github.com/bpftrace/bpftrace/pull/3433]
7Signed-off-by: Khem Raj <raj.khem@gmail.com>
8---
9 CMakeLists.txt | 2 +-
10 1 file changed, 1 insertion(+), 1 deletion(-)
11
12Index: git/CMakeLists.txt
13===================================================================
14--- git.orig/CMakeLists.txt
15+++ git/CMakeLists.txt
16@@ -152,7 +152,7 @@ else()
17 endif()
18
19 set(MIN_LLVM_MAJOR 13)
20-set(MAX_LLVM_MAJOR 18)
21+set(MAX_LLVM_MAJOR 19)
22
23 if((${LLVM_VERSION_MAJOR} VERSION_LESS ${MIN_LLVM_MAJOR}) OR (${LLVM_VERSION_MAJOR} VERSION_GREATER ${MAX_LLVM_MAJOR}))
24 message(SEND_ERROR "Unsupported LLVM version found via ${LLVM_INCLUDE_DIRS}: ${LLVM_VERSION_MAJOR}")
diff --git a/dynamic-layers/meta-python/recipes-devtools/bpftrace/bpftrace/run-ptest b/dynamic-layers/meta-python/recipes-devtools/bpftrace/bpftrace/run-ptest
new file mode 100644
index 0000000..63d65e2
--- /dev/null
+++ b/dynamic-layers/meta-python/recipes-devtools/bpftrace/bpftrace/run-ptest
@@ -0,0 +1,51 @@
1#!/bin/sh
2
3# The whole test suite may take up to 40 minutes to run, so setting -t 2400
4# parameter in ptest-runner is necessary to not kill it before completion
5
6cd tests || exit 1
7export BPFTRACE_RUNTIME_TEST_EXECUTABLE=/usr/bin/bpftrace
8export BPFTRACE_AOT_RUNTIME_TEST_EXECUTABLE=/usr/bin/bpftrace-aotrt
9
10PASS_CNT=0
11FAIL_CNT=0
12SKIP_CNT=0
13FAILED=""
14
15print_test_result() {
16 if [ $? -eq 0 ]; then
17 echo "PASS: $1"
18 PASS_CNT=$((PASS_CNT + 1))
19 else
20 echo "FAIL: $1"
21 FAIL_CNT=$((FAIL_CNT + 1))
22 FAILED="${FAILED:+$FAILED }$1;"
23 fi
24 }
25
26IFS=$(printf '\n\t')
27# Start unit tests
28for test_name in $(./bpftrace_test --gtest_list_tests | grep -v "^ "); do
29 ./bpftrace_test --gtest_filter="${test_name}*" > /dev/null 2>&1
30 print_test_result "unit:$test_name"
31done
32
33# Start runtime tests
34for test_name in $(ls runtime); do
35 # Ignore test cases that hang the suite forever (bpftrace v0.16.0)
36 if [ "$test_name" = "signals" ] || [ "$test_name" = "watchpoint" ]; then
37 echo "SKIP: runtime:$test_name"
38 SKIP_CNT=$((SKIP_CNT + 1))
39 continue
40 fi
41 python3 runtime/engine/main.py --filter="${test_name}.*" > /dev/null 2>&1
42 print_test_result "runtime:$test_name"
43done
44unset IFS
45
46echo "#### bpftrace tests summary ####"
47echo "# TOTAL: $((PASS_CNT + FAIL_CNT + SKIP_CNT))"
48echo "# PASS: $PASS_CNT"
49echo "# FAIL: $FAIL_CNT ($FAILED)"
50echo "# SKIP: $SKIP_CNT"
51echo "################################"
diff --git a/dynamic-layers/meta-python/recipes-devtools/bpftrace/bpftrace_0.21.2.bb b/dynamic-layers/meta-python/recipes-devtools/bpftrace/bpftrace_0.21.2.bb
new file mode 100644
index 0000000..addd2c5
--- /dev/null
+++ b/dynamic-layers/meta-python/recipes-devtools/bpftrace/bpftrace_0.21.2.bb
@@ -0,0 +1,55 @@
1SUMMARY = "bpftrace"
2HOMEPAGE = "https://github.com/iovisor/bpftrace"
3LICENSE = "Apache-2.0"
4LIC_FILES_CHKSUM = "file://LICENSE;md5=3b83ef96387f14655fc854ddc3c6bd57"
5
6DEPENDS += "bison-native \
7 flex-native \
8 gzip-native \
9 elfutils \
10 bcc \
11 systemtap \
12 libcereal \
13 libbpf \
14 "
15DEPENDS += "${@bb.utils.contains('PTEST_ENABLED', '1', 'pahole-native llvm-native', '', d)}"
16
17RDEPENDS:${PN} += "bash python3 xz"
18
19PV .= "+git"
20
21SRC_URI = "git://github.com/iovisor/bpftrace;branch=master;protocol=https \
22 file://run-ptest \
23 file://0001-cmake-Bump-max-LLVM-version-to-19.patch \
24"
25SRCREV = "b2e255870ba010d4a7e4852bffcf1c567b016fd0"
26
27S = "${WORKDIR}/git"
28
29inherit cmake ptest
30
31PACKAGECONFIG ?= "${@bb.utils.contains('PTEST_ENABLED', '1', 'tests', '', d)}"
32
33PACKAGECONFIG[tests] = "-DBUILD_TESTING=ON,-DBUILD_TESTING=OFF,gtest xxd-native"
34
35do_install_ptest() {
36 if [ -e ${B}/tests/bpftrace_test ]; then
37 install -Dm 755 ${B}/tests/bpftrace_test ${D}${PTEST_PATH}/tests/bpftrace_test
38 cp -rf ${B}/tests/runtime ${D}${PTEST_PATH}/tests
39 cp -rf ${B}/tests/test* ${D}${PTEST_PATH}/tests
40 fi
41}
42
43EXTRA_OECMAKE = " \
44 -DCMAKE_ENABLE_EXPORTS=1 \
45 -DCMAKE_BUILD_TYPE=Release \
46 -DUSE_SYSTEM_BPF_BCC=ON \
47 -DENABLE_MAN=OFF \
48"
49
50COMPATIBLE_HOST = "(x86_64.*|aarch64.*|powerpc64.*|riscv64.*)-linux"
51COMPATIBLE_HOST:libc-musl = "null"
52
53INHIBIT_PACKAGE_STRIP_FILES += "\
54 ${PKGD}${PTEST_PATH}/tests/testprogs/uprobe_test \
55"