From 659e3f44281b7ced98fdaa14a4a12f3ec051e378 Mon Sep 17 00:00:00 2001 From: wangzhe Date: Thu, 18 Jul 2024 15:06:38 +0800 Subject: [PATCH] support bpf rich container disable BPF_PROG_TYPE_SYSCALL Signed-off-by: wangzhe --- 0001-disable-BPF_PROG_TYPE_SYSCALL.patch | 26 ++++++++++++++ ...nolis-own-feature-bpf-rich-container.patch | 34 +++++++++++++++++++ bcc.spec | 10 +++++- 3 files changed, 69 insertions(+), 1 deletion(-) create mode 100644 0001-disable-BPF_PROG_TYPE_SYSCALL.patch create mode 100644 0001-support-anolis-own-feature-bpf-rich-container.patch diff --git a/0001-disable-BPF_PROG_TYPE_SYSCALL.patch b/0001-disable-BPF_PROG_TYPE_SYSCALL.patch new file mode 100644 index 0000000..9cffe16 --- /dev/null +++ b/0001-disable-BPF_PROG_TYPE_SYSCALL.patch @@ -0,0 +1,26 @@ +From d5b84cfb1fb2efe869612f27405ae107389b130c Mon Sep 17 00:00:00 2001 +From: Liwei Ge +Date: Fri, 20 Oct 2023 09:23:17 +0000 +Subject: [PATCH] disable BPF_PROG_TYPE_SYSCALL + +Signed-off-by: +--- + introspection/bps.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/introspection/bps.c b/introspection/bps.c +index 6ec02e6..e9e18fb 100644 +--- a/introspection/bps.c ++++ b/introspection/bps.c +@@ -47,7 +47,7 @@ static const char * const prog_type_strings[] = { + [BPF_PROG_TYPE_EXT] = "ext", + [BPF_PROG_TYPE_LSM] = "lsm", + [BPF_PROG_TYPE_SK_LOOKUP] = "sk_lookup", +- [BPF_PROG_TYPE_SYSCALL] = "syscall", ++ //[BPF_PROG_TYPE_SYSCALL] = "syscall", + }; + + static const char * const map_type_strings[] = { +-- +2.39.3 + diff --git a/0001-support-anolis-own-feature-bpf-rich-container.patch b/0001-support-anolis-own-feature-bpf-rich-container.patch new file mode 100644 index 0000000..3e19bcb --- /dev/null +++ b/0001-support-anolis-own-feature-bpf-rich-container.patch @@ -0,0 +1,34 @@ +From e6f5aa7d91df2ac81f90f352bd18aa3127f76dfd Mon Sep 17 00:00:00 2001 +From: Tianchen Ding +Date: Fri, 20 Oct 2023 17:35:17 +0800 +Subject: [PATCH] support anolis own feature: bpf rich container + +Signed-off-by: Tianchen Ding +--- + src/cc/compat/linux/virtual_bpf.h | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/src/cc/compat/linux/virtual_bpf.h b/src/cc/compat/linux/virtual_bpf.h +index f36c665c..483f53b5 100644 +--- a/src/cc/compat/linux/virtual_bpf.h ++++ b/src/cc/compat/linux/virtual_bpf.h +@@ -953,6 +953,7 @@ enum bpf_prog_type { + BPF_PROG_TYPE_LSM, + BPF_PROG_TYPE_SK_LOOKUP, + BPF_PROG_TYPE_SYSCALL, /* a program that can execute syscalls */ ++ BPF_PROG_TYPE_CGROUP_RICH_CONTAINER = 0x1000, + }; + + enum bpf_attach_type { +@@ -1000,6 +1001,8 @@ enum bpf_attach_type { + BPF_PERF_EVENT, + BPF_TRACE_KPROBE_MULTI, + BPF_LSM_CGROUP, ++ BPF_CGROUP_RICH_CONTAINER_CPU = 0x1000, ++ BPF_CGROUP_RICH_CONTAINER_MEM, + __MAX_BPF_ATTACH_TYPE + }; + +-- +2.39.3 + diff --git a/bcc.spec b/bcc.spec index 86785de..1356e0a 100644 --- a/bcc.spec +++ b/bcc.spec @@ -1,4 +1,4 @@ -%global anolis_release .0.1 +%global anolis_release .0.2 # luajit is not available RHEL 8 %bcond_with lua @@ -34,6 +34,8 @@ Patch14: %{name}-%{version}-tools-tcpstates-fix-IPv6-journal.patch Patch1000: %{name}-%{version}-Add-libbpf-with-commit-0667206913b.patch +Patch1001: 0001-support-anolis-own-feature-bpf-rich-container.patch +Patch1002: 0001-disable-BPF_PROG_TYPE_SYSCALL.patch # Arches will be included as upstream support is added and dependencies are # satisfied in the respective arches @@ -130,6 +132,8 @@ Command line tools for BPF Compiler Collection (BCC) %ifarch loongarch64 %patch1000 -p1 %else +%patch1001 -p1 +%patch1002 -p1 %patch0 -p1 %patch1 -p1 %patch2 -p1 @@ -252,6 +256,10 @@ done %changelog +* Thu Jul 18 2024 wangzhe - 0.25.0-7.0.2 +- support bpf rich container (yingyu.dtc@alibaba-inc.com) +- disable BPF_PROG_TYPE_SYSCALL (Liwei Ge) + * Fri Jul 05 2024 Hui Li - 0.25.0-7.0.1 - Add support for loongarch64 -- Gitee