Skip to content

Commit 93634a4

Browse files
format chore
1 parent 9b8462f commit 93634a4

File tree

3 files changed

+20
-10
lines changed

3 files changed

+20
-10
lines changed

pythonbpf/vmlinux_parser/class_handler.py

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,7 @@ def process_vmlinux_post_ast(
4141
module_name = getattr(elem_type_class, "__module__", None)
4242

4343
if current_symbol_name in processing_stack:
44-
logger.info(
45-
f"Circular dependency detected for {current_symbol_name}, skipping"
46-
)
44+
logger.info(f"Circular dependency detected for {current_symbol_name}, skipping")
4745
return True
4846

4947
# Check if already processed
@@ -119,20 +117,28 @@ def process_vmlinux_post_ast(
119117
raise ImportError(
120118
f"Unsupported module of {containing_type}"
121119
)
122-
logger.info(f"{containing_type} containing type of parent {elem_name} with {elem_type} and ctype {ctype_complex_type} and length {type_length}")
123-
new_dep_node.set_field_containing_type(elem_name, containing_type)
120+
logger.info(
121+
f"{containing_type} containing type of parent {elem_name} with {elem_type} and ctype {ctype_complex_type} and length {type_length}"
122+
)
123+
new_dep_node.set_field_containing_type(
124+
elem_name, containing_type
125+
)
124126
new_dep_node.set_field_type_size(elem_name, type_length)
125-
new_dep_node.set_field_ctype_complex_type(elem_name, ctype_complex_type)
127+
new_dep_node.set_field_ctype_complex_type(
128+
elem_name, ctype_complex_type
129+
)
126130
new_dep_node.set_field_type(elem_name, elem_type)
127131
if containing_type.__module__ == "vmlinux":
128132
if process_vmlinux_post_ast(
129-
containing_type, llvm_handler, handler, processing_stack
133+
containing_type, llvm_handler, handler, processing_stack
130134
):
131135
new_dep_node.set_field_ready(elem_name, True)
132136
elif containing_type.__module__ == ctypes.__name__:
133137
logger.info(f"Processing ctype internal{containing_type}")
134138
else:
135-
raise TypeError("Module not supported in recursive resolution")
139+
raise TypeError(
140+
"Module not supported in recursive resolution"
141+
)
136142
continue
137143
if process_vmlinux_post_ast(
138144
elem_type, llvm_handler, handler, processing_stack

pythonbpf/vmlinux_parser/dependency_node.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,9 @@ def set_type_size(self, type_size: Any, mark_ready: bool = True) -> None:
4646
if mark_ready:
4747
self.ready = True
4848

49-
def set_ctype_complex_type(self, ctype_complex_type: Any, mark_ready: bool = True) -> None:
49+
def set_ctype_complex_type(
50+
self, ctype_complex_type: Any, mark_ready: bool = True
51+
) -> None:
5052
"""Set the ctype_complex_type of this field and optionally mark it as ready."""
5153
self.ctype_complex_type = ctype_complex_type
5254
if mark_ready:
@@ -127,7 +129,7 @@ def add_field(
127129
containing_type=containing_type,
128130
type_size=type_size,
129131
ctype_complex_type=ctype_complex_type,
130-
bitfield_size=bitfield_size
132+
bitfield_size=bitfield_size,
131133
)
132134
# Invalidate readiness cache
133135
self._ready_cache = None

tests/failing_tests/xdp_pass.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@
22
from pythonbpf.maps import HashMap
33
from pythonbpf.helper import XDP_PASS
44
from vmlinux import struct_xdp_md
5+
56
# from vmlinux import struct_ring_buffer_per_cpu # noqa: F401
67
from vmlinux import struct_xdp_buff # noqa: F401
8+
79
# from vmlinux import struct_xdp_md
810
from ctypes import c_int64
911

0 commit comments

Comments
 (0)