diff options
| author | Harish Sadineni <Harish.Sadineni@windriver.com> | 2026-03-07 21:54:11 -0800 |
|---|---|---|
| committer | Khem Raj <raj.khem@gmail.com> | 2026-03-17 13:25:15 -0700 |
| commit | cdf9d099b983d09cd7237e26ce86f808d7cbfe2a (patch) | |
| tree | 208f457e51766f5084c27bd991f5ef0e5ac49314 | |
| parent | eed01e5cc028e09b0186c31aa3228ed36053ce5f (diff) | |
| download | meta-openembedded-cdf9d099b983d09cd7237e26ce86f808d7cbfe2a.tar.gz | |
bcc: Add riscv syscall prefix detection in C++ API
Fixes issue where bpf.get_syscall_fnname() on riscv64 returns bare syscall
name instead of the prefixed _riscv_sys variant, causing kprobe
attachment failures.
Upstream-Status: Submitted [https://github.com/iovisor/bcc/pull/5490]
Signed-off-by: Harish Sadineni <Harish.Sadineni@windriver.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2 files changed, 33 insertions, 0 deletions
diff --git a/meta-oe/dynamic-layers/meta-python/recipes-devtools/bcc/bcc/0002-Add-riscv-syscall-prefix-detection-in-C-API.patch b/meta-oe/dynamic-layers/meta-python/recipes-devtools/bcc/bcc/0002-Add-riscv-syscall-prefix-detection-in-C-API.patch new file mode 100644 index 0000000000..78bf1df7c3 --- /dev/null +++ b/meta-oe/dynamic-layers/meta-python/recipes-devtools/bcc/bcc/0002-Add-riscv-syscall-prefix-detection-in-C-API.patch | |||
| @@ -0,0 +1,32 @@ | |||
| 1 | From da01655f0f335584867b3427005b95384499a020 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Harish Sadineni <Harish.Sadineni@windriver.com> | ||
| 3 | Date: Sat, 7 Mar 2026 20:20:04 -0800 | ||
| 4 | Subject: [PATCH 2/2] Add riscv syscall prefix detection in C++ API | ||
| 5 | |||
| 6 | Fixes issue where bpf.get_syscall_fnname() on riscv64 returns bare syscall | ||
| 7 | name instead of the prefixed _riscv_sys variant, causing kprobe | ||
| 8 | attachment failures. | ||
| 9 | |||
| 10 | Upstream-Status: Submitted [https://github.com/iovisor/bcc/pull/5490] | ||
| 11 | |||
| 12 | Signed-off-by: Harish Sadineni <Harish.Sadineni@windriver.com> | ||
| 13 | --- | ||
| 14 | src/cc/api/BPF.cc | 2 ++ | ||
| 15 | 1 file changed, 2 insertions(+) | ||
| 16 | |||
| 17 | diff --git a/src/cc/api/BPF.cc b/src/cc/api/BPF.cc | ||
| 18 | index 11c6c542..e1df8208 100644 | ||
| 19 | --- a/src/cc/api/BPF.cc | ||
| 20 | +++ b/src/cc/api/BPF.cc | ||
| 21 | @@ -782,6 +782,8 @@ std::string BPF::get_syscall_fnname(const std::string& name) { | ||
| 22 | syscall_prefix_.reset(new std::string("__x64_sys_")); | ||
| 23 | else if (ksym.resolve_name(nullptr, "__arm64_sys_bpf", &addr)) | ||
| 24 | syscall_prefix_.reset(new std::string("__arm64_sys_")); | ||
| 25 | + else if (ksym.resolve_name(nullptr, "__riscv_sys_bpf", &addr)) | ||
| 26 | + syscall_prefix_.reset(new std::string("__riscv_sys_")); | ||
| 27 | else | ||
| 28 | syscall_prefix_.reset(new std::string()); | ||
| 29 | } | ||
| 30 | -- | ||
| 31 | 2.49.0 | ||
| 32 | |||
diff --git a/meta-oe/dynamic-layers/meta-python/recipes-devtools/bcc/bcc_0.35.0.bb b/meta-oe/dynamic-layers/meta-python/recipes-devtools/bcc/bcc_0.35.0.bb index 25528e1b10..3a34f04349 100644 --- a/meta-oe/dynamic-layers/meta-python/recipes-devtools/bcc/bcc_0.35.0.bb +++ b/meta-oe/dynamic-layers/meta-python/recipes-devtools/bcc/bcc_0.35.0.bb | |||
| @@ -23,6 +23,7 @@ SRC_URI = "gitsm://github.com/iovisor/bcc;branch=master;protocol=https;tag=v${PV | |||
| 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-Fix-a-build-failure-with-clang21-5369.patch \ | 24 | file://0001-Fix-a-build-failure-with-clang21-5369.patch \ |
| 25 | file://0001-Add-ARM64-syscall-prefix-detection-in-C-API.patch \ | 25 | file://0001-Add-ARM64-syscall-prefix-detection-in-C-API.patch \ |
| 26 | file://0002-Add-riscv-syscall-prefix-detection-in-C-API.patch \ | ||
| 26 | file://run-ptest \ | 27 | file://run-ptest \ |
| 27 | file://ptest_wrapper.sh \ | 28 | file://ptest_wrapper.sh \ |
| 28 | file://fix_for_memleak.patch \ | 29 | file://fix_for_memleak.patch \ |
