From 989134f4be33e827640c1096dbad1b778c8fb26f Mon Sep 17 00:00:00 2001 From: varun-r-mallya Date: Wed, 8 Oct 2025 21:47:02 +0530 Subject: [PATCH] add patch for Kernel 6.14 BTF Signed-off-by: varun-r-mallya --- tools/vmlinux-gen.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tools/vmlinux-gen.py b/tools/vmlinux-gen.py index 5bd913ac..a1a580bc 100755 --- a/tools/vmlinux-gen.py +++ b/tools/vmlinux-gen.py @@ -243,6 +243,17 @@ def step5_postprocess(self, input_file): data ) + # below to replace those c_bool with bitfield greater than 8 + def repl(m): + name, bits = m.groups() + return f"('{name}', ctypes.c_uint32, {bits})" if int(bits) > 8 else m.group(0) + + data = re.sub( + r"\('([^']+)',\s*ctypes\.c_bool,\s*(\d+)\)", + repl, + data + ) + # Remove ctypes. prefix from invalid entries invalid_ctypes = ["bpf_iter_state", "_cache_type", "fs_context_purpose"] for name in invalid_ctypes: