Skip to content

Commit 989134f

Browse files
add patch for Kernel 6.14 BTF
Signed-off-by: varun-r-mallya <[email protected]>
1 parent 120aec0 commit 989134f

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

tools/vmlinux-gen.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,17 @@ def step5_postprocess(self, input_file):
243243
data
244244
)
245245

246+
# below to replace those c_bool with bitfield greater than 8
247+
def repl(m):
248+
name, bits = m.groups()
249+
return f"('{name}', ctypes.c_uint32, {bits})" if int(bits) > 8 else m.group(0)
250+
251+
data = re.sub(
252+
r"\('([^']+)',\s*ctypes\.c_bool,\s*(\d+)\)",
253+
repl,
254+
data
255+
)
256+
246257
# Remove ctypes. prefix from invalid entries
247258
invalid_ctypes = ["bpf_iter_state", "_cache_type", "fs_context_purpose"]
248259
for name in invalid_ctypes:

0 commit comments

Comments
 (0)