Skip to content

Commit c596213

Browse files
committed
Add cst_var_binop.py as passing assign test
1 parent 054a834 commit c596213

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
from pythonbpf import bpf, section, bpfglobal, compile
2+
from ctypes import c_void_p, c_int64
3+
4+
5+
@bpf
6+
@section("tracepoint/syscalls/sys_enter_execve")
7+
def hello_world(ctx: c_void_p) -> c_int64:
8+
x = 1
9+
print(f"Initial x: {x}")
10+
a = 20
11+
x = a
12+
print(f"Updated x with a: {x}")
13+
x = (x + x) * 3
14+
if x == 2:
15+
print("Hello, World!")
16+
else:
17+
print(f"Goodbye, World! {x}")
18+
return
19+
20+
21+
@bpf
22+
@bpfglobal
23+
def LICENSE() -> str:
24+
return "GPL"
25+
26+
27+
compile()

0 commit comments

Comments
 (0)