mirror of
https://github.com/varun-r-mallya/Python-BPF.git
synced 2026-03-24 14:11:29 +00:00
Compare commits
3 Commits
refactor_a
...
6402cf7be5
| Author | SHA1 | Date | |
|---|---|---|---|
| 6402cf7be5 | |||
| 9a96e1247b | |||
| 989134f4be |
13
TODO.md
13
TODO.md
@ -1,13 +0,0 @@
|
|||||||
## Short term
|
|
||||||
|
|
||||||
- Implement enough functionality to port the BCC tutorial examples in PythonBPF
|
|
||||||
- Add all maps
|
|
||||||
- XDP support in pylibbpf
|
|
||||||
- ringbuf support
|
|
||||||
- Add oneline IfExpr conditionals (wishlist)
|
|
||||||
|
|
||||||
## Long term
|
|
||||||
|
|
||||||
- Refactor the codebase to be better than a hackathon project
|
|
||||||
- Port to C++ and use actual LLVM?
|
|
||||||
- Fix struct_kioctx issue in the vmlinux transpiler
|
|
||||||
@ -243,6 +243,17 @@ class BTFConverter:
|
|||||||
data
|
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
|
# Remove ctypes. prefix from invalid entries
|
||||||
invalid_ctypes = ["bpf_iter_state", "_cache_type", "fs_context_purpose"]
|
invalid_ctypes = ["bpf_iter_state", "_cache_type", "fs_context_purpose"]
|
||||||
for name in invalid_ctypes:
|
for name in invalid_ctypes:
|
||||||
|
|||||||
Reference in New Issue
Block a user