We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 95a196a commit a764b09Copy full SHA for a764b09
tests/failing_tests/conditionals/helper_cond.py
@@ -0,0 +1,26 @@
1
+from pythonbpf import bpf, map, section, bpfglobal
2
+from ctypes import c_void_p, c_int64, c_uint64
3
+from pythonbpf.maps import HashMap
4
+
5
6
+@bpf
7
+@map
8
+def last() -> HashMap:
9
+ return HashMap(key=c_uint64, value=c_uint64, max_entries=3)
10
11
12
13
+@section("tracepoint/syscalls/sys_enter_execve")
14
+def hello_world(ctx: c_void_p) -> c_int64:
15
+ last.update(0, 1)
16
+ if last.lookup(0) > 0:
17
+ print("Hello, World!")
18
+ else:
19
+ print("Goodbye, World!")
20
+ return
21
22
23
24
+@bpfglobal
25
+def LICENSE() -> str:
26
+ return "GPL"
0 commit comments