diff --git a/BCC-Examples/hello_world.py b/BCC-Examples/hello_world.py new file mode 100644 index 0000000..447cc1b --- /dev/null +++ b/BCC-Examples/hello_world.py @@ -0,0 +1,18 @@ +from pythonbpf import bpf, section, bpfglobal, compile +from ctypes import c_void_p, c_int64 + + +@bpf +@section("tracepoint/syscalls/sys_enter_clone") +def hello_world(ctx: c_void_p) -> c_int64: + print("Hello, World!") + return c_int64(0) + + +@bpf +@bpfglobal +def LICENSE() -> str: + return "GPL" + + +compile()