Skip to content

Commit 2b3635f

Browse files
format chore
1 parent 6f25c55 commit 2b3635f

File tree

3 files changed

+16
-9
lines changed

3 files changed

+16
-9
lines changed

pythonbpf/assign_pass.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,9 @@ def handle_variable_assignment(
150150
return False
151151

152152
val, val_type = val_result
153-
logger.info(f"Evaluated value for {var_name}: {val} of type {val_type}, expected {var_type}")
153+
logger.info(
154+
f"Evaluated value for {var_name}: {val} of type {val_type}, expected {var_type}"
155+
)
154156

155157
if val_type != var_type:
156158
# Handle vmlinux struct pointers - they're represented as Python classes but are i64 pointers
@@ -161,7 +163,9 @@ def handle_variable_assignment(
161163
# Convert pointer to i64 using ptrtoint
162164
if isinstance(val.type, ir.PointerType):
163165
val = builder.ptrtoint(val, ir.IntType(64))
164-
logger.info(f"Converted vmlinux struct pointer to i64 using ptrtoint")
166+
logger.info(
167+
"Converted vmlinux struct pointer to i64 using ptrtoint"
168+
)
165169
builder.store(val, var_ptr)
166170
logger.info(f"Assigned vmlinux struct pointer to {var_name} (i64)")
167171
return True

pythonbpf/helper/__init__.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
from .helper_registry import HelperHandlerRegistry
22
from .helper_utils import reset_scratch_pool
3-
from .bpf_helper_handler import handle_helper_call, emit_probe_read_kernel_str_call, emit_probe_read_kernel_call
3+
from .bpf_helper_handler import (
4+
handle_helper_call,
5+
emit_probe_read_kernel_str_call,
6+
emit_probe_read_kernel_call,
7+
)
48
from .helpers import (
59
ktime,
610
pid,

pythonbpf/vmlinux_parser/vmlinux_exports_handler.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,9 @@ def load_struct_field(
173173

174174
if field_size_bits in [8, 16, 32, 64]:
175175
int_width = field_size_bits
176-
logger.info(f"Determined field size: {int_width} bits ({field_size_bytes} bytes)")
176+
logger.info(
177+
f"Determined field size: {int_width} bits ({field_size_bytes} bytes)"
178+
)
177179

178180
# Special handling for struct_xdp_md i32 fields
179181
if struct_name == "struct_xdp_md" and int_width == 32:
@@ -212,11 +214,8 @@ def load_struct_field(
212214
# %result = call i64 inttoptr (i64 113 to ptr)(ptr %local_storage, i32 %size, ptr %passed)
213215
from pythonbpf.helper import emit_probe_read_kernel_call
214216

215-
result = emit_probe_read_kernel_call(
216-
builder,
217-
local_storage_i8_ptr,
218-
field_size_bytes,
219-
field_ptr
217+
emit_probe_read_kernel_call(
218+
builder, local_storage_i8_ptr, field_size_bytes, field_ptr
220219
)
221220

222221
# Load the value from local storage

0 commit comments

Comments
 (0)