diff options
author | Khem Raj <raj.khem@gmail.com> | 2025-07-11 17:25:08 -0700 |
---|---|---|
committer | Khem Raj <raj.khem@gmail.com> | 2025-07-14 09:56:53 -0700 |
commit | 18839aa63fabadc2d1fab977110694d2d1508834 (patch) | |
tree | 6a5490f354de3ac5a5c890775ae0a13f2bfd46f9 /dynamic-layers/meta-python | |
parent | 5ff246e156b8463effad4fa025edaa64265b996a (diff) | |
download | meta-clang-18839aa63fabadc2d1fab977110694d2d1508834.tar.gz |
bcc: Upgrade to 0.35.0 release
Fixes build with cmake 4+
Drop upstreamed patches
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'dynamic-layers/meta-python')
-rw-r--r-- | dynamic-layers/meta-python/recipes-devtools/bcc/bcc/0001-CMakeLists.txt-don-t-modify-.gitconfig-on-build-host.patch | 89 | ||||
-rw-r--r-- | dynamic-layers/meta-python/recipes-devtools/bcc/bcc/bpf_stack_id.patch | 13 | ||||
-rw-r--r-- | dynamic-layers/meta-python/recipes-devtools/bcc/bcc/support_finish_task_switch_isra_0.patch | 49 | ||||
-rw-r--r-- | dynamic-layers/meta-python/recipes-devtools/bcc/bcc_0.35.0.bb (renamed from dynamic-layers/meta-python/recipes-devtools/bcc/bcc_0.33.0.bb) | 13 |
4 files changed, 4 insertions, 160 deletions
diff --git a/dynamic-layers/meta-python/recipes-devtools/bcc/bcc/0001-CMakeLists.txt-don-t-modify-.gitconfig-on-build-host.patch b/dynamic-layers/meta-python/recipes-devtools/bcc/bcc/0001-CMakeLists.txt-don-t-modify-.gitconfig-on-build-host.patch deleted file mode 100644 index 1484b6a..0000000 --- a/dynamic-layers/meta-python/recipes-devtools/bcc/bcc/0001-CMakeLists.txt-don-t-modify-.gitconfig-on-build-host.patch +++ /dev/null | |||
@@ -1,89 +0,0 @@ | |||
1 | From 9ee5d9ca2e1ea709571613326b81e8e651fa9f00 Mon Sep 17 00:00:00 2001 | ||
2 | From: Martin Jansa <martin.jansa@gmail.com> | ||
3 | Date: Thu, 7 Sep 2023 11:43:25 +0200 | ||
4 | Subject: [PATCH] CMakeLists.txt: don't modify .gitconfig on build host nor try | ||
5 | to update git submodules | ||
6 | |||
7 | * bitbake fetcher will correctly handle safe.directory issues and | ||
8 | blazesym or libbpf submodules are managed by gitsm:// fetcher | ||
9 | we don't want to call git from CMake in do_configure | ||
10 | |||
11 | Upstream-Status: Pending | ||
12 | Signed-off-by: Martin Jansa <martin.jansa@gmail.com> | ||
13 | --- | ||
14 | CMakeLists.txt | 62 -------------------------------------------------- | ||
15 | 1 file changed, 62 deletions(-) | ||
16 | |||
17 | diff --git a/CMakeLists.txt b/CMakeLists.txt | ||
18 | index dfed06e5..ffd88043 100644 | ||
19 | --- a/CMakeLists.txt | ||
20 | +++ b/CMakeLists.txt | ||
21 | @@ -26,68 +26,6 @@ endif() | ||
22 | |||
23 | enable_testing() | ||
24 | |||
25 | -execute_process(COMMAND git config --global --add safe.directory ${CMAKE_CURRENT_SOURCE_DIR} | ||
26 | - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} | ||
27 | - RESULT_VARIABLE CONFIG_RESULT) | ||
28 | -if(CONFIG_RESULT AND NOT CONFIG_RESULT EQUAL 0) | ||
29 | - message(WARNING "Failed to add root source directory to safe.directory") | ||
30 | -endif() | ||
31 | - | ||
32 | -# populate submodule blazesym | ||
33 | -if(NOT NO_BLAZESYM) | ||
34 | - execute_process(COMMAND git config --global --add safe.directory ${CMAKE_CURRENT_SOURCE_DIR}/libbpf-tools/blazesym | ||
35 | - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} | ||
36 | - RESULT_VARIABLE CONFIG_RESULT) | ||
37 | - if(CONFIG_RESULT AND NOT CONFIG_RESULT EQUAL 0) | ||
38 | - message(WARNING "Failed to add blazesym source directory to safe.directory") | ||
39 | - endif() | ||
40 | - | ||
41 | - execute_process(COMMAND git submodule update --init --recursive -- libbpf-tools/blazesym | ||
42 | - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} | ||
43 | - RESULT_VARIABLE UPDATE_RESULT) | ||
44 | - if(UPDATE_RESULT AND NOT UPDATE_RESULT EQUAL 0) | ||
45 | - message(WARNING "Failed to update submodule blazesym") | ||
46 | - endif() | ||
47 | -endif() | ||
48 | - | ||
49 | -# populate submodules (libbpf) | ||
50 | -if(NOT CMAKE_USE_LIBBPF_PACKAGE) | ||
51 | - execute_process(COMMAND git config --global --add safe.directory ${CMAKE_CURRENT_SOURCE_DIR}/src/cc/libbpf | ||
52 | - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} | ||
53 | - RESULT_VARIABLE CONFIG_RESULT) | ||
54 | - if(CONFIG_RESULT AND NOT CONFIG_RESULT EQUAL 0) | ||
55 | - message(WARNING "Failed to add libbpf source directory to safe.directory") | ||
56 | - endif() | ||
57 | - execute_process(COMMAND git config --global --add safe.directory ${CMAKE_CURRENT_SOURCE_DIR}/libbpf-tools/bpftool | ||
58 | - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} | ||
59 | - RESULT_VARIABLE CONFIG_RESULT) | ||
60 | - if(CONFIG_RESULT AND NOT CONFIG_RESULT EQUAL 0) | ||
61 | - message(WARNING "Failed to add bpftool source directory to safe.directory") | ||
62 | - endif() | ||
63 | - | ||
64 | - if(NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/src/cc/libbpf/src) | ||
65 | - execute_process(COMMAND git submodule update --init --recursive | ||
66 | - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} | ||
67 | - RESULT_VARIABLE UPDATE_RESULT) | ||
68 | - if(UPDATE_RESULT AND NOT UPDATE_RESULT EQUAL 0) | ||
69 | - message(WARNING "Failed to update submodule libbpf") | ||
70 | - endif() | ||
71 | - else() | ||
72 | - execute_process(COMMAND git diff --shortstat ${CMAKE_CURRENT_SOURCE_DIR}/src/cc/libbpf/ | ||
73 | - OUTPUT_VARIABLE DIFF_STATUS) | ||
74 | - if("${DIFF_STATUS}" STREQUAL "") | ||
75 | - execute_process(COMMAND git submodule update --init --recursive | ||
76 | - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} | ||
77 | - RESULT_VARIABLE UPDATE_RESULT) | ||
78 | - if(UPDATE_RESULT AND NOT UPDATE_RESULT EQUAL 0) | ||
79 | - message(WARNING "Failed to update submodule libbpf") | ||
80 | - endif() | ||
81 | - else() | ||
82 | - message(WARNING "submodule libbpf dirty, so no sync") | ||
83 | - endif() | ||
84 | - endif() | ||
85 | -endif() | ||
86 | - | ||
87 | # It's possible to use other kernel headers with | ||
88 | # KERNEL_INCLUDE_DIRS build variable, like: | ||
89 | # $ cd <kernel-dir> | ||
diff --git a/dynamic-layers/meta-python/recipes-devtools/bcc/bcc/bpf_stack_id.patch b/dynamic-layers/meta-python/recipes-devtools/bcc/bcc/bpf_stack_id.patch deleted file mode 100644 index 18221be..0000000 --- a/dynamic-layers/meta-python/recipes-devtools/bcc/bcc/bpf_stack_id.patch +++ /dev/null | |||
@@ -1,13 +0,0 @@ | |||
1 | Upstream-Status: Submitted [https://github.com/iovisor/bcc/pull/5292] | ||
2 | Signed-off-by: Harish Sadineni <Harish.Sadineni@windriver.com> | ||
3 | |||
4 | --- a/tests/cc/test_bpf_table.cc | ||
5 | +++ b/tests/cc/test_bpf_table.cc | ||
6 | @@ -260,6 +260,7 @@ | ||
7 | /* libc locations on different distributions are added below*/ | ||
8 | bpf.add_module("/lib/x86_64-linux-gnu/libc.so.6"); //Location of libc in ubuntu | ||
9 | bpf.add_module("/lib64/libc.so.6"); //Location of libc fedora machine | ||
10 | + bpf.add_module("/lib/libc.so.6");//location of libc in image | ||
11 | |||
12 | int stack_id = id[0]; | ||
13 | REQUIRE(stack_id >= 0); | ||
diff --git a/dynamic-layers/meta-python/recipes-devtools/bcc/bcc/support_finish_task_switch_isra_0.patch b/dynamic-layers/meta-python/recipes-devtools/bcc/bcc/support_finish_task_switch_isra_0.patch deleted file mode 100644 index 92a3f7b..0000000 --- a/dynamic-layers/meta-python/recipes-devtools/bcc/bcc/support_finish_task_switch_isra_0.patch +++ /dev/null | |||
@@ -1,49 +0,0 @@ | |||
1 | Upstream-Status: Backport [https://github.com/iovisor/bcc/pull/5302/commits/b24519e1ba7b87c9676ae3a7f70772215cd5819d] | ||
2 | Signed-off-by: Harish Sadineni <Harish.Sadineni@windriver.com> | ||
3 | |||
4 | diff --git a/tests/python/test_histogram.py b/tests/python/test_histogram.py | ||
5 | --- a/tests/python/test_histogram.py | ||
6 | +++ b/tests/python/test_histogram.py | ||
7 | @@ -64,7 +64,7 @@ | ||
8 | #include <linux/version.h> | ||
9 | typedef struct { char name[TASK_COMM_LEN]; u64 slot; } Key; | ||
10 | BPF_HISTOGRAM(hist1, Key, 1024); | ||
11 | -int kprobe__finish_task_switch(struct pt_regs *ctx, struct task_struct *prev) { | ||
12 | +int count_prev_task_start_time(struct pt_regs *ctx, struct task_struct *prev) { | ||
13 | #if LINUX_VERSION_CODE < KERNEL_VERSION(5,5,0) | ||
14 | Key k = {.slot = bpf_log2l(prev->real_start_time)}; | ||
15 | #else | ||
16 | @@ -77,6 +77,10 @@ | ||
17 | return 0; | ||
18 | } | ||
19 | """) | ||
20 | + b.attach_kprobe( | ||
21 | + event_re=r'^finish_task_switch$|^finish_task_switch\.isra\.\d$', | ||
22 | + fn_name=b"count_prev_task_start_time" | ||
23 | + ) | ||
24 | for i in range(0, 100): time.sleep(0.01) | ||
25 | b[b"hist1"].print_log2_hist() | ||
26 | b.cleanup() | ||
27 | diff --git a/tests/python/test_clang.py b/tests/python/test_clang.py | ||
28 | --- a/tests/python/test_clang.py | ||
29 | +++ b/tests/python/test_clang.py | ||
30 | @@ -399,7 +399,7 @@ | ||
31 | u32 curr_pid; | ||
32 | }; | ||
33 | BPF_HASH(stats, struct key_t, u64, 1024); | ||
34 | -int kprobe__finish_task_switch(struct pt_regs *ctx, struct task_struct *prev) { | ||
35 | +int count_sched(struct pt_regs *ctx, struct task_struct *prev) { | ||
36 | struct key_t key = {}; | ||
37 | u64 zero = 0, *val; | ||
38 | key.curr_pid = bpf_get_current_pid_tgid(); | ||
39 | @@ -412,6 +412,10 @@ | ||
40 | return 0; | ||
41 | } | ||
42 | """) | ||
43 | + b.attach_kprobe( | ||
44 | + event_re=r'^finish_task_switch$|^finish_task_switch\.isra\.\d$', | ||
45 | + fn_name=b"count_sched" | ||
46 | + ) | ||
47 | |||
48 | def test_probe_simple_assign(self): | ||
49 | b = BPF(text=b""" | ||
diff --git a/dynamic-layers/meta-python/recipes-devtools/bcc/bcc_0.33.0.bb b/dynamic-layers/meta-python/recipes-devtools/bcc/bcc_0.35.0.bb index 768b08e..20924f6 100644 --- a/dynamic-layers/meta-python/recipes-devtools/bcc/bcc_0.33.0.bb +++ b/dynamic-layers/meta-python/recipes-devtools/bcc/bcc_0.35.0.bb | |||
@@ -18,20 +18,15 @@ DEPENDS += "bison-native \ | |||
18 | RDEPENDS:${PN} += "bash python3 python3-core python3-setuptools xz" | 18 | RDEPENDS:${PN} += "bash python3 python3-core python3-setuptools xz" |
19 | RDEPENDS:${PN}-ptest = "kernel-devsrc packagegroup-core-buildessential cmake bash python3 python3-netaddr python3-pyroute2" | 19 | RDEPENDS:${PN}-ptest = "kernel-devsrc packagegroup-core-buildessential cmake bash python3 python3-netaddr python3-pyroute2" |
20 | 20 | ||
21 | SRC_URI = "gitsm://github.com/iovisor/bcc;branch=master;protocol=https \ | 21 | SRC_URI = "gitsm://github.com/iovisor/bcc;branch=master;protocol=https;tag=v${PV} \ |
22 | file://0001-CMakeLists.txt-override-the-PY_CMD_ESCAPED.patch \ | 22 | file://0001-CMakeLists.txt-override-the-PY_CMD_ESCAPED.patch \ |
23 | file://0001-Vendor-just-enough-extra-headers-to-allow-libbpf-to-.patch \ | 23 | file://0001-Vendor-just-enough-extra-headers-to-allow-libbpf-to-.patch \ |
24 | file://0001-CMakeLists.txt-don-t-modify-.gitconfig-on-build-host.patch \ | ||
25 | file://run-ptest \ | 24 | file://run-ptest \ |
26 | file://ptest_wrapper.sh \ | 25 | file://ptest_wrapper.sh \ |
27 | file://bpf_stack_id.patch \ | ||
28 | file://support_finish_task_switch_isra_0.patch \ | ||
29 | file://fix_for_memleak.patch \ | 26 | file://fix_for_memleak.patch \ |
30 | " | 27 | " |
31 | 28 | ||
32 | SRCREV = "92e32ff8a06616779f3a3191b75da6881d59fd17" | 29 | SRCREV = "c31a1ca305f787ba53e001ead45ebf65233a32cf" |
33 | |||
34 | PV .= "+git" | ||
35 | 30 | ||
36 | PACKAGECONFIG ??= "examples" | 31 | PACKAGECONFIG ??= "examples" |
37 | PACKAGECONFIG:remove:libc-musl = "examples" | 32 | PACKAGECONFIG:remove:libc-musl = "examples" |
@@ -72,11 +67,11 @@ do_install_ptest() { | |||
72 | cp -rf ${S}/tests/python ${D}${PTEST_PATH}/tests/python | 67 | cp -rf ${S}/tests/python ${D}${PTEST_PATH}/tests/python |
73 | install ${UNPACKDIR}/ptest_wrapper.sh ${D}${PTEST_PATH}/tests | 68 | install ${UNPACKDIR}/ptest_wrapper.sh ${D}${PTEST_PATH}/tests |
74 | install ${S}/examples/networking/simulation.py ${D}${PTEST_PATH}/tests/python | 69 | install ${S}/examples/networking/simulation.py ${D}${PTEST_PATH}/tests/python |
75 | find ${B}/../sources/bcc-0.33.0+git/tools/ -type f -name "*.py" -exec \ | 70 | find ${S}/tools/ -type f -name "*.py" -exec \ |
76 | sed -i \ | 71 | sed -i \ |
77 | -e 's@^#! */usr/bin/env python$@#!/usr/bin/env python3@' \ | 72 | -e 's@^#! */usr/bin/env python$@#!/usr/bin/env python3@' \ |
78 | -e 's@^#! */usr/bin/python.*@#!/usr/bin/env python3@' {} + | 73 | -e 's@^#! */usr/bin/python.*@#!/usr/bin/env python3@' {} + |
79 | cp -rf ${B}/../sources/bcc-0.33.0+git/tools/ ${D}${PTEST_PATH}/../../tools/ | 74 | cp -rf ${S}/tools/ ${D}${PTEST_PATH}/../../tools/ |
80 | } | 75 | } |
81 | 76 | ||
82 | FILES:${PN} += "${PYTHON_SITEPACKAGES_DIR}" | 77 | FILES:${PN} += "${PYTHON_SITEPACKAGES_DIR}" |