Add shorter examples

This commit is contained in:
Pragyansh Chaturvedi
2025-09-06 02:40:42 +05:30
parent c9e4910a89
commit 81f4a0a799
2 changed files with 24 additions and 0 deletions

14
examples/execve2.py Normal file
View File

@ -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"