-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
42 lines (33 loc) · 1.59 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
CLANG ?= clang-12
CFLAGS := '-O2 -g -Wall -Werror $(CFLAGS)'
TARGETS ?= amd64
HEADERS ?= ./ebpf/headers
all: probe-hello probe-openat probe-tcpstate probe-tcpretrans probe-capable build
probe-hello: export GOPACKAGE=hello
probe-hello:
bpf2go -cc $(CLANG) -cflags $(CFLAGS) -target $(TARGETS) -output-stem hello kpHello ./ebpf/hello.bpf.c -- -I $(HEADERS)
mv hello_*.* ./probes/hello
probe-openat: export GOPACKAGE=openat
probe-openat:
bpf2go -cc $(CLANG) -cflags $(CFLAGS) -target $(TARGETS) -output-stem openat -type sys_openat_event bpf ./ebpf/tp_openat.bpf.c -- -I $(HEADERS)
mv openat_*.* ./probes/openat
probe-tcpstate: export GOPACKAGE=tcpstate
probe-tcpstate:
bpf2go -cc $(CLANG) -cflags $(CFLAGS) -target $(TARGETS) -output-stem tcpstate -type net_tcp_event bpf ./ebpf/tcp_connect.bpf.c -- -I $(HEADERS)
mv tcpstate_*.* ./probes/tcpstate
probe-tcpretrans: export GOPACKAGE=tcpretrans
probe-tcpretrans:
bpf2go -cc $(CLANG) -cflags $(CFLAGS) -target $(TARGETS) -output-stem tcpretrans -type net_tcp_event bpf ./ebpf/tcp_retrans.bpf.c -- -I $(HEADERS)
mv tcpretrans_*.* ./probes/tcpretrans
probe-tcpreset: export GOPACKAGE=tcpreset
probe-tcpreset:
bpf2go -cc $(CLANG) -cflags $(CFLAGS) -target $(TARGETS) -output-stem tcpreset -type net_tcp_event bpf ./ebpf/tcp_reset.bpf.c -- -I $(HEADERS)
mv tcpreset_*.* ./probes/tcpreset
probe-capable: export GOPACKAGE=capable
probe-capable:
bpf2go -cc $(CLANG) -cflags $(CFLAGS) -target $(TARGETS) -output-stem capable -type sys_capable_event bpf ./ebpf/sys_capable.bpf.c -- -I $(HEADERS)
mv capable_*.* ./probes/capable
build:
go build -o jebpf
run:
./jebpf