mirror of
https://github.com/varun-r-mallya/Python-BPF.git
synced 2025-12-31 21:06:25 +00:00
@ -10,7 +10,7 @@ def hello_world(ctx: c_void_p) -> c_int64:
|
|||||||
|
|
||||||
@bpf
|
@bpf
|
||||||
@section("kprobe/do_unlinkat")
|
@section("kprobe/do_unlinkat")
|
||||||
def hello_world2(ctx: c_void_p) -> c_int64:
|
def hello_world(ctx: c_void_p) -> c_int64:
|
||||||
print("Hello, World!")
|
print("Hello, World!")
|
||||||
return c_int64(0)
|
return c_int64(0)
|
||||||
|
|
||||||
|
|||||||
@ -410,7 +410,7 @@ def process_stmt(
|
|||||||
raise ValueError("Failed to evaluate return expression")
|
raise ValueError("Failed to evaluate return expression")
|
||||||
if val[1] != ret_type:
|
if val[1] != ret_type:
|
||||||
raise ValueError(
|
raise ValueError(
|
||||||
f"Return type mismatch: expected {ret_type}, got {val[1]}"
|
"Return type mismatch: expected " f"{ret_type}, got {val[1]}"
|
||||||
)
|
)
|
||||||
builder.ret(val[0])
|
builder.ret(val[0])
|
||||||
did_return = True
|
did_return = True
|
||||||
@ -420,7 +420,8 @@ def process_stmt(
|
|||||||
val = builder.load(var)
|
val = builder.load(var)
|
||||||
if val.type != ret_type:
|
if val.type != ret_type:
|
||||||
raise ValueError(
|
raise ValueError(
|
||||||
f"Return type mismatch: expected{ret_type}, got {val.type}"
|
"Return type mismatch: expected"
|
||||||
|
f"{ret_type}, got {val.type}"
|
||||||
)
|
)
|
||||||
builder.ret(val)
|
builder.ret(val)
|
||||||
did_return = True
|
did_return = True
|
||||||
|
|||||||
Reference in New Issue
Block a user