Skip to content

Commit

Permalink
add LinkPinPath
Browse files Browse the repository at this point in the history
  • Loading branch information
veo authored and cfc4n committed Dec 26, 2023
1 parent ddf2a1a commit 5fa7c06
Show file tree
Hide file tree
Showing 10 changed files with 1,853 additions and 1 deletion.
2 changes: 2 additions & 0 deletions examples/link_pinning/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
bin/
ebpf/bin/
27 changes: 27 additions & 0 deletions examples/link_pinning/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
all: build-ebpf build run

build-ebpf:
mkdir -p ebpf/bin
clang -D__KERNEL__ -D__ASM_SYSREG_H \
-Wno-unused-value \
-Wno-pointer-sign \
-Wno-compare-distinct-pointer-types \
-Wunused \
-Wall \
-Werror \
-I/lib/modules/$$(uname -r)/build/include \
-I/lib/modules/$$(uname -r)/build/include/uapi \
-I/lib/modules/$$(uname -r)/build/include/generated/uapi \
-I/lib/modules/$$(uname -r)/build/arch/x86/include \
-I/lib/modules/$$(uname -r)/build/arch/x86/include/uapi \
-I/lib/modules/$$(uname -r)/build/arch/x86/include/generated \
-O2 -emit-llvm \
ebpf/main.c \
-c -o - | llc -march=bpf -filetype=obj -o ebpf/bin/probe.o
go run github.com/shuLhan/go-bindata/cmd/go-bindata -pkg main -prefix "ebpf/bin" -o "probe.go" "ebpf/bin/probe.o"

build:
go build -o bin/main .

run:
sudo bin/main
Loading

0 comments on commit 5fa7c06

Please sign in to comment.