Skip to content

Commit 5fa7c06

Browse files
veocfc4n
authored andcommitted
add LinkPinPath
1 parent ddf2a1a commit 5fa7c06

File tree

10 files changed

+1853
-1
lines changed

10 files changed

+1853
-1
lines changed

examples/link_pinning/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
bin/
2+
ebpf/bin/

examples/link_pinning/Makefile

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
all: build-ebpf build run
2+
3+
build-ebpf:
4+
mkdir -p ebpf/bin
5+
clang -D__KERNEL__ -D__ASM_SYSREG_H \
6+
-Wno-unused-value \
7+
-Wno-pointer-sign \
8+
-Wno-compare-distinct-pointer-types \
9+
-Wunused \
10+
-Wall \
11+
-Werror \
12+
-I/lib/modules/$$(uname -r)/build/include \
13+
-I/lib/modules/$$(uname -r)/build/include/uapi \
14+
-I/lib/modules/$$(uname -r)/build/include/generated/uapi \
15+
-I/lib/modules/$$(uname -r)/build/arch/x86/include \
16+
-I/lib/modules/$$(uname -r)/build/arch/x86/include/uapi \
17+
-I/lib/modules/$$(uname -r)/build/arch/x86/include/generated \
18+
-O2 -emit-llvm \
19+
ebpf/main.c \
20+
-c -o - | llc -march=bpf -filetype=obj -o ebpf/bin/probe.o
21+
go run github.com/shuLhan/go-bindata/cmd/go-bindata -pkg main -prefix "ebpf/bin" -o "probe.go" "ebpf/bin/probe.o"
22+
23+
build:
24+
go build -o bin/main .
25+
26+
run:
27+
sudo bin/main

0 commit comments

Comments
 (0)