From 18d62d605a62eb5768b3b7f4115065cfeccd4716 Mon Sep 17 00:00:00 2001 From: Pragyansh Chaturvedi Date: Mon, 13 Oct 2025 20:11:27 +0530 Subject: [PATCH] Add hello_world BCC example --- BCC-Examples/hello_world.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 BCC-Examples/hello_world.py 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()