Skip to content

Commit 20ec307

Browse files
format chore
1 parent 0b4c626 commit 20ec307

File tree

2 files changed

+19
-6
lines changed

2 files changed

+19
-6
lines changed

pythonbpf/vmlinux_parser/class_handler.py

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,9 @@ def process_vmlinux_post_ast(
4848

4949
# XXX:Check it's use. It's probably not being used.
5050
if current_symbol_name in processing_stack:
51-
logger.debug(f"Dependency already in processing stack for {current_symbol_name}, skipping")
51+
logger.debug(
52+
f"Dependency already in processing stack for {current_symbol_name}, skipping"
53+
)
5254
return True
5355

5456
processing_stack.add(current_symbol_name)
@@ -93,7 +95,9 @@ def process_vmlinux_post_ast(
9395
if local_module_name == ctypes.__name__:
9496
new_dep_node.set_field_bitfield_size(elem_name, elem_bitfield_size)
9597
new_dep_node.set_field_ready(elem_name, is_ready=True)
96-
logger.debug(f"Field {elem_name} is direct ctypes type: {elem_type}")
98+
logger.debug(
99+
f"Field {elem_name} is direct ctypes type: {elem_type}"
100+
)
97101
elif local_module_name == "vmlinux":
98102
new_dep_node.set_field_bitfield_size(elem_name, elem_bitfield_size)
99103
logger.debug(
@@ -131,7 +135,9 @@ def process_vmlinux_post_ast(
131135
)
132136
new_dep_node.set_field_type(elem_name, elem_type)
133137
if containing_type.__module__ == "vmlinux":
134-
process_vmlinux_post_ast(containing_type, llvm_handler, handler, processing_stack)
138+
process_vmlinux_post_ast(
139+
containing_type, llvm_handler, handler, processing_stack
140+
)
135141
new_dep_node.set_field_ready(elem_name, True)
136142
elif containing_type.__module__ == ctypes.__name__:
137143
logger.debug(f"Processing ctype internal{containing_type}")
@@ -141,7 +147,9 @@ def process_vmlinux_post_ast(
141147
"Module not supported in recursive resolution"
142148
)
143149
else:
144-
process_vmlinux_post_ast(elem_type, llvm_handler, handler, processing_stack)
150+
process_vmlinux_post_ast(
151+
elem_type, llvm_handler, handler, processing_stack
152+
)
145153
new_dep_node.set_field_ready(elem_name, True)
146154
else:
147155
raise ValueError(
@@ -151,5 +159,7 @@ def process_vmlinux_post_ast(
151159
else:
152160
raise ImportError("UNSUPPORTED Module")
153161

154-
logging.info(f"{current_symbol_name} processed and handler readiness {handler.is_ready}")
162+
logging.info(
163+
f"{current_symbol_name} processed and handler readiness {handler.is_ready}"
164+
)
155165
return True

pythonbpf/vmlinux_parser/ir_generation.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,12 @@
33

44
logger = logging.getLogger(__name__)
55

6+
67
class IRGenerator:
78
def __init__(self, module, handler: DependencyHandler):
89
self.module = module
910
self.handler: DependencyHandler = handler
1011
if not handler.is_ready:
11-
raise ImportError("Semantic analysis of vmlinux imports failed. Cannot generate IR")
12+
raise ImportError(
13+
"Semantic analysis of vmlinux imports failed. Cannot generate IR"
14+
)

0 commit comments

Comments
 (0)