diff options
author | Harish Sadineni <Harish.Sadineni@windriver.com> | 2025-07-09 06:23:23 -0700 |
---|---|---|
committer | Khem Raj <raj.khem@gmail.com> | 2025-07-10 14:23:34 -0700 |
commit | 5ff246e156b8463effad4fa025edaa64265b996a (patch) | |
tree | 4ffe8984caa48e3f55b6ed521298d138f02da87d /dynamic-layers/meta-python | |
parent | e76e965cf5c03768fe51b15c0c02002dbbcfaa81 (diff) | |
download | meta-clang-5ff246e156b8463effad4fa025edaa64265b996a.tar.gz |
bcc: Fix for test tools_memleak.py
Fixes tools_memleak.py which is getting failed due to
"c_src_full = os.path.dirname(sys.argv[0]) + os.path.sep + c_src"
is giving "/'test_tools_memleak_leaker_app.c".
memleak.py and other test cases requires bcc tools so copying the tools to
image.
Upstream-Status: Submitted [https://github.com/iovisor/bcc/pull/5355]
Signed-off-by: Harish Sadineni <Harish.Sadineni@windriver.com>
Diffstat (limited to 'dynamic-layers/meta-python')
-rw-r--r-- | dynamic-layers/meta-python/recipes-devtools/bcc/bcc/fix_for_memleak.patch | 16 | ||||
-rw-r--r-- | dynamic-layers/meta-python/recipes-devtools/bcc/bcc_0.33.0.bb | 9 |
2 files changed, 24 insertions, 1 deletions
diff --git a/dynamic-layers/meta-python/recipes-devtools/bcc/bcc/fix_for_memleak.patch b/dynamic-layers/meta-python/recipes-devtools/bcc/bcc/fix_for_memleak.patch new file mode 100644 index 0000000..a3a1ec9 --- /dev/null +++ b/dynamic-layers/meta-python/recipes-devtools/bcc/bcc/fix_for_memleak.patch | |||
@@ -0,0 +1,16 @@ | |||
1 | Upstream-Status: Submitted [https://github.com/iovisor/bcc/pull/5355] | ||
2 | Signed-off-by: Harish Sadineni <Harish.Sadineni@windriver.com> | ||
3 | |||
4 | diff --git a/tests/python/test_tools_memleak.py b/tests/python/test_tools_memleak.py | ||
5 | --- a/tests/python/test_tools_memleak.py | ||
6 | +++ b/tests/python/test_tools_memleak.py | ||
7 | @@ -26,7 +26,7 @@ | ||
8 | # Build the memory leaking application. | ||
9 | c_src = 'test_tools_memleak_leaker_app.c' | ||
10 | tmp_dir = tempfile.mkdtemp(prefix='bcc-test-memleak-') | ||
11 | - c_src_full = os.path.dirname(sys.argv[0]) + os.path.sep + c_src | ||
12 | + c_src_full = os.path.abspath(os.path.dirname(sys.argv[0])) + os.path.sep + c_src | ||
13 | exec_dst = tmp_dir + os.path.sep + 'leaker_app' | ||
14 | |||
15 | if subprocess.call(['gcc', '-g', '-O0', '-o', exec_dst, c_src_full]) != 0: | ||
16 | |||
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.33.0.bb index c4da9d9..768b08e 100644 --- a/dynamic-layers/meta-python/recipes-devtools/bcc/bcc_0.33.0.bb +++ b/dynamic-layers/meta-python/recipes-devtools/bcc/bcc_0.33.0.bb | |||
@@ -16,7 +16,7 @@ DEPENDS += "bison-native \ | |||
16 | " | 16 | " |
17 | 17 | ||
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 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 \ |
22 | file://0001-CMakeLists.txt-override-the-PY_CMD_ESCAPED.patch \ | 22 | file://0001-CMakeLists.txt-override-the-PY_CMD_ESCAPED.patch \ |
@@ -26,6 +26,7 @@ SRC_URI = "gitsm://github.com/iovisor/bcc;branch=master;protocol=https \ | |||
26 | file://ptest_wrapper.sh \ | 26 | file://ptest_wrapper.sh \ |
27 | file://bpf_stack_id.patch \ | 27 | file://bpf_stack_id.patch \ |
28 | file://support_finish_task_switch_isra_0.patch \ | 28 | file://support_finish_task_switch_isra_0.patch \ |
29 | file://fix_for_memleak.patch \ | ||
29 | " | 30 | " |
30 | 31 | ||
31 | SRCREV = "92e32ff8a06616779f3a3191b75da6881d59fd17" | 32 | SRCREV = "92e32ff8a06616779f3a3191b75da6881d59fd17" |
@@ -71,10 +72,16 @@ do_install_ptest() { | |||
71 | cp -rf ${S}/tests/python ${D}${PTEST_PATH}/tests/python | 72 | cp -rf ${S}/tests/python ${D}${PTEST_PATH}/tests/python |
72 | install ${UNPACKDIR}/ptest_wrapper.sh ${D}${PTEST_PATH}/tests | 73 | install ${UNPACKDIR}/ptest_wrapper.sh ${D}${PTEST_PATH}/tests |
73 | install ${S}/examples/networking/simulation.py ${D}${PTEST_PATH}/tests/python | 74 | 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 \ | ||
76 | sed -i \ | ||
77 | -e 's@^#! */usr/bin/env python$@#!/usr/bin/env python3@' \ | ||
78 | -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 | } | 80 | } |
75 | 81 | ||
76 | FILES:${PN} += "${PYTHON_SITEPACKAGES_DIR}" | 82 | FILES:${PN} += "${PYTHON_SITEPACKAGES_DIR}" |
77 | FILES:${PN} += "${B}/tests/cc" | 83 | FILES:${PN} += "${B}/tests/cc" |
84 | FILES:${PN}-ptest += "${libdir}/tools/" | ||
78 | FILES:${PN}-ptest += "/opt/" | 85 | FILES:${PN}-ptest += "/opt/" |
79 | FILES:${PN}-doc += "${datadir}/${PN}/man" | 86 | FILES:${PN}-doc += "${datadir}/${PN}/man" |
80 | 87 | ||