From 9f8e240a38007e4f23e179334cd73abdd20e7938 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 5bd913a..a1a580b 100755 --- a/tools/vmlinux-gen.py +++ b/tools/vmlinux-gen.py @@ -243,6 +243,17 @@ class BTFConverter: 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: