diff mbox series

[meta-oe,1/3] bcc: Add ARM64 syscall prefix detection in C++ API

Message ID 20260308055412.2450108-1-Harish.Sadineni@windriver.com
State New
Headers show
Series [meta-oe,1/3] bcc: Add ARM64 syscall prefix detection in C++ API | expand

Commit Message

Harish Sadineni March 8, 2026, 5:54 a.m. UTC
From: Harish Sadineni <Harish.Sadineni@windriver.com>

Fixes issue where bpf.get_syscall_fnname() on ARM64 returns bare syscall name
instead of the prefixed _arm64_sys variant, causing kprobe attachment failures.
Now detects ARM64 prefix alongside x64 (x64_sys) and generic (sys) prefixes.

Upstream-Status: Submitted [https://github.com/iovisor/bcc/pull/5489]

Signed-off-by: Harish Sadineni <Harish.Sadineni@windriver.com>
---
 ...64-syscall-prefix-detection-in-C-API.patch | 35 +++++++++++++++++++
 .../recipes-devtools/bcc/bcc_0.35.0.bb        |  1 +
 2 files changed, 36 insertions(+)
 create mode 100644 meta-oe/dynamic-layers/meta-python/recipes-devtools/bcc/bcc/0001-Add-ARM64-syscall-prefix-detection-in-C-API.patch
diff mbox series

Patch

diff --git a/meta-oe/dynamic-layers/meta-python/recipes-devtools/bcc/bcc/0001-Add-ARM64-syscall-prefix-detection-in-C-API.patch b/meta-oe/dynamic-layers/meta-python/recipes-devtools/bcc/bcc/0001-Add-ARM64-syscall-prefix-detection-in-C-API.patch
new file mode 100644
index 0000000000..d6b52438c4
--- /dev/null
+++ b/meta-oe/dynamic-layers/meta-python/recipes-devtools/bcc/bcc/0001-Add-ARM64-syscall-prefix-detection-in-C-API.patch
@@ -0,0 +1,35 @@ 
+From b901fb0088a7605eec00af7b644e25987995d693 Mon Sep 17 00:00:00 2001
+From: Harish Sadineni <Harish.Sadineni@windriver.com>
+Date: Sat, 7 Mar 2026 07:18:43 -0800
+Subject: [PATCH] Add ARM64 syscall prefix detection in C++ API
+
+Fixes issue where bpf.get_syscall_fnname() on ARM64 returns bare
+syscall name instead of the prefixed __arm64_sys_ variant, causing
+kprobe attachment failures. Now detects ARM64 prefix alongside x64
+(__x64_sys_) and generic (sys_) prefixes.
+
+Fixes: #5350
+
+Upstream-Status: Submitted [https://github.com/iovisor/bcc/pull/5489]
+
+Signed-off-by: Harish Sadineni <Harish.Sadineni@windriver.com>
+---
+ src/cc/api/BPF.cc | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/src/cc/api/BPF.cc b/src/cc/api/BPF.cc
+index 2a77c2c9..11c6c542 100644
+--- a/src/cc/api/BPF.cc
++++ b/src/cc/api/BPF.cc
+@@ -780,6 +780,8 @@ std::string BPF::get_syscall_fnname(const std::string& name) {
+       syscall_prefix_.reset(new std::string("sys_"));
+     else if (ksym.resolve_name(nullptr, "__x64_sys_bpf", &addr))
+       syscall_prefix_.reset(new std::string("__x64_sys_"));
++    else if (ksym.resolve_name(nullptr, "__arm64_sys_bpf", &addr))
++      syscall_prefix_.reset(new std::string("__arm64_sys_"));
+     else
+       syscall_prefix_.reset(new std::string());
+   }
+-- 
+2.49.0
+
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 8c6e44edbc..25528e1b10 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
@@ -22,6 +22,7 @@  SRC_URI = "gitsm://github.com/iovisor/bcc;branch=master;protocol=https;tag=v${PV
            file://0001-CMakeLists.txt-override-the-PY_CMD_ESCAPED.patch \
            file://0001-Vendor-just-enough-extra-headers-to-allow-libbpf-to-.patch \
            file://0001-Fix-a-build-failure-with-clang21-5369.patch \
+           file://0001-Add-ARM64-syscall-prefix-detection-in-C-API.patch \
            file://run-ptest \
            file://ptest_wrapper.sh \
            file://fix_for_memleak.patch \