mirror of
https://github.com/kubeshark/kubeshark.git
synced 2025-08-16 07:36:04 +00:00
Define and use BPF_CFLAGS
environment variable
This commit is contained in:
parent
1f70eab0a4
commit
9f8e9cc91f
@ -6,13 +6,18 @@ MIZU_HOME=$(realpath ../../../)
|
|||||||
|
|
||||||
docker build -t mizu-ebpf-builder . || exit 1
|
docker build -t mizu-ebpf-builder . || exit 1
|
||||||
|
|
||||||
|
BPF_CFLAGS="-O2 -g -D__TARGET_ARCH_x86"
|
||||||
|
if [[ $1 == "arm64" ]]; then
|
||||||
|
BPF_CFLAGS="-O2 -g -D__TARGET_ARCH_arm64"
|
||||||
|
fi
|
||||||
|
|
||||||
docker run --rm \
|
docker run --rm \
|
||||||
--name mizu-ebpf-builder \
|
--name mizu-ebpf-builder \
|
||||||
-v $MIZU_HOME:/mizu \
|
-v $MIZU_HOME:/mizu \
|
||||||
-v $(go env GOPATH):/root/go \
|
-v $(go env GOPATH):/root/go \
|
||||||
-it mizu-ebpf-builder \
|
-it mizu-ebpf-builder \
|
||||||
sh -c "
|
sh -c "
|
||||||
go generate tap/tlstapper/tls_tapper.go
|
BPF_CFLAGS=\"$BPF_CFLAGS\" go generate tap/tlstapper/tls_tapper.go
|
||||||
chown $(id -u):$(id -g) tap/tlstapper/tlstapper_bpfeb.go
|
chown $(id -u):$(id -g) tap/tlstapper/tlstapper_bpfeb.go
|
||||||
chown $(id -u):$(id -g) tap/tlstapper/tlstapper_bpfeb.o
|
chown $(id -u):$(id -g) tap/tlstapper/tlstapper_bpfeb.o
|
||||||
chown $(id -u):$(id -g) tap/tlstapper/tlstapper_bpfel.go
|
chown $(id -u):$(id -g) tap/tlstapper/tlstapper_bpfel.go
|
||||||
|
@ -12,7 +12,7 @@ import (
|
|||||||
|
|
||||||
const GLOABL_TAP_PID = 0
|
const GLOABL_TAP_PID = 0
|
||||||
|
|
||||||
//go:generate go run github.com/cilium/ebpf/cmd/bpf2go@0d0727ef53e2f53b1731c73f4c61e0f58693083a -type tls_chunk tlsTapper bpf/tls_tapper.c -- -O2 -g -D__TARGET_ARCH_x86
|
//go:generate go run github.com/cilium/ebpf/cmd/bpf2go@0d0727ef53e2f53b1731c73f4c61e0f58693083a -cflags $BPF_CFLAGS -type tls_chunk tlsTapper bpf/tls_tapper.c
|
||||||
|
|
||||||
type TlsTapper struct {
|
type TlsTapper struct {
|
||||||
bpfObjects tlsTapperObjects
|
bpfObjects tlsTapperObjects
|
||||||
|
Loading…
Reference in New Issue
Block a user