From eed01e5cc028e09b0186c31aa3228ed36053ce5f Mon Sep 17 00:00:00 2001 From: Harish Sadineni Date: Sat, 7 Mar 2026 21:54:10 -0800 Subject: [PATCH] bcc: 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. Upstream-Status: Submitted [https://github.com/iovisor/bcc/pull/5489] Signed-off-by: Harish Sadineni Signed-off-by: Khem Raj --- ...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 --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 +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 +--- + 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 \