Skip to content

Commit

Permalink
chore(deps): update github.com/cilium/ebpf to v0.17.1 (#232)
Browse files Browse the repository at this point in the history
* chore(deps): update github.com/cilium/ebpf to v0.17.1

* skip some tests when running on linux 4.19 and add test for 6.12

* fix running on linux 4.19 ~ 5.5 failed
  • Loading branch information
mozillazg authored Jan 18, 2025
1 parent 3f1dab8 commit 924c6fa
Show file tree
Hide file tree
Showing 93 changed files with 3,155 additions and 829 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ jobs:
# renovate: datasource=docker depName=quay.io/lvh-images/kernel-images
- '6.6-20241031.113911'
# renovate: datasource=docker depName=quay.io/lvh-images/kernel-images
- '6.12-20250116.014736'
# renovate: datasource=docker depName=quay.io/lvh-images/kernel-images
- 'bpf-20241101.013334'
# renovate: datasource=docker depName=quay.io/lvh-images/kernel-images
- 'bpf-next-20241101.013334'
Expand Down Expand Up @@ -300,10 +302,12 @@ jobs:
exit 1
- name: build demo app
if: ${{ (!startsWith(matrix.kernel, '5.4')) && (!startsWith(matrix.kernel, '4.')) }}
run: |
make -C testdata/gohttpapp build
- name: Test go tls keylog (unstripped)
if: ${{ (!startsWith(matrix.kernel, '5.4')) && (!startsWith(matrix.kernel, '4.')) }}
uses: cilium/little-vm-helper@97c89f004bd0ab4caeacfe92ebc956e13e362e6b # v0.0.19
with:
provision: 'false'
Expand All @@ -322,6 +326,7 @@ jobs:
exit 1
- name: Test go tls keylog (PIE)
if: ${{ (!startsWith(matrix.kernel, '5.4')) && (!startsWith(matrix.kernel, '4.')) }}
uses: cilium/little-vm-helper@97c89f004bd0ab4caeacfe92ebc956e13e362e6b # v0.0.19
with:
provision: 'false'
Expand All @@ -340,6 +345,7 @@ jobs:
exit 1
- name: Test go tls keylog (stripped)
if: ${{ (!startsWith(matrix.kernel, '5.4')) && (!startsWith(matrix.kernel, '4.')) }}
uses: cilium/little-vm-helper@97c89f004bd0ab4caeacfe92ebc956e13e362e6b # v0.0.19
with:
provision: 'false'
Expand All @@ -358,6 +364,7 @@ jobs:
exit 1
- name: Test go tls keylog (stripped + PIE)
if: ${{ (!startsWith(matrix.kernel, '5.4')) && (!startsWith(matrix.kernel, '4.')) }}
uses: cilium/little-vm-helper@97c89f004bd0ab4caeacfe92ebc956e13e362e6b # v0.0.19
with:
provision: 'false'
Expand Down
13 changes: 6 additions & 7 deletions bpf/bpf.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (
//go:generate go run github.com/cilium/ebpf/cmd/bpf2go -cc clang -no-strip -target $TARGET -type gconfig_t -type packet_event_t -type exec_event_t -type exit_event_t -type flow_pid_key_t -type process_meta_t -type packet_event_meta_t -type go_keylog_event_t -type new_netdevice_event_t -type netdevice_change_event_t -type mount_event_t Bpf ./ptcpdump.c -- -I./headers -I./headers/$TARGET -I. -Wall

const tcFilterName = "ptcpdump"
const logSzie = ebpf.DefaultVerifierLogSize * 64
const logSzie = 64 * 1024 * 64

type BPF struct {
spec *ebpf.CollectionSpec
Expand Down Expand Up @@ -117,9 +117,7 @@ func (b *BPF) Load(opts Options) error {
}
if !b.isLegacyKernel {
log.Infof("rewrite constants with %+v", config)
err = b.spec.RewriteConstants(map[string]interface{}{
"g": config,
})
err = b.spec.Variables["g"].Set(config)
if err != nil {
return fmt.Errorf("rewrite constants: %w", err)
}
Expand All @@ -136,12 +134,13 @@ load:
loadCount++
err = b.spec.LoadAndAssign(b.objs, &ebpf.CollectionOptions{
Programs: ebpf.ProgramOptions{
KernelTypes: opts.kernelTypes,
LogLevel: ebpf.LogLevelInstruction,
LogSize: logSzie,
KernelTypes: opts.kernelTypes,
LogLevel: ebpf.LogLevelInstruction,
LogSizeStart: logSzie,
},
IgnoreUnknownProgram: true,
IgnoreNotSupportedProgram: true,
IgnoreUnknownVariable: true,
})
if err != nil {
log.Infof("load and assign failed: %+v", err)
Expand Down
36 changes: 35 additions & 1 deletion bpf/bpf_arm64_bpfel.go

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

Binary file modified bpf/bpf_arm64_bpfel.o
Binary file not shown.
34 changes: 33 additions & 1 deletion bpf/bpf_legacy_arm64_bpfel.go

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

Binary file modified bpf/bpf_legacy_arm64_bpfel.o
Binary file not shown.
34 changes: 33 additions & 1 deletion bpf/bpf_legacy_x86_bpfel.go

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

Binary file modified bpf/bpf_legacy_x86_bpfel.o
Binary file not shown.
36 changes: 35 additions & 1 deletion bpf/bpf_no_tracing_arm64_bpfel.go

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

Binary file modified bpf/bpf_no_tracing_arm64_bpfel.o
Binary file not shown.
Loading

0 comments on commit 924c6fa

Please sign in to comment.