Skip to content

Commit

Permalink
feat: support bpf prog check in ci
Browse files Browse the repository at this point in the history
Signed-off-by: bingshen.wbs <[email protected]>
  • Loading branch information
BSWANG committed Apr 15, 2024
1 parent ca01d07 commit 446beab
Show file tree
Hide file tree
Showing 31 changed files with 36 additions and 64 deletions.
13 changes: 13 additions & 0 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,3 +72,16 @@ jobs:
VALIDATE_MD: true
DEFAULT_BRANCH: main
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

check-btf:
runs-on: ubuntu-latest
steps:
- name: build-btf
run: |
cd ${{ github.workspace }} && make generate-btf-in-container
- name: check-btf-update
run: |
if [ -n "$(git status --porcelain)" ]; then
echo "Please run 'make generate-btf-in-container' and submit your changes"
exit 1
fi
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,7 @@ build-webconsole:
.PHONY: generate-btf
generate-btf:
go generate ./pkg/exporter/probe/...

.PHONY: generate-btf-in-container
generate-btf-in-container:
docker run -v $(PWD):/go/src/github.com/alibaba/kubeskoop --workdir /go/src/github.com/alibaba/kubeskoop kubeskoop/bpf-build:go121-clang17 go generate ./pkg/exporter/probe/...
Binary file modified pkg/exporter/probe/flow/bpf_bpfeb.o
Binary file not shown.
Binary file modified pkg/exporter/probe/flow/bpf_bpfel.o
Binary file not shown.
Binary file modified pkg/exporter/probe/tracebiolatency/bpf_bpfeb.o
Binary file not shown.
Binary file modified pkg/exporter/probe/tracebiolatency/bpf_bpfel.o
Binary file not shown.
10 changes: 2 additions & 8 deletions pkg/exporter/probe/tracekernel/bpf_bpfeb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified pkg/exporter/probe/tracekernel/bpf_bpfeb.o
Binary file not shown.
10 changes: 2 additions & 8 deletions pkg/exporter/probe/tracekernel/bpf_bpfel.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified pkg/exporter/probe/tracekernel/bpf_bpfel.o
Binary file not shown.
10 changes: 2 additions & 8 deletions pkg/exporter/probe/tracenetiftxlatency/bpf_bpfeb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified pkg/exporter/probe/tracenetiftxlatency/bpf_bpfeb.o
Binary file not shown.
10 changes: 2 additions & 8 deletions pkg/exporter/probe/tracenetiftxlatency/bpf_bpfel.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified pkg/exporter/probe/tracenetiftxlatency/bpf_bpfel.o
Binary file not shown.
Binary file modified pkg/exporter/probe/tracepacketloss/bpf_bpfeb.o
Binary file not shown.
Binary file modified pkg/exporter/probe/tracepacketloss/bpf_bpfel.o
Binary file not shown.
10 changes: 2 additions & 8 deletions pkg/exporter/probe/tracesocketlatency/bpf_bpfeb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified pkg/exporter/probe/tracesocketlatency/bpf_bpfeb.o
Binary file not shown.
10 changes: 2 additions & 8 deletions pkg/exporter/probe/tracesocketlatency/bpf_bpfel.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified pkg/exporter/probe/tracesocketlatency/bpf_bpfel.o
Binary file not shown.
Binary file modified pkg/exporter/probe/tracesoftirq/bpf_bpfeb.o
Binary file not shown.
Binary file modified pkg/exporter/probe/tracesoftirq/bpf_bpfel.o
Binary file not shown.
10 changes: 2 additions & 8 deletions pkg/exporter/probe/tracetcpreset/bpf_bpfeb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified pkg/exporter/probe/tracetcpreset/bpf_bpfeb.o
Binary file not shown.
10 changes: 2 additions & 8 deletions pkg/exporter/probe/tracetcpreset/bpf_bpfel.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified pkg/exporter/probe/tracetcpreset/bpf_bpfel.o
Binary file not shown.
Binary file modified pkg/exporter/probe/tracetcpretrans/bpf_bpfeb.o
Binary file not shown.
Binary file modified pkg/exporter/probe/tracetcpretrans/bpf_bpfel.o
Binary file not shown.
Binary file modified pkg/exporter/probe/tracevirtcmdlat/bpf_bpfeb.o
Binary file not shown.
Binary file modified pkg/exporter/probe/tracevirtcmdlat/bpf_bpfel.o
Binary file not shown.
3 changes: 3 additions & 0 deletions tools/Dockerfile.dev
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FROM alpine:3.19
RUN apk add clang=17.0.5-r0 llvm=17.0.5-r0 go=1.21.9-r0 make bash
RUN go install github.com/cilium/ebpf/cmd/bpf2go@latest

0 comments on commit 446beab

Please sign in to comment.