format chore

This commit is contained in:
2025-10-13 19:11:59 +05:30
parent 69d8669e44
commit b34f7dd68a
2 changed files with 8 additions and 2 deletions

View File

@ -11,6 +11,7 @@ from pythonbpf.maps import HashMap
# We can allow bitcasts in cases where the width of the types is the same in
# the future. But for now, we do not allow any re-interpretation of variables.
@bpf
@map
def last() -> HashMap:

View File

@ -9,6 +9,7 @@ from pythonbpf.helper import ktime
# the compiler, it is recommended to use named variables to reduce the amount of
# scratch space that needs to be allocated.
@bpf
@struct
class data_t:
@ -48,8 +49,12 @@ def hello_world(ctx: c_void_p) -> c_int64:
a = last.lookup(0)
print(f"a is {a}")
last.update(9, 9)
last.update(0, last.lookup(last.lookup(0)) +
last.lookup(last.lookup(0)) + last.lookup(last.lookup(0)))
last.update(
0,
last.lookup(last.lookup(0))
+ last.lookup(last.lookup(0))
+ last.lookup(last.lookup(0)),
)
z = last.lookup(0)
print(f"new map val at index 0 is {z}")
else: