Organize source files

This commit is contained in:
2025-08-30 18:49:08 +05:30
parent d5557d3c01
commit e19aa9fa66
7 changed files with 47 additions and 16 deletions

15
examples/c-form/Makefile Normal file
View File

@ -0,0 +1,15 @@
BPF_CLANG := clang
CFLAGS := -O2 -emit-llvm -target bpf -c
SRC := example.bpf.c
OUT := example.bpf.ll
.PHONY: all clean
all: $(OUT)
$(OUT): $(SRC)
$(BPF_CLANG) $(CFLAGS) -S $< -o $@
clean:
rm -f $(OUT)

View File

@ -1,10 +1,8 @@
from pythonbpf import decorators
from pythonbpf.decorators import tracepoint, license
@decorators.tracepoint("syscalls:sys_enter_execve")
@tracepoint("syscalls:sys_enter_execve")
def trace_execve(ctx) -> int:
decorators.trace_printk("execve called\n")
print("execve called\n")
return 0
@decorators.license("GPL")
def _():
pass
license("GPL")