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

@ -0,0 +1,11 @@
#include <linux/bpf.h>
#include <bpf/bpf_helpers.h>
SEC("tracepoint/syscalls/sys_enter_execve")
int trace_execve(void *ctx)
{
bpf_printk("execve called\n");
return 0;
}
char LICENSE[] SEC("license") = "GPL";