get hashmap compiling

This commit is contained in:
2025-09-08 22:26:16 +05:30
parent 1a82875f68
commit f7aa054b31
3 changed files with 56 additions and 50 deletions

View File

@ -13,7 +13,7 @@ all: $(LL) $(OBJ)
$(BPF_CLANG) -O2 -g -target bpf -c $< -o $@
%.bpf.ll: %.bpf.c
$(BPF_CLANG) $(CFLAGS) -S $< -o $@
$(BPF_CLANG) $(CFLAGS) -g -S $< -o $@
clean:
rm -f $(LL) $(OBJ)

View File

@ -1,13 +1,21 @@
#include <linux/bpf.h>
#include <bpf/bpf_helpers.h>
#define u64 unsigned long long
#define u32 unsigned int
struct {
__uint(type, BPF_MAP_TYPE_HASH);
__uint(max_entries, 1);
__type(key, u32);
__type(value, u64);
} last SEC(".maps");
struct {
__uint(type, BPF_MAP_TYPE_HASH);
__uint(max_entries, 1);
__type(key, u64);
__type(value, u64);
} last SEC(".maps");
} last2 SEC(".maps");
SEC("tracepoint/syscalls/sys_enter_execve")
int hello(struct pt_regs *ctx) {