mirror of
https://github.com/varun-r-mallya/Python-BPF.git
synced 2025-12-31 21:06:25 +00:00
emit BTF data using -g flag
This commit is contained in:
@ -1,16 +1,16 @@
|
|||||||
BPF_CLANG := clang
|
BPF_CLANG := clang
|
||||||
CFLAGS := -O2 -emit-llvm -target bpf -c
|
CFLAGS := -O2 -emit-llvm -target bpf -c
|
||||||
|
|
||||||
SRC := example.bpf.c
|
SRC := ex3.bpf.c
|
||||||
OUT := example.bpf.ll
|
OUT := ex3.bpf.ll
|
||||||
OBJECT := example.bpf.o
|
OBJECT := ex3.bpf.o
|
||||||
|
|
||||||
.PHONY: all clean
|
.PHONY: all clean
|
||||||
|
|
||||||
all: $(OUT)
|
all: $(OUT)
|
||||||
|
|
||||||
object: $(SRC)
|
object: $(SRC)
|
||||||
$(BPF_CLANG) -O2 -target bpf -c $< -o $(OBJECT)
|
$(BPF_CLANG) -O2 -g -target bpf -c $< -o $(OBJECT)
|
||||||
|
|
||||||
$(OUT): $(SRC) object
|
$(OUT): $(SRC) object
|
||||||
$(BPF_CLANG) $(CFLAGS) -S $< -o $@
|
$(BPF_CLANG) $(CFLAGS) -S $< -o $@
|
||||||
|
|||||||
@ -11,7 +11,7 @@ struct {
|
|||||||
__type(value, u64);
|
__type(value, u64);
|
||||||
} last SEC(".maps");
|
} last SEC(".maps");
|
||||||
|
|
||||||
SEC("kprobe/YOUR_PROBE_POINT") // Replace with actual probe point
|
SEC("kprobe/sys_clone") // Replace with actual probe point
|
||||||
int do_trace(struct pt_regs *ctx) {
|
int do_trace(struct pt_regs *ctx) {
|
||||||
u64 ts, *tsp, delta, key = 0;
|
u64 ts, *tsp, delta, key = 0;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user