mirror of
https://github.com/varun-r-mallya/Python-BPF.git
synced 2025-12-31 21:06:25 +00:00
get hashmap compiling
This commit is contained in:
@ -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)
|
||||
|
||||
@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user