Skip to content

Commit a42a751

Browse files
format chore
1 parent 377fa40 commit a42a751

File tree

4 files changed

+12
-6
lines changed

4 files changed

+12
-6
lines changed

pythonbpf/allocation_pass.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,9 @@ def _allocate_for_attribute(builder, var_name, rval, local_sym_tab, structs_sym_
393393

394394
# Allocate with the actual IR type
395395
var = _allocate_with_type(builder, var_name, actual_ir_type)
396-
local_sym_tab[var_name] = LocalSymbol(var, actual_ir_type, field) # <-- Store Field metadata
396+
local_sym_tab[var_name] = LocalSymbol(
397+
var, actual_ir_type, field
398+
) # <-- Store Field metadata
397399

398400
logger.info(
399401
f"Pre-allocated {var_name} as {actual_ir_type} from vmlinux struct {vmlinux_struct_name}.{field_name}"

pythonbpf/assign_pass.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import ast
22
import logging
3-
from inspect import isclass
43

54
from llvmlite import ir
65
from pythonbpf.expr import eval_expr

pythonbpf/expr/expr_pass.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
get_base_type_and_depth,
1313
deref_to_depth,
1414
)
15-
from pythonbpf.vmlinux_parser.assignment_info import Field
1615
from .vmlinux_registry import VmlinuxHandlerRegistry
1716
from ..vmlinux_parser.dependency_node import Field
1817

pythonbpf/vmlinux_parser/vmlinux_exports_handler.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,11 @@ def handle_vmlinux_struct_field(
103103
globvar_ir, field_data = self.get_field_type(struct_name, field_name)
104104
builder.function.args[0].type = ir.PointerType(ir.IntType(8))
105105
field_ptr = self.load_ctx_field(
106-
builder, builder.function.args[0], globvar_ir, field_data, struct_name
106+
builder,
107+
builder.function.args[0],
108+
globvar_ir,
109+
field_data,
110+
struct_name,
107111
)
108112
return field_ptr, field_data
109113
else:
@@ -125,7 +129,9 @@ def handle_vmlinux_struct_field(
125129
raise RuntimeError("Variable accessed not found in symbol table")
126130

127131
@staticmethod
128-
def load_struct_field(builder, struct_ptr_int, offset_global, field_data, struct_name=None):
132+
def load_struct_field(
133+
builder, struct_ptr_int, offset_global, field_data, struct_name=None
134+
):
129135
"""
130136
Generate LLVM IR to load a field from a regular (non-context) struct using standard GEP.
131137
@@ -186,7 +192,7 @@ def load_struct_field(builder, struct_ptr_int, offset_global, field_data, struct
186192
elif field_data.type.__module__ == "vmlinux":
187193
# For pointers to structs or complex vmlinux types
188194
if field_data.ctype_complex_type is not None and issubclass(
189-
field_data.ctype_complex_type, ctypes._Pointer
195+
field_data.ctype_complex_type, ctypes._Pointer
190196
):
191197
int_width = 64 # Pointers are always 64-bit
192198
logger.info("Field is a pointer type, using 64 bits")

0 commit comments

Comments
 (0)