Skip to content

Commit 924c6fa

Browse files
authored
chore(deps): update github.com/cilium/ebpf to v0.17.1 (#232)
* 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
1 parent 3f1dab8 commit 924c6fa

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

93 files changed

+3155
-829
lines changed

.github/workflows/test.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,8 @@ jobs:
8888
# renovate: datasource=docker depName=quay.io/lvh-images/kernel-images
8989
- '6.6-20241031.113911'
9090
# renovate: datasource=docker depName=quay.io/lvh-images/kernel-images
91+
- '6.12-20250116.014736'
92+
# renovate: datasource=docker depName=quay.io/lvh-images/kernel-images
9193
- 'bpf-20241101.013334'
9294
# renovate: datasource=docker depName=quay.io/lvh-images/kernel-images
9395
- 'bpf-next-20241101.013334'
@@ -300,10 +302,12 @@ jobs:
300302
exit 1
301303
302304
- name: build demo app
305+
if: ${{ (!startsWith(matrix.kernel, '5.4')) && (!startsWith(matrix.kernel, '4.')) }}
303306
run: |
304307
make -C testdata/gohttpapp build
305308
306309
- name: Test go tls keylog (unstripped)
310+
if: ${{ (!startsWith(matrix.kernel, '5.4')) && (!startsWith(matrix.kernel, '4.')) }}
307311
uses: cilium/little-vm-helper@97c89f004bd0ab4caeacfe92ebc956e13e362e6b # v0.0.19
308312
with:
309313
provision: 'false'
@@ -322,6 +326,7 @@ jobs:
322326
exit 1
323327
324328
- name: Test go tls keylog (PIE)
329+
if: ${{ (!startsWith(matrix.kernel, '5.4')) && (!startsWith(matrix.kernel, '4.')) }}
325330
uses: cilium/little-vm-helper@97c89f004bd0ab4caeacfe92ebc956e13e362e6b # v0.0.19
326331
with:
327332
provision: 'false'
@@ -340,6 +345,7 @@ jobs:
340345
exit 1
341346
342347
- name: Test go tls keylog (stripped)
348+
if: ${{ (!startsWith(matrix.kernel, '5.4')) && (!startsWith(matrix.kernel, '4.')) }}
343349
uses: cilium/little-vm-helper@97c89f004bd0ab4caeacfe92ebc956e13e362e6b # v0.0.19
344350
with:
345351
provision: 'false'
@@ -358,6 +364,7 @@ jobs:
358364
exit 1
359365
360366
- name: Test go tls keylog (stripped + PIE)
367+
if: ${{ (!startsWith(matrix.kernel, '5.4')) && (!startsWith(matrix.kernel, '4.')) }}
361368
uses: cilium/little-vm-helper@97c89f004bd0ab4caeacfe92ebc956e13e362e6b # v0.0.19
362369
with:
363370
provision: 'false'

bpf/bpf.go

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import (
2424
//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
2525

2626
const tcFilterName = "ptcpdump"
27-
const logSzie = ebpf.DefaultVerifierLogSize * 64
27+
const logSzie = 64 * 1024 * 64
2828

2929
type BPF struct {
3030
spec *ebpf.CollectionSpec
@@ -117,9 +117,7 @@ func (b *BPF) Load(opts Options) error {
117117
}
118118
if !b.isLegacyKernel {
119119
log.Infof("rewrite constants with %+v", config)
120-
err = b.spec.RewriteConstants(map[string]interface{}{
121-
"g": config,
122-
})
120+
err = b.spec.Variables["g"].Set(config)
123121
if err != nil {
124122
return fmt.Errorf("rewrite constants: %w", err)
125123
}
@@ -136,12 +134,13 @@ load:
136134
loadCount++
137135
err = b.spec.LoadAndAssign(b.objs, &ebpf.CollectionOptions{
138136
Programs: ebpf.ProgramOptions{
139-
KernelTypes: opts.kernelTypes,
140-
LogLevel: ebpf.LogLevelInstruction,
141-
LogSize: logSzie,
137+
KernelTypes: opts.kernelTypes,
138+
LogLevel: ebpf.LogLevelInstruction,
139+
LogSizeStart: logSzie,
142140
},
143141
IgnoreUnknownProgram: true,
144142
IgnoreNotSupportedProgram: true,
143+
IgnoreUnknownVariable: true,
145144
})
146145
if err != nil {
147146
log.Infof("load and assign failed: %+v", err)

bpf/bpf_arm64_bpfel.go

Lines changed: 35 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bpf/bpf_arm64_bpfel.o

24 Bytes
Binary file not shown.

bpf/bpf_legacy_arm64_bpfel.go

Lines changed: 33 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bpf/bpf_legacy_arm64_bpfel.o

0 Bytes
Binary file not shown.

bpf/bpf_legacy_x86_bpfel.go

Lines changed: 33 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bpf/bpf_legacy_x86_bpfel.o

0 Bytes
Binary file not shown.

bpf/bpf_no_tracing_arm64_bpfel.go

Lines changed: 35 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bpf/bpf_no_tracing_arm64_bpfel.o

24 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)