diff --git a/examples/c-form/ex2.bpf.c b/examples/c-form/ex2.bpf.c new file mode 100644 index 0000000..80075dd --- /dev/null +++ b/examples/c-form/ex2.bpf.c @@ -0,0 +1,10 @@ +#include +#include + +SEC("kprobe/sys_clone") +int hello(struct pt_regs *ctx) { + bpf_printk("Hello, World!"); + return 0; +} + +char LICENSE[] SEC("license") = "GPL"; diff --git a/examples/execve2.py b/examples/execve2.py new file mode 100644 index 0000000..d04ea3c --- /dev/null +++ b/examples/execve2.py @@ -0,0 +1,14 @@ +from pythonbpf.decorators import section +# from pythonbpf.decorators import tracepoint, syscalls +from ctypes import c_void_p, c_int32 + +# @tracepoint(syscalls.sys_enter_execve) + + +@section("kprobe/sys_clone") +def hello(ctx: c_void_p) -> c_int32: + print("Hello, World!") + return c_int32(0) + + +LICENSE = "GPL"